IBM / dbb-zappbuild

zAppBuild is a generic build solution for building z/OS applications using Apache Groovy build scripts and IBM Dependency Based Build (DBB) APIs.
Apache License 2.0
40 stars 124 forks source link

Enhancement - Management of the built file counter in language.groovy: pre-increment rather than post-increment #394

Closed FALLAI-Denis closed 8 months ago

FALLAI-Denis commented 11 months ago

Hi,

Since version 3.2.0, zAppbuild displays the file number being built:

int currentBuildFileNumber = 1
sortedList.each { buildFile ->
    println "*** (${currentBuildFileNumber++}/${sortedList.size()}) Building file $buildFile"
    ...
}

I suggest modifying the code to pre-increment rather than post-increment the counter:

int currentBuildFileNumber = 0
sortedList.each { buildFile ->
    println "*** (${++currentBuildFileNumber}/${sortedList.size()}) Building file $buildFile"
    ...
}

Thus in the block of instructions of the iteration, the value of currentBuildFileNumber represents the rank of the file being built.

Thanks.