1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

Refactor.

This commit is contained in:
Cedric Beust 2016-07-21 07:17:51 -07:00
parent 67ab53f8a3
commit ab95e4fc75

View file

@ -77,10 +77,10 @@ fun glob(g: String) : IFileSpec.GlobSpec = IFileSpec.GlobSpec(g)
*/
@Directive
fun localMaven() : String {
var result = Kobalt.INJECTOR.getInstance(KobaltSettings::class.java).localMavenRepo
val pluginInfo = Kobalt.INJECTOR.getInstance(PluginInfo::class.java)
pluginInfo.localMavenRepoPathInterceptors.forEach {
result = File(it.repoPath(result.absolutePath))
val initial = Kobalt.INJECTOR.getInstance(KobaltSettings::class.java).localMavenRepo
val result = pluginInfo.localMavenRepoPathInterceptors.fold(initial) { current, interceptor ->
File(interceptor.repoPath(current.absolutePath))
}
return result.toURI().toString()
}