Gradle plugin: Support parameter passing

Introduce 2 booleans in the Gradle builder section to support passing
parameters by System Properties and Project Properties

Change-Id: I0de1e20b85902263e0d83ccadd64d42fc2b37193
This commit is contained in:
Ben Douglas 2020-06-01 16:05:41 -04:00
parent 1ffef886f8
commit 6c55bc7821
3 changed files with 10 additions and 0 deletions

View File

@ -1140,6 +1140,10 @@ def gradle(registry, xml_parent, data):
root) here, such as ${workspace}/parent/ instead of just
${workspace}.
:arg str build-file: name of gradle build script (default 'build.gradle')
:arg bool pass-system-properties: Pass all parameters as
System properties (default false)
:arg bool pass-project-properties: Pass all parameters as
Project properties (default false)
Example:
@ -1158,6 +1162,8 @@ def gradle(registry, xml_parent, data):
("wrapper", "useWrapper", False),
("executable", "makeExecutable", False),
("use-root-dir", "fromRootBuildScriptDir", False),
("pass-system-properties", "passAllAsSystemProperties", False),
("pass-project-properties", "passAllAsProjectProperties", False),
]
helpers.convert_mapping_to_xml(gradle, data, mappings, fail_required=True)

View File

@ -13,6 +13,8 @@ tests
<useWrapper>true</useWrapper>
<makeExecutable>true</makeExecutable>
<fromRootBuildScriptDir>true</fromRootBuildScriptDir>
<passAllAsSystemProperties>true</passAllAsSystemProperties>
<passAllAsProjectProperties>true</passAllAsProjectProperties>
<switches>-g /foo/bar/.gradle
-PmavenUserName=foobar</switches>
</hudson.plugins.gradle.Gradle>

View File

@ -6,6 +6,8 @@ builders:
executable: true
use-root-dir: true
root-build-script-dir: ${workspace}/tests
pass-system-properties: true
pass-project-properties: true
switches:
- "-g /foo/bar/.gradle"
- "-PmavenUserName=foobar"