Permalink
Browse files

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

…ing S4 packages
  • Loading branch information...
1 parent 755ed6b commit 45da696a66efb00738086fbb7e06f7c82ccd1945 @matthieumorel matthieumorel committed Feb 28, 2013
@@ -92,7 +92,8 @@ public static void main(String[] args) {
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 static void main(String[] args) {
@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 String convert(String arg) {
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 static void exec(File buildFile, String taskName, String[] params) throws
// 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]);
@@ -40,7 +40,8 @@ public static void main(String[] args) {
// 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 static void main(String[] args) {
@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;
+
}
}

0 comments on commit 45da696

Please sign in to comment.