Skip to content

Commit a719842

Browse files
authored
Merge pull request #503 from IBM/develop
Release zAppBuild 3.8.0
2 parents 9f25617 + 8e37fda commit a719842

17 files changed

+205
-76
lines changed

build.groovy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ If buildFile is a text file (*.txt) then it is assumed to be a build list file.
251251
options:
252252
'''
253253

254-
def cli = new CliBuilder(usage:usage,header:header)
254+
def cli = new CliBuilder(usage:usage,header:header,stopAtNonOption: false)
255255
// required sandbox options
256256
cli.w(longOpt:'workspace', args:1, 'Absolute path to workspace (root) directory containing all required source directories')
257257
cli.a(longOpt:'application', args:1, required:true, 'Application directory name (relative to workspace)')
@@ -675,8 +675,7 @@ def createBuildList() {
675675
|| props.filePropertyValueKeySet().getAt("loadLanguageConfigurationProperties")
676676
|| (props.loadFileLevelProperties && props.loadFileLevelProperties.toBoolean())
677677
|| (props.loadLanguageConfigurationProperties && props.loadLanguageConfigurationProperties.toBoolean())) {
678-
println "** Populating file level properties from individual artifact properties files."
679-
filePropUtils.loadFileLevelPropertiesFromFile(buildList)
678+
filePropUtils.loadFileLevelPropertiesFromConfigFiles(buildList)
680679
}
681680

682681
// Perform analysis and build report of external impacts

docs/FilePropertyManagement.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
## Table of contents
44

5-
- [Introduction](#introduction)
6-
- [Overriding build properties with DBB and zAppBuild](#overriding-build-properties-with-dbb-and-zappbuild)
7-
- [Default properties](#default-properties)
8-
- [Overriding properties](#overriding-properties)
9-
- [DBB file properties](#dbb-file-properties)
10-
- [Individual artifact properties file](#individual-artifact-properties-file)
11-
- [Language configuration mapping](#language-configuration-mapping)
5+
- [File Property Management](#file-property-management)
6+
- [Table of contents](#table-of-contents)
7+
- [Introduction](#introduction)
8+
- [Overriding build properties with DBB and zAppBuild](#overriding-build-properties-with-dbb-and-zappbuild)
9+
- [Default properties](#default-properties)
10+
- [Overriding properties](#overriding-properties)
11+
- [DBB file properties](#dbb-file-properties)
12+
- [Individual artifact properties file](#individual-artifact-properties-file)
13+
- [Language configuration mapping](#language-configuration-mapping)
1214

1315
## Introduction
1416

@@ -27,9 +29,10 @@ zAppBuild supports overriding the majority of build properties defined within it
2729
zAppBuild leverages DBB's API and allows you to define build parameters on three different levels for each language script:
2830

2931
1. General defaults in the corresponding language properties files: For example, you can define the compile options for building COBOL programs in [application-conf/Cobol.properties](../samples/application-conf/Cobol.properties). Property keys make use of a language prefix; for instance, COBOL property keys are prefixed with `cobol_`.
30-
2. A group definition that overrides the general default in one of two ways:
32+
2. A group definition that overrides the general default in one of three ways:
3133
- By using DBB's file property syntax in [application-conf/file.properties](../samples/application-conf/file.properties), and specifying the application artifact group via a pattern filter on the path name(s)
32-
- By mapping to a language configuration file to override the defaults, such as in [application-conf/languageConfigurationMapping.properties](../samples/MortgageApplication/application-conf/languageConfigurationMapping.properties)
34+
- By mapping to a *language configuration* file to override the defaults, such as in [application-conf/languageConfigurationMapping.properties](../samples/MortgageApplication/application-conf/languageConfigurationMapping.properties)
35+
- By mapping the build file to a *language configuration* file using the DBB file property syntax file to specify the property `languageConfiguration` in [application-conf/file.properties](../samples/MortgageApplication/application-conf/file.properties#L46-L53)
3336
3. An individual file-level definition that overwrites the general default in one of two ways:
3437
- By using DBB's file properties syntax in [application-conf/file.properties](../samples/application-conf/file.properties), and specifying the application artifact's path as the file path pattern
3538
- By specifying multiple parameters for a specific file using the individual artifact properties file. For example: [epsmlist.cbl.properties](../samples/MortgageApplication/properties/epsmlist.cbl.properties).
@@ -132,12 +135,12 @@ You can view a sample individual artifact properties file, [epsmlist.cbl.propert
132135

133136
### Language configuration mapping
134137

135-
An alternative way to define build properties for a **subgroup of files** is by leveraging a mapping approach. Rather than specifying individual parameters or properties for an individual application artifact, the application artifacts are mapped to a language configuration, which can then define multiple build parameters in a central language configuration properties file. All mapped application artifacts will inherit those defined build parameters.
138+
An alternative way to define build properties for a **subgroup of files** is by leveraging a mapping approach. Rather than specifying individual parameters or properties for an individual application artifact, the application artifacts are mapped to a language configuration, which can then define multiple build parameters in a central language configuration properties file for the language script. All mapped application artifacts will inherit those defined build parameters.
136139

137140
This approach consists of:
138141

139-
- Language configuration mapping file: A mapping of the application artifact(s) to a language configuration file
140-
- Language configuration properties file(s): For each language configuration, a properties file defining that language's build parameters
142+
- Language configuration mapping: Either via a mapping file of the application artifact(s) to the language configuration file or alternatively by using the DBB file property syntax to map the build file to the language configuration file.
143+
- Language configuration properties file(s): For each language configuration, a properties file defining that language's build parameters.
141144
142145
The "language configuration mapping" approach can be enabled by setting the property `loadLanguageConfigurationProperties` in the `application-conf/application.properties` file to `true`. To enable this option for a specific file or a set of files, use the DBB file property syntax and set `loadLanguageConfigurationProperties` to `true` in the `application-conf/file.properties` file. Below is a sample to enable language configuration mapping for all programs starting with `eps` and `lga` via the `application-conf/file.properties` file:
143146
@@ -157,7 +160,9 @@ isCICS = true
157160
cobol_linkEditStream= INCLUDE OBJECT(@{member})\n INCLUDE SYSLIB(CUSTOBJ)
158161
```
159162
160-
To map files to a language configuration, create a `languageConfigurationMapping.properties` file in the `application-conf` folder of your application repository. Then, within this new language configuration mapping file, map each artifact to its corresponding language configuration using the syntax `<sourceFileName.extension>=<languageConfigurationPropertiesFileName>`.
163+
Two options exist to map build files to the language configuration:
164+
165+
Either create a `languageConfigurationMapping.properties` file in the `application-conf` folder of your application repository. Then, within this new language configuration mapping file, map each artifact to its corresponding language configuration using the syntax `<sourceFileName.extension>=<languageConfigurationPropertiesFileName>`, or leverage the DBB file property syntax with the build property `languageConfiguration`.
161166
162167
- For example, the following snippet in [application-conf/languageConfigurationMapping.properties](../samples/MortgageApplication/application-conf/languageConfigurationMapping.properties) maps both source files `epsnbrvl.cbl` and `epsmlist.cbl` to use the properties defined in `build-conf/language-conf/languageConfigProps01.properties`, while the source file `epscmort.cbl` is mapped to use the properties defined in `build-conf/language-conf/languageConfigProps02.properties` for language configuration mapping overrides:
163168
@@ -167,7 +172,17 @@ To map files to a language configuration, create a `languageConfigurationMapping
167172
epscmort.cbl=languageConfigProps02
168173
```
169174
170-
See [languageConfigurationMapping.properties](../samples/MortgageApplication/application-conf/languageConfigurationMapping.properties) for a sample language configuration mapping file.
175+
See [languageConfigurationMapping.properties](../samples/MortgageApplication/application-conf/languageConfigurationMapping.properties) for a sample language configuration mapping file.
176+
177+
- The alternative mapping approach using the DBB file property syntax allows you to leverage file patterns similarly to other file properties in the zAppBuild framework. The below configuration is providing the same information like the above approach using the `languageConfigurationMapping.properties` file.
178+
179+
```properties
180+
languageConfiguration = languageConfigProps01 :: **/cobol/epsnbrvl.cbl, **/cobol/epsmpmt.cbl
181+
languageConfiguration = languageConfigProps02 :: **/cobol/epscmort.cbl
182+
```
183+
184+
See [application-conf/file.properties](../samples/MortgageApplication/application-conf/file.properties#L46-L53) for a sample language configuration mapping via the DBB file property syntax.
185+
171186
172187
[^1]: The term "artifact" and "file" in this document refer to program source code that will built (as opposed to JCL or other non-buildable items), for example by DBB.
173188
[^2]: DBB is managing the DBB file properties in its separate internal table compared to the default properties. This table leverages the combination of [property name + file pattern] as the key of the internal table. When the same key is declared a second time, it overrides the first one.

samples/MortgageApplication/application-conf/application.properties

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
# Comma separated list of additional application property files to load
55
# Supports both relative path (to ${application}/application-conf/) and absolute path
66
applicationPropFiles=file.properties,BMS.properties,Cobol.properties,\
7-
LinkEdit.properties,languageConfigurationMapping.properties,\
8-
CRB.properties
7+
LinkEdit.properties,CRB.properties
98

109
#
1110
# Comma separated list all source directories included in application build. Supports both absolute
@@ -21,8 +20,13 @@ applicationSrcDirs=${application}
2120
buildOrder=BMS.groovy,Cobol.groovy,LinkEdit.groovy
2221

2322
#
24-
# The main build branch. Used for cloning collections for topic branch builds instead
25-
# of rescanning the entire application.
23+
# The main build branch.
24+
# Used for cloning collections for first topic branch build instead
25+
# of rescanning the entire application.
26+
# Used to retrieve the last successful build result for the first topic branch build to
27+
# obtain the baseline hash to calculate changed files for impact build scnearios.
28+
# Used for the build type --mergeBuild to perform the git diff to
29+
# identify changed files
2630
mainBuildBranch=main
2731

2832
#

samples/MortgageApplication/application-conf/file.properties

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,13 @@ loadFileLevelProperties = true :: **/cobol/epsmlist.cbl
4141
# Example 1: Enable language configuration mapping for all COBOL files: loadLanguageConfigurationProperties=true :: **/cobol/*.cbl
4242
# Example 2: The following file path pattern looks for a language configuration properties file mapping for epsnbrvl.cbl and epsmpmt.cbl
4343
# in the application-conf/languageconfigurationMapping.properties file:
44-
loadLanguageConfigurationProperties = true :: **/cobol/epsnbrvl.cbl, **/cobol/epsmpmt.cbl
44+
loadLanguageConfigurationProperties = true :: **/cobol/epsnbrvl.cbl, **/cobol/epsmpmt.cbl, **/cobol/epscmort.cbl
45+
46+
#
47+
# Properties mapping for assigning the language configuration to build files to specify the build configuration
48+
# Please see the detailed documentation on file property management at:
49+
# https://github.com/IBM/dbb-zappbuild/docs/FilePropertyManagement.md
50+
# This option replaces the mapping of build files to language configuration in languageConfigurationMapping.properties file
51+
#
52+
languageConfiguration = languageConfigProps01 :: **/cobol/epsnbrvl.cbl, **/cobol/epsmpmt.cbl
53+
languageConfiguration = languageConfigProps02 :: **/cobol/epscmort.cbl
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# This file maps the program file with the corresponding language configuration properties file in the build-conf/language-conf folder.
22

3-
# For example: As shown below, the programs `epsnbrvl.cbl` and `epsmpmt.cbl` will map to the language configuration file
3+
# The file needs to be added under the property applicationPropFiles in application-conf/application.properties.
4+
# The current implementation of MortgageApplication is using DBB File Properties.
5+
6+
# Please see the detailed documentation on file property management at:
7+
# https://github.com/IBM/dbb-zappbuild/docs/FilePropertyManagement.md
8+
9+
# In the below samples, the programs `epsnbrvl.cbl` and `epsmpmt.cbl` will map to the language configuration file
410
# build-conf/language-conf/languageConfigProps01.properties.
511
# The program `epscmort.cbl` will map to the language configuration file build-conf/language-conf/languageConfigProps02.properties.
612

713
epsnbrvl.cbl=languageConfigProps01
814
epsmpmt.cbl=languageConfigProps01
915
epscmort.cbl=languageConfigProps02
1016

11-
# Insert all the file ==> language configuration properties mapping here!
17+
# Insert all the file ==> language configuration properties mapping here
18+
# and make sure to load this properties file via applicationPropFiles in application-conf/application.properties!

samples/application-conf/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,23 @@ impactResolutionRules | Comma separated list of resolution rule properties used
3434
impactSearch | Impact finder resolution search configuration leveraging the SearchPathImpactFinder API. Sample configurations are inlcuded below, next to the previous rule definitions. | true
3535

3636
### file.properties
37-
Location of file properties, script mappings and file-level property overrides. All file properties for the entire application, including source files in distributed repositories of the application need to be contained either in this file or in other property files in the `application-conf` directory. Look for the column 'Overridable' in the tables below for build properties that can have file-level property overrides. Additional file-level properties can be defined through individual artifact properties files in a separate directory of the repository. For more details, see [File Property Management](https://github.com/IBM/dbb-zappbuild/docs/FilePropertyManagement.md).
37+
38+
Location of file properties, script mappings and file-level property overrides. All file properties for the entire application, including source files in distributed repositories of the application need to be contained either in this file or in other property files in the `application-conf` directory. Look for the column 'Overridable' in the tables below for build properties that can have file-level property overrides. Please also read the section [Build properties](https://www.ibm.com/docs/en/dbb/2.0?topic=apis-build-properties) in the official DBB documentation.
39+
40+
Additional file-level properties can be defined through **individual artifact properties files** in a separate directory of the repository or through **language configuration** files to configure the language scripts. For more details, see [File Property Management](https://github.com/IBM/dbb-zappbuild/docs/FilePropertyManagement.md).
3841

3942
Property | Description
4043
--- | ---
4144
dbb.scriptMapping | DBB configuration file properties association build files to language scripts
4245
dbb.scannerMapping | zAppBuild configuration override/expansion to map files extensions to DBB dependency scanner configurations
4346
cobol_testcase | File property to indicate a generated zUnit cobol test case to use a different set of source and output libraries
4447

48+
Property | Description
49+
--- | ---
50+
loadFileLevelProperties | Flag to enable the zAppBuild capability to load individual artifact properties files for source files. See default configuration in [application.properties](#application.properties)
51+
loadLanguageConfigurationProperties | Flag to enable the zAppBuild capability to load language configuration properties files for source files. See default configuration in [application.properties](#application.properties)
52+
languageConfiguration | Properties mapping for assigning build files to language configuration to define the build configuration
53+
4554
General file level overwrites to control the allocations of system datasets for compile and link steps or activation of preprocessing
4655

4756
Property | Description

samples/application-conf/application.properties

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,14 @@ testOrder=ZunitConfig.groovy
3737
# formatConsoleOutput=false
3838

3939
#
40-
# The main build branch. Used for cloning collections for topic branch builds instead
41-
# of rescanning the entire application.
42-
mainBuildBranch=master
40+
# The main build branch.
41+
# Used for cloning collections for first topic branch build instead
42+
# of rescanning the entire application.
43+
# Used to retrieve the last successful build result for the first topic branch build to
44+
# obtain the baseline hash to calculate changed files for impact build scnearios.
45+
# Used for the build type --mergeBuild to perform the git diff to
46+
# identify changed files
47+
mainBuildBranch=main
4348

4449
#
4550
# The git repository URL of the application repository to establish links to the changed files

samples/application-conf/file.properties

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,50 @@ isMQ = true :: **/cobol/member.cbl
8383
#
8484
isIMS = true :: **/cobol/DLIBATCH.cbl
8585

86-
# Please check for available file property overwrites within samples/application-conf/README.md
8786

87+
#########
88+
# Property File Management
89+
#
90+
# > Please check for available file property overwrites within samples/application-conf/README.md <
91+
# The tables indicate which build parameters can be overwritten for each build file to overwrite the default settings.
92+
#
93+
# The subsequent section provides the configuration parameters to outline
94+
# - file level property overwrites by loading individual artifact properties files
95+
# - loading language configurations that define multiple build parameters for the mapped files
96+
#
97+
# Please see the detailed documentation on file property management at:
98+
# https://github.com/IBM/dbb-zappbuild/docs/FilePropertyManagement.md
99+
#
100+
#########
101+
102+
#
103+
# Flag to enable the zAppBuild capability to load individual artifact properties files for source files.
104+
# Example 1: The following file path pattern looks for an individual artifact properties file for epsmlist.cbl:
105+
# loadFileLevelProperties = true :: **/cobol/epsmlist.cbl
106+
# Example 2: Enable individual artifact properties file for all COBOL files: loadFileLevelProperties=true :: **/cobol/*.cbl
107+
# loadFileLevelProperties = true :: **/cobol/*.cbl
108+
109+
#
110+
# Language Configuration properties management
111+
#
112+
# Flag to enable the zAppBuild capability to load language configuration properties files for source files.
113+
# Example 1: Enable language configuration mapping for all COBOL files: loadLanguageConfigurationProperties=true :: **/cobol/*.cbl
114+
# loadLanguageConfigurationProperties = true :: **/cobol/*.cbl
115+
# Example 2: The following file path pattern looks for a language configuration properties file mapping for epsnbrvl.cbl and epsmpmt.cbl
116+
# in the application-conf/languageconfigurationMapping.properties file:
117+
# loadLanguageConfigurationProperties = true :: **/cobol/epsnbrvl.cbl, **/cobol/epsmpmt.cbl
118+
119+
#
120+
# Properties mapping for assigning the language configuration to build files to specify the build configuration
121+
# This option is an alternative approach for mapping build files to the language configuration file
122+
#
123+
# languageConfiguration = languageConfigProps01 :: **/cobol/epsnbrvl.cbl, **/cobol/epsmpmt.cbl
124+
# languageConfiguration = languageConfigProps02 :: **/cobol/epscmort.cbl
125+
126+
127+
#########
128+
# zUnit Integration
129+
#########
88130
#
89131
# file mapping for generated zUnit Test case programs (Cobol) to use a seperate set of libraries
90132
# cobol_testcase = true :: **/testcase/*.cbl

0 commit comments

Comments
 (0)