From 7e466b2edc6b54d52306894e8e5e0790ecd175bd Mon Sep 17 00:00:00 2001 From: Kevin Rushforth Date: Mon, 7 Oct 2013 12:01:51 -0700 Subject: [PATCH] RT-31500: Gradle: build in debug mode by default Reviewed-by: Felipe --- build.gradle | 9 +++++---- buildSrc/android.gradle | 2 +- buildSrc/armv6hf.gradle | 2 +- buildSrc/armv6sf.gradle | 2 +- buildSrc/ios.gradle | 2 +- buildSrc/linux.gradle | 2 +- buildSrc/mac.gradle | 4 ++-- .../main/groovy/com/sun/javafx/gradle/LinkTask.groovy | 2 +- buildSrc/win.gradle | 4 ++-- buildSrc/x86egl.gradle | 2 +- gradle.properties.template | 4 ++-- 11 files changed, 18 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 9f8aee79077..38f519acdf5 100644 --- a/build.gradle +++ b/build.gradle @@ -337,9 +337,10 @@ if (hasProperty("FULL_TEST")) { } ext.IS_FULL_TEST = isFullTest; -// Specify the build configuration (Release or Debug) -defineProperty("CONF", "Release") -ext.IS_DEBUG = CONF == "Debug" +// Specify the build configuration (Release, Debug, or DebugNative) +defineProperty("CONF", "Debug") +ext.IS_DEBUG_JAVA = CONF == "Debug" || CONF == "DebugNative" +ext.IS_DEBUG_NATIVE = CONF == "DebugNative" // Defines the compiler warning levels to use. If empty, then no warnings are generated. If // not empty, then the expected syntax is as a space or comma separated list of names, such @@ -1654,7 +1655,7 @@ allprojects { // TODO need to file issue with Gradle compile.options.useAnt = true compile.options.debug = true // we always generate debugging info in the class files - compile.options.debugOptions.debugLevel = IS_DEBUG ? "source,lines,vars" : "source,lines" + 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 diff --git a/buildSrc/android.gradle b/buildSrc/android.gradle index 4df33c3dd10..a519c157eb8 100644 --- a/buildSrc/android.gradle +++ b/buildSrc/android.gradle @@ -360,7 +360,7 @@ def ccOptFlags = ["-fpic", "-ffunction-sections", "-funwind-tables","-fstack-pro def ccWarnFlags = ["-Wa,--noexecstack", "-Wno-psabi"] def ccArchFlags = ["-mthumb", "-msoft-float", "-D__ARM_ARCH_5__", "-D__ARM_ARCH_5T__", "-D__ARM_ARCH_5E__", "-D__ARM_ARCH_5TE__", "-march=armv5te" , "-mtune=xscale"] -def ccDebugFlags = [IS_DEBUG ? "-DDEBUG" : "-DNDEBUG"] +def ccDebugFlags = [IS_DEBUG_NATIVE ? "-DDEBUG" : "-DNDEBUG"] def ccDefaultIncludeFlags = ["-I$ndk/platforms/$ndk_target/arch-arm/usr/include"] def linkFlags = ["--sysroot=$sysroot", diff --git a/buildSrc/armv6hf.gradle b/buildSrc/armv6hf.gradle index 3972aebd462..61b1dce937f 100644 --- a/buildSrc/armv6hf.gradle +++ b/buildSrc/armv6hf.gradle @@ -93,7 +93,7 @@ def commonFlags = [ // Specify the compilation parameters and link parameters def ccFlags = [ commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c", - IS_DEBUG ? ["-ggdb", "-DVERBOSE"] : "-O2"].flatten() + IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : "-O2"].flatten() //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"]) def linkFlags = ["-shared", commonFlags].flatten() diff --git a/buildSrc/armv6sf.gradle b/buildSrc/armv6sf.gradle index 5bbded1cac7..95a7c442613 100644 --- a/buildSrc/armv6sf.gradle +++ b/buildSrc/armv6sf.gradle @@ -96,7 +96,7 @@ def commonFlags = [ // Specify the compilation parameters and link parameters def ccFlags = [ commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c", - IS_DEBUG ? ["-ggdb", "-DVERBOSE"] : "-O2"].flatten() + IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : "-O2"].flatten() //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"]) def linkFlags = ["-shared", commonFlags].flatten() diff --git a/buildSrc/ios.gradle b/buildSrc/ios.gradle index 7bdad8d1d09..9f0aac6849f 100644 --- a/buildSrc/ios.gradle +++ b/buildSrc/ios.gradle @@ -111,7 +111,7 @@ def ccFlags = [ "-miphoneos-version-min=6.0", "-fmessage-length=0", "-std=c99", "-fno-common", "-Wall", "-fno-strict-aliasing", "-fwrapv", "-fpascal-strings", "-fobjc-abi-version=2", "-fobjc-legacy-dispatch", "-I$JDK_HOME/include", "-I$JDK_HOME/include/darwin", "-c", - IS_DEBUG ? ["-O0", "-DDEBUG", "-g"] : ["-O3", "-DNDEBUG"]].flatten() + IS_DEBUG_NATIVE ? ["-O0", "-DDEBUG", "-g"] : ["-O3", "-DNDEBUG"]].flatten() def compiler = "clang" def linker = "libtool" diff --git a/buildSrc/linux.gradle b/buildSrc/linux.gradle index 1df43bd9ae5..84c54ea51ec 100644 --- a/buildSrc/linux.gradle +++ b/buildSrc/linux.gradle @@ -77,7 +77,7 @@ def commonFlags = [ // Specify the compilation parameters and link parameters def ccFlags = [ commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c", - IS_DEBUG ? ["-ggdb", "-DVERBOSE"] : "-O2"].flatten() + IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : "-O2"].flatten() //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"]) def linkFlags = ["-shared", commonFlags].flatten() diff --git a/buildSrc/mac.gradle b/buildSrc/mac.gradle index 04fc6b22c51..fae52a44abf 100644 --- a/buildSrc/mac.gradle +++ b/buildSrc/mac.gradle @@ -89,7 +89,7 @@ def ccFlags = [ "-I$JDK_HOME/include", "-I$JDK_HOME/include/darwin", commonParams, - IS_DEBUG ? "-DDEBUG" : ["-O3", "-DNDEBUG"]].flatten() + IS_DEBUG_NATIVE ? "-DDEBUG" : ["-O3", "-DNDEBUG"]].flatten() def compiler = COMPILE_PARFAIT ? "parfait-gcc" : "gcc"; def cc_compiler = COMPILE_PARFAIT ? "parfait-cc" : "cc"; @@ -154,7 +154,7 @@ MAC.launcher.ccFlags = [ "-mmacosx-version-min=$MACOSX_MIN_VERSION", "-arch", "x86_64", "-framework", "Cocoa", - IS_DEBUG ? ["-DDEBUG", "-O0"] : ["-O3", "-DNDEBUG"]].flatten() + IS_DEBUG_NATIVE ? ["-DDEBUG", "-O0"] : ["-O3", "-DNDEBUG"]].flatten() MAC.launcher.linker = linker MAC.launcher.linkFlags = ["-ldl"] diff --git a/buildSrc/src/main/groovy/com/sun/javafx/gradle/LinkTask.groovy b/buildSrc/src/main/groovy/com/sun/javafx/gradle/LinkTask.groovy index 0c6fb248cf6..c8d7535e937 100644 --- a/buildSrc/src/main/groovy/com/sun/javafx/gradle/LinkTask.groovy +++ b/buildSrc/src/main/groovy/com/sun/javafx/gradle/LinkTask.groovy @@ -46,7 +46,7 @@ class LinkTask extends DefaultTask { } else { args("-o", "$lib"); } - if (project.IS_DEBUG && !project.IS_WINDOWS) args("-g"); + if (project.IS_DEBUG_NATIVE && !project.IS_WINDOWS) args("-g"); if (linkParams != null) args(linkParams); if (project.IS_WINDOWS){ final String libPath = lib.toString(); diff --git a/buildSrc/win.gradle b/buildSrc/win.gradle index 698d1e43f53..01a09a19ea6 100644 --- a/buildSrc/win.gradle +++ b/buildSrc/win.gradle @@ -62,10 +62,10 @@ def ccFlags = ["/nologo", "/W3", "/EHsc", "/c", "/D_STATIC_CPPLIB", "/D_DISABLE_DEPRECATE_STATIC_CPPLIB", "/DINLINE=__inline", "/DUNICODE", "/D_UNICODE", "/DWIN32", "/DIAL", "/D_LITTLE_ENDIAN", "/DWIN32_LEAN_AND_MEAN", "/I$JDK_HOME/include", "/I$JDK_HOME/include/win32", - IS_DEBUG ? ["/MDd", "/Od", "/Zi", "/DDEBUG"] : ["/O2", "/MD"]].flatten(); + IS_DEBUG_NATIVE ? ["/MDd", "/Od", "/Zi", "/DDEBUG"] : ["/O2", "/MD"]].flatten(); def linkFlags = ["/nologo", "/dll", "/manifest", "/opt:REF", "/incremental:no"]; -if (IS_DEBUG) linkFlags.add("/debug"); +if (IS_DEBUG_NATIVE) linkFlags.add("/debug"); setupTools("windows_tools", { propFile -> diff --git a/buildSrc/x86egl.gradle b/buildSrc/x86egl.gradle index 1c573bc86cd..53a1420c4e4 100644 --- a/buildSrc/x86egl.gradle +++ b/buildSrc/x86egl.gradle @@ -82,7 +82,7 @@ def commonFlags = [ // Specify the compilation parameters and link parameters def ccFlags = [ commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c", - IS_DEBUG ? ["-ggdb", "-DVERBOSE"] : "-O2"].flatten() + IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : "-O2"].flatten() //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"]) def linkFlags = ["-shared", commonFlags].flatten() diff --git a/gradle.properties.template b/gradle.properties.template index 5ae99d7255a..5ccfd0b5bc9 100644 --- a/gradle.properties.template +++ b/gradle.properties.template @@ -113,9 +113,9 @@ #JDK_DOCS = file:///Library/Java/JavaVirtualMachines/jdk1.8.0/Content/Home/docs/api #JDK_DOCS = relative/path/to/docs/api -# Specify the build configuration (Release or Debug). The default setting is Release. +# Specify the build configuration: Release, Debug, or DebugNative. The default setting is Debug. -#CONF = Debug +#CONF = Release # 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