Skip to content

Commit

Permalink
Add Java vendor as an input for compile and test tasks
Browse files Browse the repository at this point in the history
In the coverage phase we use different Java vendors.
Therefore, we need to track the vendor if we want to use the build cache.
  • Loading branch information
wolfs committed Jun 1, 2017
1 parent eed6dc3 commit 06c5da7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gradle/compile.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if (!hasProperty('java7Home')) {
}

ext.jvmForCompilation = Jvm.current()
ext.javaVendor = System.getProperty("java.vendor", "unknown")

tasks.withType(AbstractCompile) {
options.fork = true // Always fork compilation
Expand Down Expand Up @@ -36,9 +37,15 @@ tasks.withType(JavaCompile) {
// while compiling.
options.compilerArgs = ['-Xlint:-options', '-Xlint:-path']
options.incremental = true
inputs.property('javaVendor') {
java7Home ? 'Oracle Corporation' : javaVendor
}
}
tasks.withType(GroovyCompile) {
options.encoding = 'utf-8'
options.compilerArgs = ['-Xlint:-options', '-Xlint:-path']
groovyOptions.encoding = 'utf-8'
inputs.property('javaVendor') {
javaVendor
}
}
3 changes: 3 additions & 0 deletions gradle/groovyProject.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ testTasks.all { task ->
// enable class unloading
task.jvmArgs '-XX:+UseConcMarkSweepGC', '-XX:+CMSClassUnloadingEnabled'
}
task.inputs.property('javaVendor') {
javaVendor
}
doFirst {
if (isCiServer) {
println "maxParallelForks for '$task.path' is $task.maxParallelForks"
Expand Down

0 comments on commit 06c5da7

Please sign in to comment.