Skip to content

Commit

Permalink
Added logging
Browse files Browse the repository at this point in the history
  • Loading branch information
fobo66 authored and amv-bamboo committed Oct 2, 2019
1 parent fd7b178 commit 55ab1d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/kotlin/io/github/fobo66/PropertiesLoaderTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ open class PropertiesLoaderTask @Inject constructor(objects: ObjectFactory) : De

@TaskAction
fun loadProperties() {
logger.quiet("Starting loading properties")
propertiesFiles.files.stream()
.filter { file -> file.name.endsWith(".properties") }
.map {
logger.quiet("Trying to process properties file ${it.name}")
val properties = Properties()
properties.load(FileInputStream(it))
return@map properties
}
.flatMap {
logger.quiet("Switching to properties' entries")
return@flatMap it.entries.stream()
}
.forEach {
logger.quiet("Adding properties to extras")
project.extensions.extraProperties.set(it.component1().toString(), it.component2())
}
}
Expand Down

0 comments on commit 55ab1d5

Please sign in to comment.