mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Initialize the Pom lazily.
This commit is contained in:
parent
1c6cf1acc4
commit
9f76eeabdc
1 changed files with 4 additions and 3 deletions
|
@ -54,9 +54,9 @@ public class Pom @javax.inject.Inject constructor(@Assisted val id: String,
|
||||||
val id: String = "$groupId:$artifactId:$version"
|
val id: String = "$groupId:$artifactId:$version"
|
||||||
}
|
}
|
||||||
|
|
||||||
var dependencies = arrayListOf<Dependency>()
|
val dependencies: List<Dependency> by lazy {
|
||||||
|
val result = arrayListOf<Dependency>()
|
||||||
|
|
||||||
init {
|
|
||||||
val DEPENDENCIES = XPATH.compile("/project/dependencies/dependency")
|
val DEPENDENCIES = XPATH.compile("/project/dependencies/dependency")
|
||||||
|
|
||||||
val document = kotlinx.dom.parseXml(InputSource(FileReader(documentFile)))
|
val document = kotlinx.dom.parseXml(InputSource(FileReader(documentFile)))
|
||||||
|
@ -99,8 +99,9 @@ public class Pom @javax.inject.Inject constructor(@Assisted val id: String,
|
||||||
}
|
}
|
||||||
log(3, "Done parsing: $groupId $artifactId $version")
|
log(3, "Done parsing: $groupId $artifactId $version")
|
||||||
val tmpDependency = Dependency(groupId!!, artifactId!!, packaging, version, optional!!, scope)
|
val tmpDependency = Dependency(groupId!!, artifactId!!, packaging, version, optional!!, scope)
|
||||||
dependencies.add(tmpDependency)
|
result.add(tmpDependency)
|
||||||
}
|
}
|
||||||
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
override public fun toString() = toString("Pom", id, "id")
|
override public fun toString() = toString("Pom", id, "id")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue