Revision: 10246
Author:   [email protected]
Date:     Tue May 31 04:51:05 2011
Log: Added -XdisableSoycHtml command line flag for disabling HTML compile report generation. This will not affect SOYC XML output.

Review at http://gwt-code-reviews.appspot.com/1450807

Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=10246

Added:
/trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerDisableSoycHtml.java
 /trunk/dev/core/src/com/google/gwt/dev/util/arg/OptionSoycHtmlDisabled.java
Modified:
 /trunk/dev/core/src/com/google/gwt/dev/PrecompileTaskArgProcessor.java
 /trunk/dev/core/src/com/google/gwt/dev/PrecompileTaskOptionsImpl.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/JJSOptions.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/JJSOptionsImpl.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java

=======================================
--- /dev/null
+++ /trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerDisableSoycHtml.java Tue May 31 04:51:05 2011
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.dev.util.arg;
+
+import com.google.gwt.util.tools.ArgHandlerFlag;
+
+/**
+ * An ArgHandler that enables detailed Story Of Your Compile data collection,
+ * but disables HTML report generation, leaving only XML output.
+ *
+ */
+public class ArgHandlerDisableSoycHtml extends ArgHandlerFlag {
+  private final OptionSoycHtmlDisabled options;
+
+  public ArgHandlerDisableSoycHtml(OptionSoycHtmlDisabled options) {
+    this.options = options;
+  }
+
+  @Override
+  public String getPurpose() {
+    return "Enable SOYC reporting without HTML report generation.";
+  }
+
+  @Override
+  public String getTag() {
+    return "-XdisableSoycHtml";
+  }
+
+  @Override
+  public boolean isUndocumented() {
+    return true;
+  }
+
+  @Override
+  public boolean setFlag() {
+    options.setSoycHtmlDisabled(true);
+    options.setSoycEnabled(true);
+    return true;
+  }
+}
=======================================
--- /dev/null
+++ /trunk/dev/core/src/com/google/gwt/dev/util/arg/OptionSoycHtmlDisabled.java Tue May 31 04:51:05 2011
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.dev.util.arg;
+
+/**
+ * Option for disabling SOYC HTML report generation
+ */
+public interface OptionSoycHtmlDisabled extends OptionCompilerMetricsEnabled {
+
+
+  /**
+ * Returns false if the compiler should produce HTML SOYC compile reports in
+   * addition to XML reports.
+   */
+  boolean isSoycHtmlDisabled();
+
+  /**
+   * Sets whether or not the compiler should record and emit Compile Report
+   * information and build the dashboard.
+   */
+  void setSoycEnabled(boolean enabled);
+
+  /**
+ * Sets whether or not the compiler should produce HTML compile reports in
+   * addition to SOYC XML output.
+   */
+  void setSoycHtmlDisabled(boolean disabled);
+
+}
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/PrecompileTaskArgProcessor.java Thu May 26 07:33:13 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/PrecompileTaskArgProcessor.java Tue May 31 04:51:05 2011
@@ -23,6 +23,7 @@
 import com.google.gwt.dev.util.arg.ArgHandlerDisableClassMetadata;
 import com.google.gwt.dev.util.arg.ArgHandlerDisableGeneratingOnShards;
 import com.google.gwt.dev.util.arg.ArgHandlerDisableRunAsync;
+import com.google.gwt.dev.util.arg.ArgHandlerDisableSoycHtml;
 import com.google.gwt.dev.util.arg.ArgHandlerDisableUpdateCheck;
 import com.google.gwt.dev.util.arg.ArgHandlerDraftCompile;
 import com.google.gwt.dev.util.arg.ArgHandlerDumpSignatures;
@@ -58,6 +59,7 @@
     registerHandler(new ArgHandlerSoycDetailed(options));
     registerHandler(new ArgHandlerStrict(options));
     registerHandler(new ArgHandlerCompilerMetrics(options));
+    registerHandler(new ArgHandlerDisableSoycHtml(options));
   }

   @Override
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/PrecompileTaskOptionsImpl.java Thu May 26 07:33:13 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/PrecompileTaskOptionsImpl.java Tue May 31 04:51:05 2011
@@ -126,6 +126,11 @@
   public boolean isSoycExtra() {
     return jjsOptions.isSoycExtra();
   }
+
+  @Override
+  public boolean isSoycHtmlDisabled() {
+    return jjsOptions.isSoycHtmlDisabled();
+  }

   @Override
   public boolean isStrict() {
@@ -221,6 +226,11 @@
   public void setSoycExtra(boolean soycExtra) {
     jjsOptions.setSoycExtra(soycExtra);
   }
+
+  @Override
+  public void setSoycHtmlDisabled(boolean disabled) {
+    jjsOptions.setSoycHtmlDisabled(disabled);
+  }

   @Override
   public void setStrict(boolean strict) {
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/JJSOptions.java Tue Apr 19 10:10:18 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/JJSOptions.java Tue May 31 04:51:05 2011
@@ -26,6 +26,7 @@
 import com.google.gwt.dev.util.arg.OptionScriptStyle;
 import com.google.gwt.dev.util.arg.OptionSoycDetailed;
 import com.google.gwt.dev.util.arg.OptionSoycEnabled;
+import com.google.gwt.dev.util.arg.OptionSoycHtmlDisabled;
 import com.google.gwt.dev.util.arg.OptionStrict;

 /**
@@ -34,5 +35,7 @@
public interface JJSOptions extends OptionOptimize, OptionAggressivelyOptimize, OptionDisableClassMetadata, OptionDisableCastChecking, OptionEnableAssertions, OptionEnableGeneratorResultCaching, OptionRunAsyncEnabled, OptionScriptStyle, - OptionSoycEnabled, OptionSoycDetailed, OptionOptimizePrecompile, OptionStrict {
-}
+ OptionSoycEnabled, OptionSoycDetailed, OptionOptimizePrecompile, OptionStrict,
+    OptionSoycHtmlDisabled {
+
+}
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/JJSOptionsImpl.java Tue Apr 19 10:10:18 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/JJSOptionsImpl.java Tue May 31 04:51:05 2011
@@ -36,6 +36,7 @@
   private boolean runAsyncEnabled = true;
   private boolean soycEnabled = false;
   private boolean soycExtra = false;
+  private boolean soycHtmlDisabled = false;
   private boolean strict = false;

   public JJSOptionsImpl() {
@@ -57,6 +58,7 @@
     setRunAsyncEnabled(other.isRunAsyncEnabled());
     setSoycEnabled(other.isSoycEnabled());
     setSoycExtra(other.isSoycExtra());
+    setSoycHtmlDisabled(other.isSoycHtmlDisabled());
     setStrict(other.isStrict());
   }

@@ -111,6 +113,10 @@
   public boolean isSoycExtra() {
     return soycExtra;
   }
+
+  public boolean isSoycHtmlDisabled() {
+    return soycHtmlDisabled;
+  }

   public boolean isStrict() {
     return strict;
@@ -163,6 +169,10 @@
   public void setSoycExtra(boolean enabled) {
     soycExtra = enabled;
   }
+
+  public void setSoycHtmlDisabled(boolean disabled) {
+    soycHtmlDisabled = disabled;
+  }

   public void setStrict(boolean strict) {
     this.strict = strict;
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java Fri May 27 07:39:55 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java Tue May 31 04:51:05 2011
@@ -451,7 +451,8 @@
       }
toReturn.addArtifacts(makeSoycArtifacts(logger, permutationId, jprogram, js, sizeBreakdowns, sourceInfoMaps, dependencies, jjsmap, obfuscateMap, unifiedAst.getModuleMetrics(),
-          unifiedAst.getPrecompilationMetrics(), compilationMetrics));
+          unifiedAst.getPrecompilationMetrics(), compilationMetrics,
+          options.isSoycHtmlDisabled()));

       logTrackingStats(logger);
       if (logger.isLoggable(TreeLogger.TRACE)) {
@@ -1163,7 +1164,8 @@
       JavaToJavaScriptMap jjsmap, Map<JsName, String> obfuscateMap,
       ModuleMetricsArtifact moduleMetricsArtifact,
       PrecompilationMetricsArtifact precompilationMetricsArtifact,
- CompilationMetricsArtifact compilationMetrics) throws IOException, UnableToCompleteException { + CompilationMetricsArtifact compilationMetrics, boolean htmlReportsDisabled)
+      throws IOException, UnableToCompleteException {
     Memory.maybeDumpMemory("makeSoycArtifactsStart");
List<SyntheticArtifact> soycArtifacts = new ArrayList<SyntheticArtifact>();

@@ -1213,7 +1215,7 @@
       soycArtifact.setVisibility(Visibility.Private);
     }

-    if (sizeBreakdowns != null) {
+    if (!htmlReportsDisabled && sizeBreakdowns != null) {
       Event generateCompileReport =
SpeedTracerLogger.start(CompilerEventType.MAKE_SOYC_ARTIFACTS, "phase",
               "generateCompileReport");
@@ -1245,7 +1247,7 @@
       soycArtifacts.addAll(outDir.getArtifacts());
       generateCompileReport.end();
     }
-
+
     soycEvent.end();

     return soycArtifacts;

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to