Skip to content

Commit

Permalink
#43 Refactoring: Use logger in mojo
Browse files Browse the repository at this point in the history
- instead of println
  • Loading branch information
georgberky committed Oct 5, 2022
1 parent cee8bb1 commit 98343cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class UpdateMojo : AbstractMojo() {
artifactFactory = artifactFactory
)
.updates
.onEach { println("execute im mojo: latestVersion: '${it.latestVersion}' / version:'${it.version}'") }
.onEach { log.debug("execute in mojo: latestVersion: '${it.latestVersion}' / version:'${it.version}'") }
.filterNot (VersionUpdate::isAlreadyLatestVersion)
.onEach { println("execute im mojo canSkip: ${it.latestVersion}") }
.onEach { log.debug("execute in mojo after latest version check: ${it.latestVersion}") }
.map { it to "dependency-update/${it.groupId}-${it.artifactId}-${it.latestVersion}" }
.onEach { println("execute im mojo canSkip (nach map): ${it.second} ${it.first}") }
.onEach { log.debug("execute in mojo canSkip (after map): ${it.second} ${it.first}") }
.filter { (_, branchName) -> !git.hasRemoteBranch(branchName) }
.onEach { println("execute im mojo nach filter branches: ${it.second} ${it.first}") }
.onEach { log.debug("execute in mojo after filter branches: ${it.second} ${it.first}") }
.forEach { (update, branchName) ->
git.checkoutNewBranch(branchName)
val pom = update.updatedPom()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ abstract class VersionUpdate(
abstract fun updatedPom() : Document

fun isAlreadyLatestVersion() : Boolean {
// TODO #12: use DI-injected logger
println("canSkip: ${latestVersion} compare to ${version}")
println("latestVersion.equals(version) = ${latestVersion.equals(version)}")
return latestVersion != "null" && latestVersion != version
Expand Down

0 comments on commit 98343cd

Please sign in to comment.