Skip to content

Commit

Permalink
Merge pull request #300 from IBM/zappbuild_301
Browse files Browse the repository at this point in the history
Release zAppBuild 3.0.1
  • Loading branch information
dennis-behm authored Dec 16, 2022
2 parents 99624f6 + c80098f commit 83fbf19
Show file tree
Hide file tree
Showing 37 changed files with 447 additions and 444 deletions.
120 changes: 103 additions & 17 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,79 +9,165 @@ However this will result in an error message because the build.groovy script has


Example:
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1
```sh
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1
```
Since we are still missing a build target or calculated build option, the build will run successfully but not actually build any programs.

## Common Pipeline Invocation Examples

**Build one program**
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 app1/cobol/epsmpmt.cbl
```sh
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
app1/cobol/epsmpmt.cbl
```
**Build a list of programs contained in a text file**
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 /u/usr1/buildList.txt
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
/u/usr1/buildList.txt
```
**Build all programs in the application**
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 --fullBuild
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--fullBuild
```
**Build only programs that have changed or are impacted by changed copybooks or include files since the last successful build**
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 --impactBuild
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--impactBuild
```
**Build only the changes which will be merged back to the main build branch. No calculation of impacted files.**
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 --mergeBuild
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--mergeBuild
```
**Only scan source files in the application to collect dependency data without actually creating load modules**
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 --fullBuild --scanOnly
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--fullBuild \
--scanOnly
```
**Scan source files and existing load modules for the application to collect dependency data for source and outputs without actually creating load modules**
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 --fullBuild --scanAll
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--fullBuild \
--scanAll
```
**Build programs with the 'Test' Options for debugging**
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 --debug --impactBuild
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--debug \
--impactBuild
```
**Use Code Coverage Headless Collector in zUnit Tests and specify parameters through command-line options (which override properties defined in ZunitConfig.properties)**
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 --fullBuild --cc --cch localhost --ccp 8009 --cco "e=CCPDF"
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--fullBuild \
--cc \
--cch localhost \
--ccp 8009 \
--cco "e=CCPDF"
```
## Common User Build Invocation Examples
**Build one program**

Build a single program in a user build context. Does not require use of the MetadataStore (filesystem or Db2)
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 --userBuild app1/cobol/epsmpmt.cbl
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--userBuild app1/cobol/epsmpmt.cbl
```
**Build one program using a [user build dependency file](samples/userBuildDependencyFile) predefining dependency information to skip DBB scans and dependency resolution.**

Build a single program in a user build context and provide the dependency information from the IDE to skip scanning the files on USS. Useful when building on IBM ZD&T or Wazi Sandbox environments.
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --outDir /u/build/out --hlq BUILD.APP1 --userBuild --dependencyFile userBuildDependencyFile.json app1/cobol/epsmpmt.cbl
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--userBuild \
--dependencyFile userBuildDependencyFile.json \
app1/cobol/epsmpmt.cbl
```
**Build one program with Debug Options**

Build a single program in a user build context including the configured TEST compile time options.
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --debug --outDir /u/build/out --hlq BUILD.APP1 --userBuild app1/cobol/epsmpmt.cbl
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--debug \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--userBuild app1/cobol/epsmpmt.cbl
```
**Build (Process) the zUnit Config file and start a debug session**

Process the zUnit bzucfg file in a user build context and initialize a debug session of the application under test. Requires the program under test to be compiled with Debug Options.
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --debugzUnitTestcase --outDir /u/build/out --hlq BUILD.APP1 --userBuild app1/testcfg/epsmpmt.bzucfg
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--debugzUnitTestcase \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--userBuild app1/testcfg/epsmpmt.bzucfg
```
**Build (Process) the zUnit Config file and collect code coverage data**

Process the zUnit bzucfg file in a user build context and direct the code coverage report to the user. Requires the program under test to be compiled with Debug Options.
```
$DBB_HOME/bin/groovyz build.groovy --workspace /u/build/repos --application app1 --ccczUnit --outDir /u/build/out --hlq BUILD.APP1 --userBuild app1/testcfg/epsmpmt.bzucfg
$DBB_HOME/bin/groovyz build.groovy \
--workspace /u/build/repos \
--application app1 \
--ccczUnit \
--outDir /u/build/out \
--hlq BUILD.APP1 \
--userBuild app1/testcfg/epsmpmt.bzucfg
```
## Command Line Options Summary
```
Expand Down
3 changes: 2 additions & 1 deletion build-conf/Assembler.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# Comma separated list of required build properties for language/Assembler.groovy
assembler_requiredBuildProperties=assembler_srcPDS,assembler_macroPDS,assembler_objPDS,assembler_loadPDS, \
assembler_pgm,assembler_linkEditor,assembler_tempOptions,assembler_maxRC, \
SASMMOD1,SDFHLOAD,SDFHMAC,MACLIB,SCEELKED,SCEEMAC
SASMMOD1,SDFHLOAD,SDFHMAC,MACLIB,SCEELKED,SCEEMAC, \
assembler_dependencySearch

#
# assembler source data sets
Expand Down
3 changes: 2 additions & 1 deletion build-conf/Cobol.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# Comma separated list of required build properties for Cobol.groovy
cobol_requiredBuildProperties=cobol_srcPDS,cobol_cpyPDS,cobol_objPDS,cobol_loadPDS,\
cobol_compiler,cobol_linkEditor,cobol_tempOptions,applicationOutputsCollectionName,\
SDFHCOB,SDFHLOAD,SDSNLOAD,SCEELKED
SDFHCOB,SDFHLOAD,SDSNLOAD,SCEELKED, \
cobol_dependencySearch

#
# COBOL compiler name
Expand Down
5 changes: 3 additions & 2 deletions build-conf/PLI.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
#
# Comma separated list of required build properties for PLI.groovy
pli_requiredBuildPropeties=pli_srcPDS,pli_incPDS,pli_objPDS,pli_loadPDS,\
pli_compiler,pli_linkEditor,pli_tempOptions,applicationOutputsCollectionName,\
SDFHCOB,SDFHLOAD,SDSNLOAD,SCEELKED
pli_compiler,pli_linkEditor,pli_tempOptions,applicationOutputsCollectionName,\
SDFHCOB,SDFHLOAD,SDSNLOAD,SCEELKED, \
pli_dependencySearch

#
# PL/I compiler name
Expand Down
3 changes: 2 additions & 1 deletion build-conf/REXX.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# Comma separated list of required build properties for REXX.groovy
rexx_requiredBuildProperties=rexx_srcPDS,rexx_objPDS,rexx_loadPDS,\
rexx_cexecPDS, rexx_compiler,rexx_linkEditor,rexx_tempOptions, \
SFANLMD
SFANLMD, \
rexx_dependencySearch

#
# rexx compiler name
Expand Down
3 changes: 2 additions & 1 deletion build-conf/ZunitConfig.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
zunit_requiredBuildProperties=zunit_srcDatasets,zunit_loadDatasets,zunit_reportDatasets,zunit_bzucfgPDS,\
zunit_bzureportPDS,zunit_bzuplayPDS,zunit_srcOptions,zunit_loadOptions,zunit_reportOptions,\
jobCard,zunit_maxPassRC,zunit_maxWarnRC,zunit_playbackFileExtension,zunit_resolutionRules,\
zunit_bzuplayParms,zunit_userDebugSessionTestParm
zunit_bzuplayParms,zunit_userDebugSessionTestParm, \
zunit_dependencySearch

zunit_bzucfgPDS=${hlq}.BZU.BZUCFG
zunit_bzureportPDS=${hlq}.BZU.BZURPT
Expand Down
2 changes: 1 addition & 1 deletion build-conf/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ applicationConfRootDir=
#
# Minimum required DBB ToolkitVersion to run this version of zAppBuild
# Build initialization process validates the DBB Toolkit Version in use and matches that against this setting
requiredDBBToolkitVersion=1.0.3
requiredDBBToolkitVersion=2.0.0

#
# Comma separated list of required build properties for zAppBuild/build.groovy
Expand Down
4 changes: 2 additions & 2 deletions build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def initializeBuildProcess(String[] args) {
// create metadata store for this script
if (!props.userBuild) {
if (props.metadataStoreType == 'file')
metadataStore = MetadataStoreFactory.createFileMetadataStore(props.metadataStoreLocation)
metadataStore = MetadataStoreFactory.createFileMetadataStore(props.metadataStoreFileLocation)
else if (props.metadataStoreType == 'db2') {
// Get ID
String id
Expand All @@ -131,7 +131,7 @@ def initializeBuildProcess(String[] args) {
}
// Load properties file into Properties object
Properties db2ConnectionProps = new Properties()
db2ConnectionProps.load(propertiesFile)
db2ConnectionProps.load(new FileInputStream(propertiesFile))

// Call correct Db2 MetadataStore constructor
if (passwordFile)
Expand Down
5 changes: 2 additions & 3 deletions languages/Assembler.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.ibm.dbb.build.report.records.*
@Field BuildProperties props = BuildProperties.getInstance()
@Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy"))
@Field def impactUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ImpactUtilities.groovy"))
@Field def resolverUtils = loadScript(new File("${props.zAppBuildDir}/utilities/ResolverUtilities.groovy"))

println("** Building files mapped to ${this.class.getName()}.groovy script")

Expand All @@ -30,13 +29,13 @@ sortedList.each { buildFile ->

// Configure dependency resolution
String dependencySearch = props.getFileProperty('assembler_dependencySearch', buildFile)
def dependencyResolver = resolverUtils.createSearchPathDependencyResolver(dependencySearch)
SearchPathDependencyResolver dependencyResolver = new SearchPathDependencyResolver(dependencySearch)

// Copy build file and dependency files to data sets
buildUtils.copySourceFiles(buildFile, props.assembler_srcPDS, 'assembler_dependenciesDatasetMapping', null ,dependencyResolver)

// Create logical file
LogicalFile logicalFile = resolverUtils.createLogicalFile(dependencyResolver, buildFile)
LogicalFile logicalFile = buildUtils.createLogicalFile(dependencyResolver, buildFile)

// create mvs commands
String member = CopyToPDS.createMemberName(buildFile)
Expand Down
5 changes: 2 additions & 3 deletions languages/Cobol.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ 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"))
@Field def bindUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BindUtilities.groovy"))
@Field def resolverUtils = loadScript(new File("${props.zAppBuildDir}/utilities/ResolverUtilities.groovy"))

println("** Building files mapped to ${this.class.getName()}.groovy script")

Expand Down Expand Up @@ -41,7 +40,7 @@ sortedList.each { buildFile ->

// configure dependency resolution and create logical file
String dependencySearch = props.getFileProperty('cobol_dependencySearch', buildFile)
def dependencyResolver = resolverUtils.createSearchPathDependencyResolver(dependencySearch)
SearchPathDependencyResolver dependencyResolver = new SearchPathDependencyResolver(dependencySearch)

// copy build file and dependency files to data sets
if(isZUnitTestCase){
Expand All @@ -51,7 +50,7 @@ sortedList.each { buildFile ->
}

// Get logical file
LogicalFile logicalFile = resolverUtils.createLogicalFile(dependencyResolver, buildFile)
LogicalFile logicalFile = buildUtils.createLogicalFile(dependencyResolver, buildFile)

// create mvs commands
String member = CopyToPDS.createMemberName(buildFile)
Expand Down
5 changes: 2 additions & 3 deletions languages/PLI.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import com.ibm.dbb.build.report.records.*
@Field BuildProperties props = BuildProperties.getInstance()
@Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy"))
@Field def impactUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ImpactUtilities.groovy"))
@Field def resolverUtils = loadScript(new File("${props.zAppBuildDir}/utilities/ResolverUtilities.groovy"))

println("** Building files mapped to ${this.class.getName()}.groovy script")

Expand All @@ -39,7 +38,7 @@ sortedList.each { buildFile ->

// configure SearchPathDependencyResolver
String dependencySearch = props.getFileProperty('pli_dependencySearch', buildFile)
def dependencyResolver = resolverUtils.createSearchPathDependencyResolver(dependencySearch)
SearchPathDependencyResolver dependencyResolver = new SearchPathDependencyResolver(dependencySearch)


// copy build file and dependency files to data sets
Expand All @@ -50,7 +49,7 @@ sortedList.each { buildFile ->
}

// Get logical file
LogicalFile logicalFile = resolverUtils.createLogicalFile(dependencyResolver, buildFile)
LogicalFile logicalFile = buildUtils.createLogicalFile(dependencyResolver, buildFile)

// create mvs commands
String member = CopyToPDS.createMemberName(buildFile)
Expand Down
5 changes: 2 additions & 3 deletions languages/REXX.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.ibm.dbb.metadata.*
@Field def buildUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BuildUtilities.groovy"))
@Field def impactUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ImpactUtilities.groovy"))
@Field def bindUtils= loadScript(new File("${props.zAppBuildDir}/utilities/BindUtilities.groovy"))
@Field def resolverUtils= loadScript(new File("${props.zAppBuildDir}/utilities/ResolverUtilities.groovy"))


println("** Building files mapped to ${this.class.getName()}.groovy script")
Expand All @@ -29,13 +28,13 @@ sortedList.each { buildFile ->

// configure dependency resolution and create logical file
String dependencySearch = props.getFileProperty('rexx_dependencySearch', buildFile)
def dependencyResolver = resolverUtils.createSearchPathDependencyResolver(dependencySearch)
SearchPathDependencyResolver dependencyResolver = new SearchPathDependencyResolver(dependencySearch)

// copy build file and dependency files to data sets
buildUtils.copySourceFiles(buildFile, props.rexx_srcPDS, 'rexx_dependenciesDatasetMapping', null, dependencyResolver)

// Get logical file
LogicalFile logicalFile = resolverUtils.createLogicalFile(dependencyResolver, buildFile)
LogicalFile logicalFile = buildUtils.createLogicalFile(dependencyResolver, buildFile)

// create mvs commands
String member = CopyToPDS.createMemberName(buildFile)
Expand Down
Loading

0 comments on commit 83fbf19

Please sign in to comment.