changeset 5292:ab3b347eb645

RT-31500: Gradle: build in debug mode by default Reviewed-by: Felipe
author kcr
date Mon, 07 Oct 2013 12:01:51 -0700
parents 18781eb28d4e
children 78d4d74d1100
files build.gradle buildSrc/android.gradle buildSrc/armv6hf.gradle buildSrc/armv6sf.gradle buildSrc/ios.gradle buildSrc/linux.gradle buildSrc/mac.gradle buildSrc/src/main/groovy/com/sun/javafx/gradle/LinkTask.groovy buildSrc/win.gradle buildSrc/x86egl.gradle gradle.properties.template
diffstat 11 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Mon Oct 07 12:01:46 2013 -0700
+++ b/build.gradle	Mon Oct 07 12:01:51 2013 -0700
@@ -337,9 +337,10 @@
 }
 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 @@
         // 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
--- a/buildSrc/android.gradle	Mon Oct 07 12:01:46 2013 -0700
+++ b/buildSrc/android.gradle	Mon Oct 07 12:01:51 2013 -0700
@@ -360,7 +360,7 @@
 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",
--- a/buildSrc/armv6hf.gradle	Mon Oct 07 12:01:46 2013 -0700
+++ b/buildSrc/armv6hf.gradle	Mon Oct 07 12:01:51 2013 -0700
@@ -93,7 +93,7 @@
 // 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()
 
--- a/buildSrc/armv6sf.gradle	Mon Oct 07 12:01:46 2013 -0700
+++ b/buildSrc/armv6sf.gradle	Mon Oct 07 12:01:51 2013 -0700
@@ -96,7 +96,7 @@
 // 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()
 
--- a/buildSrc/ios.gradle	Mon Oct 07 12:01:46 2013 -0700
+++ b/buildSrc/ios.gradle	Mon Oct 07 12:01:51 2013 -0700
@@ -111,7 +111,7 @@
     "-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"
--- a/buildSrc/linux.gradle	Mon Oct 07 12:01:46 2013 -0700
+++ b/buildSrc/linux.gradle	Mon Oct 07 12:01:51 2013 -0700
@@ -77,7 +77,7 @@
 // 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()
 
--- a/buildSrc/mac.gradle	Mon Oct 07 12:01:46 2013 -0700
+++ b/buildSrc/mac.gradle	Mon Oct 07 12:01:51 2013 -0700
@@ -89,7 +89,7 @@
         "-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 @@
         "-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"]
 
--- a/buildSrc/src/main/groovy/com/sun/javafx/gradle/LinkTask.groovy	Mon Oct 07 12:01:46 2013 -0700
+++ b/buildSrc/src/main/groovy/com/sun/javafx/gradle/LinkTask.groovy	Mon Oct 07 12:01:51 2013 -0700
@@ -46,7 +46,7 @@
             } 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();
--- a/buildSrc/win.gradle	Mon Oct 07 12:01:46 2013 -0700
+++ b/buildSrc/win.gradle	Mon Oct 07 12:01:51 2013 -0700
@@ -62,10 +62,10 @@
         "/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 ->
--- a/buildSrc/x86egl.gradle	Mon Oct 07 12:01:46 2013 -0700
+++ b/buildSrc/x86egl.gradle	Mon Oct 07 12:01:51 2013 -0700
@@ -82,7 +82,7 @@
 // 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()
 
--- a/gradle.properties.template	Mon Oct 07 12:01:46 2013 -0700
+++ b/gradle.properties.template	Mon Oct 07 12:01:51 2013 -0700
@@ -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