Merge pull request #18595 from javanna/enhancement/gradle_2.13

Update minimum gradle version and remove assumption around target compatibility
This commit is contained in:
Luca Cavanna 2016-05-27 12:35:00 +02:00
commit 5794108506
2 changed files with 8 additions and 7 deletions

View File

@ -257,7 +257,6 @@ allprojects {
idea { idea {
project { project {
languageLevel = org.elasticsearch.gradle.BuildPlugin.minimumJava.toString()
vcs = 'Git' vcs = 'Git'
} }
} }

View File

@ -113,7 +113,7 @@ class BuildPlugin implements Plugin<Project> {
} }
// enforce gradle version // enforce gradle version
GradleVersion minGradle = GradleVersion.version('2.8') GradleVersion minGradle = GradleVersion.version('2.13')
if (GradleVersion.current() < minGradle) { if (GradleVersion.current() < minGradle) {
throw new GradleException("${minGradle} or above is required to build elasticsearch") throw new GradleException("${minGradle} or above is required to build elasticsearch")
} }
@ -372,6 +372,13 @@ class BuildPlugin implements Plugin<Project> {
options.fork = true options.fork = true
options.forkOptions.executable = new File(project.javaHome, 'bin/javac') options.forkOptions.executable = new File(project.javaHome, 'bin/javac')
options.forkOptions.memoryMaximumSize = "1g" options.forkOptions.memoryMaximumSize = "1g"
if (project.targetCompatibility >= JavaVersion.VERSION_1_8) {
// compile with compact 3 profile by default
// NOTE: this is just a compile time check: does not replace testing with a compact3 JRE
if (project.compactProfile != 'full') {
options.compilerArgs << '-profile' << project.compactProfile
}
}
/* /*
* -path because gradle will send in paths that don't always exist. * -path because gradle will send in paths that don't always exist.
* -missing because we have tons of missing @returns and @param. * -missing because we have tons of missing @returns and @param.
@ -379,11 +386,6 @@ class BuildPlugin implements Plugin<Project> {
*/ */
// don't even think about passing args with -J-xxx, oracle will ask you to submit a bug report :) // don't even think about passing args with -J-xxx, oracle will ask you to submit a bug report :)
options.compilerArgs << '-Werror' << '-Xlint:all,-path,-serial,-options,-deprecation' << '-Xdoclint:all' << '-Xdoclint:-missing' options.compilerArgs << '-Werror' << '-Xlint:all,-path,-serial,-options,-deprecation' << '-Xdoclint:all' << '-Xdoclint:-missing'
// compile with compact 3 profile by default
// NOTE: this is just a compile time check: does not replace testing with a compact3 JRE
if (project.compactProfile != 'full') {
options.compilerArgs << '-profile' << project.compactProfile
}
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
//options.incremental = true //options.incremental = true