Skip to content

Commit

Permalink
Merge pull request #79 from oleg-nenashev/javaLevelConfig
Browse files Browse the repository at this point in the history
buildPlugin(): Allow passing Java level as a configuration argument
  • Loading branch information
oleg-nenashev authored Dec 5, 2018
2 parents c6bf922 + d95a896 commit 9a99023
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ buildPlugin()
buildPlugin(/*...*/, configurations: [
[ platform: "linux", jdk: "8", jenkins: null ],
[ platform: "windows", jdk: "8", jenkins: null ],
[ platform: "linux", jdk: "11", jenkins: "2.150" ]
[ platform: "linux", jdk: "11", jenkins: "2.150", javaLevel: 8 ]
])
----
* `tests`: (default: `null`) - a map of parameters to run tests during the build
Expand Down
7 changes: 6 additions & 1 deletion vars/buildPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def call(Map params = [:]) {
String label = config.platform
String jdk = config.jdk
String jenkinsVersion = config.jenkins
String javaLevel = config.javaLevel

String stageIdentifier = "${label}-${jdk}${jenkinsVersion ? '-' + jenkinsVersion : ''}"
boolean first = tasks.size() == 1
Expand Down Expand Up @@ -76,6 +77,9 @@ def call(Map params = [:]) {
if (jenkinsVersion) {
mavenOptions += "-Djenkins.version=${jenkinsVersion} -Daccess-modifier-checker.failOnError=false"
}
if (javaLevel) {
mavenOptions += "-Djava.level=${javaLevel}"
}
if (params?.findbugs?.run || params?.findbugs?.archive) {
mavenOptions += "-Dfindbugs.failOnError=false"
}
Expand Down Expand Up @@ -207,7 +211,8 @@ static List<Map<String, String>> getConfigurations(Map params) {
ret << [
"platform": p,
"jdk": jdk,
"jenkins": jenkins
"jenkins": jenkins,
"javaLevel": null // not supported in the old format
]
}
}
Expand Down

0 comments on commit 9a99023

Please sign in to comment.