incubator-s4-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject git commit: S4-122 Add option for showing debug logs from build system when building S4 packages
Date Thu, 28 Feb 2013 11:55:03 GMT
Updated Branches:
  refs/heads/S4-122 [created] 45da696a6


S4-122 Add option for showing debug logs from build system when building S4 packages


Project: http://git-wip-us.apache.org/repos/asf/incubator-s4/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s4/commit/45da696a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s4/tree/45da696a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s4/diff/45da696a

Branch: refs/heads/S4-122
Commit: 45da696a66efb00738086fbb7e06f7c82ccd1945
Parents: 755ed6b
Author: Matthieu Morel <mmorel@apache.org>
Authored: Thu Feb 28 12:53:13 2013 +0100
Committer: Matthieu Morel <mmorel@apache.org>
Committed: Thu Feb 28 12:53:13 2013 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/s4/tools/Deploy.java  |   12 +++++++++---
 .../src/main/java/org/apache/s4/tools/Package.java |    6 +++++-
 2 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/45da696a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/Deploy.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/Deploy.java b/subprojects/s4-tools/src/main/java/org/apache/s4/tools/Deploy.java
index 76a1d43..ab162d5 100644
--- a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/Deploy.java
+++ b/subprojects/s4-tools/src/main/java/org/apache/s4/tools/Deploy.java
@@ -92,7 +92,8 @@ public class Deploy extends S4ArgsBase {
                 params.add("appClass=" + deployArgs.appClass);
                 params.add("appsDir=" + tmpAppsDir.getAbsolutePath());
                 params.add("appName=" + deployArgs.appName);
-                ExecGradle.exec(deployArgs.gradleBuildFile, "installS4R", params.toArray(new
String[] {}));
+                ExecGradle.exec(deployArgs.gradleBuildFile, "installS4R", params.toArray(new
String[] {}),
+                        deployArgs.debug);
                 File tmpS4R = new File(tmpAppsDir.getAbsolutePath() + "/" + deployArgs.appName
+ ".s4r");
                 if (!Strings.isNullOrEmpty(deployArgs.generatedS4R)) {
                     logger.info("Copying generated S4R to [{}]", deployArgs.generatedS4R);
@@ -185,6 +186,9 @@ public class Deploy extends S4ArgsBase {
 
         @Parameter(names = "-testMode", description = "Special mode for regression testing",
hidden = true)
         boolean testMode = false;
+
+        @Parameter(names = "-debug", description = "Display debug information from the build
system", arity = 0)
+        boolean debug = false;
     }
 
     /**
@@ -207,7 +211,7 @@ public class Deploy extends S4ArgsBase {
 
     static class ExecGradle {
 
-        public static void exec(File buildFile, String taskName, String[] params) throws
Exception {
+        public static void exec(File buildFile, String taskName, String[] params, boolean
debug) throws Exception {
 
             ProjectConnection connection = GradleConnector.newConnector()
                     .forProjectDirectory(buildFile.getParentFile()).connect();
@@ -222,7 +226,9 @@ public class Deploy extends S4ArgsBase {
                 // buildArgs.add("-b");
                 // buildArgs.add(buildFilePath);
                 buildArgs.add("-stacktrace");
-                buildArgs.add("-info");
+                if (debug) {
+                    buildArgs.add("-debug");
+                }
                 if (params.length > 0) {
                     for (int i = 0; i < params.length; i++) {
                         buildArgs.add("-P" + params[i]);

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/45da696a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/Package.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/Package.java b/subprojects/s4-tools/src/main/java/org/apache/s4/tools/Package.java
index fe8761a..28e4bdb 100644
--- a/subprojects/s4-tools/src/main/java/org/apache/s4/tools/Package.java
+++ b/subprojects/s4-tools/src/main/java/org/apache/s4/tools/Package.java
@@ -40,7 +40,8 @@ public class Package extends S4ArgsBase {
             // prepare gradle -P parameters, including passed gradle opts
             params.add("appClass=" + packageArgs.appClass);
             params.add("appName=" + packageArgs.appName.get(0));
-            ExecGradle.exec(packageArgs.gradleBuildFile, "installS4R", params.toArray(new
String[] {}));
+            ExecGradle.exec(packageArgs.gradleBuildFile, "installS4R", params.toArray(new
String[] {}),
+                    packageArgs.debug);
 
             // Explicitly shutdown the JVM since Gradle leaves non-daemon threads running
that delay the termination
             System.exit(0);
@@ -61,5 +62,8 @@ public class Package extends S4ArgsBase {
         @Parameter(names = { "-a", "-appClass" }, description = "Full class name of the application
class (extending App or AdapterApp)", required = false)
         String appClass = "";
 
+        @Parameter(names = "-debug", description = "Display debug information from the build
system", arity = 0)
+        boolean debug = false;
+
     }
 }


Mime
View raw message