mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 08:38:13 -07:00
clean up
This commit is contained in:
parent
f2aa5435ed
commit
93ea4eee5e
1 changed files with 10 additions and 12 deletions
|
@ -22,7 +22,7 @@ public class Pom @javax.inject.Inject constructor(@Assisted val id: String,
|
||||||
var repositories = listOf<String>()
|
var repositories = listOf<String>()
|
||||||
|
|
||||||
public interface IFactory {
|
public interface IFactory {
|
||||||
fun create(@Assisted id: String, @Assisted documentFile : java.io.File) : Pom
|
fun create(@Assisted id: String, @Assisted documentFile: java.io.File): Pom
|
||||||
}
|
}
|
||||||
|
|
||||||
data public class Dependency(val groupId: String, val artifactId: String, val version: String,
|
data public class Dependency(val groupId: String, val artifactId: String, val version: String,
|
||||||
|
@ -32,9 +32,9 @@ public class Pom @javax.inject.Inject constructor(@Assisted val id: String,
|
||||||
private val VAR = "$" + "{"
|
private val VAR = "$" + "{"
|
||||||
|
|
||||||
val mustDownload: Boolean
|
val mustDownload: Boolean
|
||||||
get() = ! optional && "provided" != scope && "test" != scope
|
get() = !optional && "provided" != scope && "test" != scope
|
||||||
|
|
||||||
val isValid : Boolean
|
val isValid: Boolean
|
||||||
get() {
|
get() {
|
||||||
var result = false
|
var result = false
|
||||||
if (version.contains(VAR)) {
|
if (version.contains(VAR)) {
|
||||||
|
@ -64,15 +64,13 @@ public class Pom @javax.inject.Inject constructor(@Assisted val id: String,
|
||||||
version = XPATH.compile("/project/version").evaluate(document)
|
version = XPATH.compile("/project/version").evaluate(document)
|
||||||
name = XPATH.compile("/project/name").evaluate(document)
|
name = XPATH.compile("/project/name").evaluate(document)
|
||||||
var repositoriesList = XPATH.compile("/project/repositories").evaluate(document, XPathConstants.NODESET) as NodeList
|
var repositoriesList = XPATH.compile("/project/repositories").evaluate(document, XPathConstants.NODESET) as NodeList
|
||||||
// if (repositoriesList.getLength() != 0) {
|
var repoElem = repositoriesList.item(0) as Element?
|
||||||
var elem = repositoriesList.item(0) as Element?
|
repositories = repoElem.childElements()
|
||||||
repositories = elem.childElements()
|
|
||||||
.map({ it.getElementsByTagName("url").item(0).textContent })
|
.map({ it.getElementsByTagName("url").item(0).textContent })
|
||||||
// }
|
|
||||||
|
|
||||||
val propertiesList = XPATH.compile("/project/properties").evaluate(document, XPathConstants.NODESET) as NodeList
|
val propertiesList = XPATH.compile("/project/properties").evaluate(document, XPathConstants.NODESET) as NodeList
|
||||||
/*var*/ elem = propertiesList.item(0) as Element?
|
var propsElem = propertiesList.item(0) as Element?
|
||||||
elem.childElements().forEach {
|
propsElem.childElements().forEach {
|
||||||
properties.put(it.nodeName, it.textContent)
|
properties.put(it.nodeName, it.textContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue