Skip to content

Commit

Permalink
Merge pull request #456 from IBM/develop
Browse files Browse the repository at this point in the history
Release zAppBuild 3.6.0
  • Loading branch information
dennis-behm authored Dec 15, 2023
2 parents d177891 + c05f9e3 commit dd59b05
Show file tree
Hide file tree
Showing 23 changed files with 922 additions and 169 deletions.
10 changes: 10 additions & 0 deletions build-conf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,16 @@ zcee3_shellEnvironment | Shell environment used to run the gradle command
zcee3_gradlePath | Path to gradle executable
zcee3_gradle_JAVA_OPTS | JAVA Options used with gradle

### zCEE2.properties
Application properties used by zAppBuild/language/zCEE2.groovy

Property | Description
--- | ---
zcee2_zconbtPath | Absolute path to zconbt executable on z/OS UNIX System Services
zcee2_JAVA_HOME | Java installation used by the zconbt utility
zcee2_inputType | Mapping of input files with types of files
zcee2_ARA_PackageArtifacts | Flag to indicate if artifacts produced for the ARA processing should be packaged

### CRB.properties
Application properties used by zAppBuild/language/CRB.groovy

Expand Down
2 changes: 1 addition & 1 deletion build-conf/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
buildPropFiles=datasets.properties,dependencyReport.properties,Assembler.properties,BMS.properties,\
MFS.properties,PSBgen.properties,DBDgen.properties,ACBgen.properties,Cobol.properties,\
LinkEdit.properties,PLI.properties,REXX.properties,ZunitConfig.properties,Transfer.properties,\
CRB.properties,zCEE3.properties
CRB.properties,zCEE3.properties,zCEE2.properties

#
# Comma separated list of default application configuration property files to load
Expand Down
28 changes: 28 additions & 0 deletions build-conf/zCEE2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Releng properties used by language/zCEE2.groovy

#
# Comma separated list of required build properties for zCEE3.groovy
zcee2_requiredBuildProperties=zcee2_zconbtPath,zcee2_JAVA_HOME

#
# Absolute path to zconbt executable on z/OS UNIX System Services
# for instance: /var/zosconnect/v359/bin/zconbt.zos
zcee2_zconbtPath=

#
# Java installation used by the zconbt utility
# for instance: /usr/lpp/java/J8.0_64
zcee2_JAVA_HOME=

#
# Mapping of input files with types of files
# PROJECT can be used for SAR and AAR projects
# SAR and ARA can be used for SAR Properties files and ARA properties files
# Can be overridden by file-level properties
zcee2_inputType=PROJECT

#
# Flag to indicate if artifacts produced for the ARA processing should be packaged (generated copybooks, API information copybook and logs)
# When set to true, the artifacts are located based on the dataStructuresLocation, apiInfoFileLocation and logFileDirectory properties of the ARA properties files
# When not defined, the default value is false and artifacts are packaged
zcee2_ARA_PackageArtifacts=true
63 changes: 46 additions & 17 deletions build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ props.startTime = startTime.format("yyyyMMdd.HHmmss.SSS")
println("\n** Build start at $props.startTime")

// initialize build
initializeBuildProcess(args)
try {
initializeBuildProcess(args)
} catch ( AssertionError e ) {
String errorMsg = e.getMessage()
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg)
finalizeBuildProcess(start:startTime, 0)
}

// create build list
List<String> buildList = new ArrayList()
Expand All @@ -57,13 +65,21 @@ else {
scriptPath = script
// Use the ScriptMappings class to get the files mapped to the build script
def buildFiles = ScriptMappings.getMappedList(script, buildList)
if (buildFiles.size() > 0) {
if (scriptPath.startsWith('/'))
runScript(new File("${scriptPath}"), ['buildList':buildFiles])
else
runScript(new File("languages/${scriptPath}"), ['buildList':buildFiles])
try {
if (buildFiles.size() > 0) {
if (scriptPath.startsWith('/'))
runScript(new File("${scriptPath}"), ['buildList':buildFiles])
else
runScript(new File("languages/${scriptPath}"), ['buildList':buildFiles])
}
processCounter = processCounter + buildFiles.size()
} catch (BuildException | AssertionError e ) {
String errorMsg = e.getMessage()
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg)
finalizeBuildProcess(start:startTime, count:processCounter)
}
processCounter = processCounter + buildFiles.size()
}
} else if(props.scanLoadmodules && props.scanLoadmodules.toBoolean()){
println ("** Scanning load modules.")
Expand All @@ -77,10 +93,6 @@ if (processCounter == 0)

finalizeBuildProcess(start:startTime, count:processCounter)

// if error occurred signal process error
if (props.error)
System.exit(1)

// end script


Expand All @@ -96,10 +108,17 @@ def initializeBuildProcess(String[] args) {

// print and store property dbb toolkit version in use
def dbbToolkitVersion = VersionInfo.getInstance().getVersion()
props.dbbToolkitVersion = dbbToolkitVersion
def dbbToolkitBuildDate = VersionInfo.getInstance().getDate()
if (props.verbose) println "** zAppBuild running on DBB Toolkit Version ${dbbToolkitVersion} ${dbbToolkitBuildDate} "
props.dbbToolkitVersion = dbbToolkitVersion
props.dbbToolkitBuildDate = dbbToolkitBuildDate

File versionFile = new File("${props.zAppBuildDir}/version.properties")
if (versionFile.exists()) {
props.load(versionFile)
if (props.zappbuild_version) println "** Running zAppBuild Version ${props.zappbuild_version} "
}
if (props.verbose) println "** Running DBB Toolkit Version ${dbbToolkitVersion} ${dbbToolkitBuildDate} "

// verify required dbb toolkit
buildUtils.assertDbbBuildToolkitVersion(props.dbbToolkitVersion, props.requiredDBBToolkitVersion)

Expand Down Expand Up @@ -329,6 +348,8 @@ def populateBuildProperties(def opts) {
// need to support IDz user build parameters
if (opts.srcDir) props.workspace = opts.srcDir
if (opts.wrkDir) props.outDir = opts.wrkDir

// assert workspace
buildUtils.assertBuildProperties('workspace,outDir')

// load build.properties
Expand Down Expand Up @@ -641,7 +662,8 @@ def createBuildList() {
}

// Perform analysis and build report of external impacts
if (props.reportExternalImpacts && props.reportExternalImpacts.toBoolean()){
// Prereq: Metadatastore Connection
if (metadataStore && props.reportExternalImpacts && props.reportExternalImpacts.toBoolean()){
if (buildSet && changedFiles) {
println "** Perform analysis and reporting of external impacted files for the build list including changed files."
reportingUtils.reportExternalImpacts(buildSet.plus(changedFiles))
Expand All @@ -653,7 +675,8 @@ def createBuildList() {
}

// Document and validate concurrent changes
if (props.reportConcurrentChanges && props.reportConcurrentChanges.toBoolean()){
// Prereq: Workspace containing git repos. Skipped for --userBuild build type
if (!props.userBuild && props.reportConcurrentChanges && props.reportConcurrentChanges.toBoolean()){
println "** Calculate and document concurrent changes."
reportingUtils.calculateConcurrentChanges(buildSet)
}
Expand All @@ -670,7 +693,6 @@ def createBuildList() {
return buildList
}


def finalizeBuildProcess(Map args) {
println "***************** Finalization of the build process *****************"

Expand Down Expand Up @@ -722,7 +744,10 @@ def finalizeBuildProcess(Map args) {
buildResult.setProperty("filesProcessed", String.valueOf(args.count))
buildResult.setState(buildResult.COMPLETE)


// add zAppBuild and DBB toolkit version info
if (props.zappbuild_version) buildResult.setProperty("zAppBuildVersion", props.zappbuild_version)
buildResult.setProperty("DBBToolkitVersion" , "${props.dbbToolkitVersion} ${props.dbbToolkitBuildDate}")

// store build result properties in BuildReport.json
PropertiesRecord buildReportRecord = new PropertiesRecord("DBB.BuildResultProperties")
def buildResultProps = buildResult.getPropertyNames()
Expand Down Expand Up @@ -769,6 +794,10 @@ def finalizeBuildProcess(Map args) {
if (props.preview) println("** Build ran in preview mode.")
println("** Total files processed : ${args.count}")
println("** Total build time : $duration\n")

// if error occurred signal process error
if (props.error)
System.exit(1)
}


Expand Down
3 changes: 3 additions & 0 deletions languages/Assembler.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ def createLinkEditCommand(String buildFile, LogicalFile logicalFile, String memb
if (buildUtils.isCICS(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDFHLOAD).options("shr"))

if (buildUtils.isIMS(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDFSRESL).options("shr"))

if (buildUtils.isSQL(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDSNLOAD).options("shr"))

Expand Down
5 changes: 4 additions & 1 deletion languages/Cobol.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def createCompileCommand(String buildFile, LogicalFile logicalFile, String membe

compile.dd(new DDStatement().name("SYSPRINT").options(props.cobol_printTempOptions))
compile.dd(new DDStatement().name("SYSMDECK").options(props.cobol_tempOptions))
(1..17).toList().each { num ->
(1..15).toList().each { num ->
compile.dd(new DDStatement().name("SYSUT$num").options(props.cobol_tempOptions))
}

Expand Down Expand Up @@ -384,6 +384,9 @@ def createLinkEditCommand(String buildFile, LogicalFile logicalFile, String memb
if (buildUtils.isCICS(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDFHLOAD).options("shr"))

if (buildUtils.isIMS(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDFSRESL).options("shr"))

if (buildUtils.isSQL(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDSNLOAD).options("shr"))

Expand Down
11 changes: 7 additions & 4 deletions languages/LinkEdit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,16 @@ def createLinkEditCommand(String buildFile, LogicalFile logicalFile, String memb
linkedit.dd(new DDStatement().dsn(syslibDataset).options("shr"))
}
linkedit.dd(new DDStatement().dsn(props.SCEELKED).options("shr"))

if (props.debug && props.SEQAMOD)
linkedit.dd(new DDStatement().dsn(props.SEQAMOD).options("shr"))

if (props.SDFHLOAD)
if (buildUtils.isCICS(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDFHLOAD).options("shr"))


if (buildUtils.isIMS(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDFSRESL).options("shr"))

if (props.SDSNLOAD)
linkedit.dd(new DDStatement().dsn(props.SDSNLOAD).options("shr"))

Expand Down
7 changes: 7 additions & 0 deletions languages/PLI.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def createPLIParms(String buildFile, LogicalFile logicalFile) {
def parms = props.getFileProperty('pli_compileParms', buildFile) ?: ""
def cics = props.getFileProperty('pli_compileCICSParms', buildFile) ?: ""
def sql = props.getFileProperty('pli_compileSQLParms', buildFile) ?: ""
def ims = props.getFileProperty('pli_compileIMSParms', buildFile) ?: ""
def errPrefixOptions = props.getFileProperty('pli_compileErrorPrefixParms', buildFile) ?: ""
def compileDebugParms = props.getFileProperty('pli_compileDebugParms', buildFile)

Expand All @@ -142,6 +143,9 @@ def createPLIParms(String buildFile, LogicalFile logicalFile) {
if (props.errPrefix)
parms = "$parms,$errPrefixOptions"

if (buildUtils.isIMS(logicalFile))
parms = "$parms,$ims"

// add debug options
if (props.debug) {
parms = "$parms,$compileDebugParms"
Expand Down Expand Up @@ -355,6 +359,9 @@ def createLinkEditCommand(String buildFile, LogicalFile logicalFile, String memb
if (buildUtils.isCICS(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDFHLOAD).options("shr"))

if (buildUtils.isIMS(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDFSRESL).options("shr"))

if (buildUtils.isSQL(logicalFile))
linkedit.dd(new DDStatement().dsn(props.SDSNLOAD).options("shr"))

Expand Down
6 changes: 2 additions & 4 deletions languages/Transfer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,8 @@ buildList.each { buildFile ->
buildUtils.updateBuildResult(errorMsg:errorMsg)
}
} catch (BuildException e) { // Catch potential exceptions like file truncation
String errorMsg = "*! The CopyToPDS failed with an exception ${e.getMessage()}."
println(errorMsg)
props.error = "true"
buildUtils.updateBuildResult(errorMsg:errorMsg)
String errorMsg = "*! (Transfer.groovy) CopyToPDS of file ${buildFile} failed with an exception \n ${e.getMessage()}."
throw new BuildException(errorMsg)
}
} else {
String errorMsg = "*! Target dataset for $buildFile could not be obtained from file properties. "
Expand Down
Loading

0 comments on commit dd59b05

Please sign in to comment.