From 04e6118030f1764bd82f637223f6fdcbfac52ce9 Mon Sep 17 00:00:00 2001 From: MarcBauer-LM <74406518+MarcBauer-LM@users.noreply.github.com> Date: Wed, 3 May 2023 10:33:10 +0200 Subject: [PATCH] Add file count and progress indicators to language scripts. (#336) * Add file count and progress indicators to language scripts. Signed-off-by: Marc Bauer <74406518+MarcBauer-LM@users.noreply.github.com> --- languages/Assembler.groovy | 7 ++++--- languages/BMS.groovy | 8 ++++---- languages/Cobol.groovy | 7 ++++--- languages/DBDgen.groovy | 7 ++++--- languages/LinkEdit.groovy | 7 ++++--- languages/MFS.groovy | 7 ++++--- languages/PLI.groovy | 7 ++++--- languages/PSBgen.groovy | 7 ++++--- languages/REXX.groovy | 7 ++++--- languages/Transfer.groovy | 8 ++++---- languages/ZunitConfig.groovy | 8 ++++---- 11 files changed, 44 insertions(+), 36 deletions(-) diff --git a/languages/Assembler.groovy b/languages/Assembler.groovy index 0e47999e..124050e7 100644 --- a/languages/Assembler.groovy +++ b/languages/Assembler.groovy @@ -12,7 +12,7 @@ import com.ibm.dbb.build.report.records.* @Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy")) @Field def impactUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ImpactUtilities.groovy")) -println("** Building files mapped to ${this.class.getName()}.groovy script") +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.assembler_requiredBuildProperties) @@ -21,11 +21,12 @@ def langQualifier = "assembler" buildUtils.createLanguageDatasets(langQualifier) // sort the build list based on build file rank if provided -List sortedList = buildUtils.sortBuildList(argMap.buildList, 'assembler_fileBuildRank') +List sortedList = buildUtils.sortBuildList(argMap.buildList.sort(), 'assembler_fileBuildRank') +int currentBuildFileNumber = 1 // iterate through build list sortedList.each { buildFile -> - println "*** Building file $buildFile" + println "*** (${currentBuildFileNumber++}/${sortedList.size()}) Building file $buildFile" // Configure dependency resolution String dependencySearch = props.getFileProperty('assembler_dependencySearch', buildFile) diff --git a/languages/BMS.groovy b/languages/BMS.groovy index f8482f1a..25c0812e 100644 --- a/languages/BMS.groovy +++ b/languages/BMS.groovy @@ -9,7 +9,7 @@ import groovy.transform.* @Field BuildProperties props = BuildProperties.getInstance() @Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy")) -println("** Building files mapped to ${this.class.getName()}.groovy script") +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.bms_requiredBuildProperties) @@ -18,11 +18,11 @@ def langQualifier = "bms" buildUtils.createLanguageDatasets(langQualifier) // sort the build list based on build file rank if provided -List sortedList = buildUtils.sortBuildList(argMap.buildList, 'bms_fileBuildRank') - +List sortedList = buildUtils.sortBuildList(argMap.buildList.sort(), 'bms_fileBuildRank') +int currentBuildFileNumber = 1 // iterate through build list sortedList.each { buildFile -> - println "*** Building file $buildFile" + println "*** (${currentBuildFileNumber++}/${sortedList.size()}) Building file $buildFile" // copy build file to input data set buildUtils.copySourceFiles(buildFile, props.bms_srcPDS, null, null, null) diff --git a/languages/Cobol.groovy b/languages/Cobol.groovy index a5e43242..7639304e 100644 --- a/languages/Cobol.groovy +++ b/languages/Cobol.groovy @@ -14,7 +14,7 @@ import com.ibm.dbb.build.report.records.* @Field def impactUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ImpactUtilities.groovy")) @Field def bindUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BindUtilities.groovy")) -println("** Building files mapped to ${this.class.getName()}.groovy script") +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.cobol_requiredBuildProperties) @@ -24,7 +24,8 @@ def langQualifier = "cobol" buildUtils.createLanguageDatasets(langQualifier) // sort the build list based on build file rank if provided -List sortedList = buildUtils.sortBuildList(argMap.buildList, 'cobol_fileBuildRank') +List sortedList = buildUtils.sortBuildList(argMap.buildList.sort(), 'cobol_fileBuildRank') +int currentBuildFileNumber = 1 if (buildListContainsTests(sortedList)) { langQualifier = "cobol_test" @@ -33,7 +34,7 @@ if (buildListContainsTests(sortedList)) { // iterate through build list sortedList.each { buildFile -> - println "*** Building file $buildFile" + println "*** (${currentBuildFileNumber++}/${sortedList.size()}) Building file $buildFile" // Check if this a testcase isZUnitTestCase = (props.getFileProperty('cobol_testcase', buildFile).equals('true')) ? true : false diff --git a/languages/DBDgen.groovy b/languages/DBDgen.groovy index 09f38cc8..cfdb69d7 100644 --- a/languages/DBDgen.groovy +++ b/languages/DBDgen.groovy @@ -8,7 +8,7 @@ import groovy.transform.* @Field BuildProperties props = BuildProperties.getInstance() @Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy")) -println("** Building files mapped to ${this.class.getName()}.groovy script") +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.dbdgen_requiredBuildProperties) @@ -17,11 +17,12 @@ def langQualifier = "dbdgen" buildUtils.createLanguageDatasets(langQualifier) // sort the build list based on build file rank if provided -List sortedList = buildUtils.sortBuildList(argMap.buildList, 'dbdgen_fileBuildRank') +List sortedList = buildUtils.sortBuildList(argMap.buildList.sort(), 'dbdgen_fileBuildRank') +int currentBuildFileNumber = 1 // iterate through build list sortedList.each { buildFile -> - println "*** Building file $buildFile" + println "*** (${currentBuildFileNumber++}/${sortedList.size()}) Building file $buildFile" // copy build file to input data set buildUtils.copySourceFiles(buildFile, props.dbdgen_srcPDS, null, null, null) diff --git a/languages/LinkEdit.groovy b/languages/LinkEdit.groovy index 25a04301..8b7c4b06 100644 --- a/languages/LinkEdit.groovy +++ b/languages/LinkEdit.groovy @@ -10,7 +10,7 @@ import groovy.transform.* @Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy")) @Field def impactUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ImpactUtilities.groovy")) -println("** Building files mapped to ${this.class.getName()}.groovy script") +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.linkedit_requiredBuildProperties) @@ -19,11 +19,12 @@ def langQualifier = "linkedit" buildUtils.createLanguageDatasets(langQualifier) // sort the build list based on build file rank if provided -List sortedList = buildUtils.sortBuildList(argMap.buildList, 'linkedit_fileBuildRank') +List sortedList = buildUtils.sortBuildList(argMap.buildList.sort(), 'linkedit_fileBuildRank') +int currentBuildFileNumber = 1 // iterate through build list sortedList.each { buildFile -> - println "*** Building file $buildFile" + println "*** (${currentBuildFileNumber++}/${sortedList.size()}) Building file $buildFile" // copy build file to input data set buildUtils.copySourceFiles(buildFile, props.linkedit_srcPDS, null, null, null) diff --git a/languages/MFS.groovy b/languages/MFS.groovy index 86fa4028..c03f1b83 100644 --- a/languages/MFS.groovy +++ b/languages/MFS.groovy @@ -10,7 +10,7 @@ import groovy.transform.* @Field BuildProperties props = BuildProperties.getInstance() @Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy")) -println("** Building files mapped to ${this.class.getName()}.groovy script") +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.mfs_requiredBuildProperties) @@ -19,11 +19,12 @@ def langQualifier = "mfs" buildUtils.createLanguageDatasets(langQualifier) // sort the build list based on build file rank if provided -List sortedList = buildUtils.sortBuildList(argMap.buildList, 'mfs_fileBuildRank') +List sortedList = buildUtils.sortBuildList(argMap.buildList.sort(), 'mfs_fileBuildRank') +int currentBuildFileNumber = 1 // iterate through build list sortedList.each { buildFile -> - println "*** Building file $buildFile" + println "*** (${currentBuildFileNumber++}/${sortedList.size()}) Building file $buildFile" // copy build file to input data set buildUtils.copySourceFiles(buildFile, props.mfs_srcPDS, null, null, null) diff --git a/languages/PLI.groovy b/languages/PLI.groovy index 090ea9fc..e6f924cd 100644 --- a/languages/PLI.groovy +++ b/languages/PLI.groovy @@ -13,7 +13,7 @@ import com.ibm.dbb.build.report.records.* @Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy")) @Field def impactUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ImpactUtilities.groovy")) -println("** Building files mapped to ${this.class.getName()}.groovy script") +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.pli_requiredBuildProperties) @@ -22,7 +22,8 @@ def langQualifier = "pli" buildUtils.createLanguageDatasets(langQualifier) // sort the build list based on build file rank if provided -List sortedList = buildUtils.sortBuildList(argMap.buildList, 'pli_fileBuildRank') +List sortedList = buildUtils.sortBuildList(argMap.buildList.sort(), 'pli_fileBuildRank') +int currentBuildFileNumber = 1 if (buildListContainsTests(sortedList)) { langQualifier = "pli_test" @@ -31,7 +32,7 @@ if (buildListContainsTests(sortedList)) { // iterate through build list sortedList.each { buildFile -> - println "*** Building file $buildFile" + println "*** (${currentBuildFileNumber++}/${sortedList.size()}) Building file $buildFile" // Check if this a testcase isZUnitTestCase = (props.getFileProperty('pli_testcase', buildFile).equals('true')) ? true : false diff --git a/languages/PSBgen.groovy b/languages/PSBgen.groovy index 3a7ace11..9f10fa3d 100644 --- a/languages/PSBgen.groovy +++ b/languages/PSBgen.groovy @@ -8,7 +8,7 @@ import groovy.transform.* @Field BuildProperties props = BuildProperties.getInstance() @Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy")) -println("** Building files mapped to ${this.class.getName()}.groovy script") +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.psbgen_requiredBuildProperties) @@ -20,11 +20,12 @@ def acbgenLangQualifier = "acbgen" buildUtils.createLanguageDatasets(acbgenLangQualifier) // sort the build list based on build file rank if provided -List sortedList = buildUtils.sortBuildList(argMap.buildList, 'psbgen_fileBuildRank') +List sortedList = buildUtils.sortBuildList(argMap.buildList.sort(), 'psbgen_fileBuildRank') +int currentBuildFileNumber = 1 // iterate through build list sortedList.each { buildFile -> - println "*** Building file $buildFile" + println "*** (${currentBuildFileNumber++}/${sortedList.size()}) Building file $buildFile" // copy build file to input data set buildUtils.copySourceFiles(buildFile, props.psbgen_srcPDS, null, null, null) diff --git a/languages/REXX.groovy b/languages/REXX.groovy index 9c9db0f5..ad4bd1df 100644 --- a/languages/REXX.groovy +++ b/languages/REXX.groovy @@ -11,7 +11,7 @@ import groovy.transform.* @Field def bindUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BindUtilities.groovy")) -println("** Building files mapped to ${this.class.getName()}.groovy script") +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.rexx_requiredBuildProperties) @@ -21,11 +21,12 @@ def langQualifier = "rexx" buildUtils.createLanguageDatasets(langQualifier) // sort the build list based on build file rank if provided -List sortedList = buildUtils.sortBuildList(argMap.buildList, 'rexx_fileBuildRank') +List sortedList = buildUtils.sortBuildList(argMap.buildList.sort(), 'rexx_fileBuildRank') +int currentBuildFileNumber = 1 // iterate through build list sortedList.each { buildFile -> - println "*** Building file $buildFile" + println "*** (${currentBuildFileNumber++}/${sortedList.size()}) Building file $buildFile" // configure dependency resolution and create logical file diff --git a/languages/Transfer.groovy b/languages/Transfer.groovy index 9f726ffa..b9ad7f64 100644 --- a/languages/Transfer.groovy +++ b/languages/Transfer.groovy @@ -40,16 +40,16 @@ import groovy.transform.* // Set to keep information about which datasets where already checked/created @Field HashSet verifiedBuildDatasets = new HashSet() -println("** Building files mapped to ${this.class.getName()}.groovy script") - +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.transfer_requiredBuildProperties) -List buildList = argMap.buildList +List buildList = argMap.buildList.sort() +int currentBuildFileNumber = 1 // iterate through build list buildList.each { buildFile -> - println "*** Transferring file $buildFile" + println "*** (${currentBuildFileNumber++}/${buildList.size()}) Transferring file $buildFile" // local variables and log file String member = CopyToPDS.createMemberName(buildFile) diff --git a/languages/ZunitConfig.groovy b/languages/ZunitConfig.groovy index 7dcd2e5f..84de7a95 100644 --- a/languages/ZunitConfig.groovy +++ b/languages/ZunitConfig.groovy @@ -11,7 +11,7 @@ import groovy.xml.* @Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy")) @Field def impactUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ImpactUtilities.groovy")) -println("** Building files mapped to ${this.class.getName()}.groovy script") +println("** Building ${argMap.buildList.size()} ${argMap.buildList.size() == 1 ? 'file' : 'files'} mapped to ${this.class.getName()}.groovy script") // verify required build properties buildUtils.assertBuildProperties(props.cobol_requiredBuildProperties) @@ -19,11 +19,11 @@ buildUtils.assertBuildProperties(props.zunit_requiredBuildProperties) def langQualifier = "zunit" buildUtils.createLanguageDatasets(langQualifier) - +int currentBuildFileNumber = 1 // iterate through build list -(argMap.buildList).each { buildFile -> - println "*** Building file $buildFile" +(argMap.buildList.sort()).each { buildFile -> + println "*** (${currentBuildFileNumber++}/${argMap.buildList.size()}) Building file $buildFile" String member = CopyToPDS.createMemberName(buildFile)