Skip to content

Commit

Permalink
RT-40254: Allow building with gradle 2.X
Browse files Browse the repository at this point in the history
Reviewed-by: ddhill
  • Loading branch information
kevinrushforth committed Mar 19, 2015
1 parent ccd0675 commit 91c32fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
21 changes: 12 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ ext.IS_DOC_LINT = DOC_LINT != "none"
defineProperty("USE_DEPEND", "true")
ext.IS_USE_DEPEND = Boolean.parseBoolean(USE_DEPEND)

// Specifies whether to use the "incremental" option when compiling Java sources
defineProperty("INCREMENTAL", "false")
ext.IS_INCREMENTAL = Boolean.parseBoolean(INCREMENTAL)

// Specifies whether to generate code coverage statistics when running tests
defineProperty("JCOV", "false")
ext.DO_JCOV = Boolean.parseBoolean(JCOV)
Expand Down Expand Up @@ -764,9 +768,7 @@ if (gradle.gradleVersion != "1.8") {
def gradleMajor = Integer.parseInt(ver[0]);
def gradleMinor = Integer.parseInt(ver[1]);
def err = "";
if (gradleMajor != 1) {
err = "Gradle major version is incompatible: ${gradle.gradleVersion}; supported version is 1.8";
} else {
if (gradleMajor == 1) {
if (gradleMinor < 8) {
err = "Gradle version too old: ${gradle.gradleVersion}; must be at least 1.8"
}
Expand Down Expand Up @@ -2650,17 +2652,18 @@ allprojects {
// compiler with the right settings.
//
// Also, we need to remove jfxrt.jar from the ext classpath (if it is there)
tasks.withType(Compile) { compile ->
// It looks like we have to use ant to compile instead of the built-in gradle
// compiler stuff because otherwise it won't compile on CYGWIN
// TODO need to file issue with Gradle
compile.options.useAnt = true
tasks.withType(JavaCompile) { compile ->
if (compile.options.hasProperty("useAnt")) {
compile.options.useAnt = true
compile.options.useDepend = IS_USE_DEPEND
} else if (compile.options.hasProperty("incremental")) {
compile.options.incremental = IS_INCREMENTAL
}
compile.options.debug = true // we always generate debugging info in the class files
compile.options.debugOptions.debugLevel = IS_DEBUG_JAVA ? "source,lines,vars" : "source,lines"
compile.options.fork = true
compile.options.forkOptions.executable = JAVAC
compile.options.warnings = IS_LINT
compile.options.useDepend = IS_USE_DEPEND
compile.options.compilerArgs = ["-Djava.ext.dirs=", "-XDignore.symbol.file", "-encoding", "UTF-8"]
if (!DO_BUILD_SDK_FOR_TEST) {
compile.classpath = files(jfxrtJarFromSdk) + compile.classpath
Expand Down
11 changes: 11 additions & 0 deletions gradle.properties.template
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@

#CONF = Release

# Gradle 1.x incremental compilation
#
# Enables the use of the "use depend" feature. This speeds up incremental builds, but at the
# cost of accuracy. Under normal circumstances, if you modify a single source file in the
# "base" project, a near-complete recompile of the entire project is required for correctness
Expand All @@ -181,6 +183,15 @@

#USE_DEPEND = false

# Gradle 2.x incremental compilation
#
# Enables the use of the (still incubating) incremental Java compilation feature. This
# should speed up incremental builds of the Java classes, but is not yet working correctly.
#
# This flag is disabled by default. Uncomment this to turn it on.

#INCREMENTAL = true

# Specify compiler LINT arguments. These values are defined by the javac compiler. You can
# study the list of available options here https://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javac.html
# If LINT is empty, then no warning are generated. Otherwise, LINT should be a space or comma separated
Expand Down

0 comments on commit 91c32fc

Please sign in to comment.