flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [05/22] git commit: [flex-falcon] [refs/heads/develop] - Add option to exclude ASDoc from compilation
Date Fri, 24 Oct 2014 11:29:57 GMT
Add option to exclude ASDoc from compilation

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/dcb5c706
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/dcb5c706
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/dcb5c706

Branch: refs/heads/develop
Commit: dcb5c7066ed3393b651e48df40253ea04db6a583
Parents: c932239
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Tue Oct 21 13:13:56 2014 +0200
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Thu Oct 23 19:42:52 2014 +0200

----------------------------------------------------------------------
 .../apache/flex/compiler/clients/MXMLJSC.java   |  7 ++++++-
 .../codegen/js/flexjs/JSFlexJSDocEmitter.java   | 15 +++++++-------
 .../driver/js/goog/JSGoogConfiguration.java     | 21 ++++++++++++++++++++
 3 files changed, 35 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dcb5c706/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java b/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
index bb581ac..81f7f0d 100644
--- a/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
@@ -56,6 +56,7 @@ import org.apache.flex.compiler.internal.config.FlashBuilderConfigurator;
 import org.apache.flex.compiler.internal.driver.as.ASBackend;
 import org.apache.flex.compiler.internal.driver.js.amd.AMDBackend;
 import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
 import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSBackend;
 import org.apache.flex.compiler.internal.driver.mxml.vf2js.MXMLVF2JSBackend;
 import org.apache.flex.compiler.internal.parsing.as.FlexJSASDocDelegate;
@@ -140,7 +141,8 @@ public class MXMLJSC
         final int code;
     }
 
-    protected static JSOutputType jsOutputType;
+    public static JSOutputType jsOutputType;
+    public static boolean keepASDoc;
 
     /**
      * Java program entry point.
@@ -290,6 +292,9 @@ public class MXMLJSC
 
             final boolean continueCompilation = configure(adjustedArgs);
 
+            // ToDo (erikdebruin): use JSSharedData for globals ...
+            keepASDoc = ((JSGoogConfiguration) config).getKeepASDoc();
+            
             if (outProblems != null && !config.isVerbose())
                 JSSharedData.STDOUT = JSSharedData.STDERR = null;
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dcb5c706/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
index 480583e..6e3524b 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
@@ -20,6 +20,7 @@
 package org.apache.flex.compiler.internal.codegen.js.flexjs;
 
 import org.apache.flex.compiler.asdoc.flexjs.ASDocComment;
+import org.apache.flex.compiler.clients.MXMLJSC;
 import org.apache.flex.compiler.codegen.js.IJSEmitter;
 import org.apache.flex.compiler.common.ASModifier;
 import org.apache.flex.compiler.common.DependencyType;
@@ -61,7 +62,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
 
             if (node.isConstructor())
             {
-                if (asDoc != null)
+                if (asDoc != null && MXMLJSC.keepASDoc)
                     write(asDoc.commentNoEnd());
                 else
                     begin();
@@ -96,7 +97,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
                 String ns = node.getNamespace();
                 if (ns != null)
                 {
-                    if (asDoc != null)
+                    if (asDoc != null && MXMLJSC.keepASDoc)
                         write(asDoc.commentNoEnd());
                     else
                         begin();
@@ -111,7 +112,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
             {
                 if (!hasDoc)
                 {
-                    if (asDoc != null)
+                    if (asDoc != null && MXMLJSC.keepASDoc)
                         write(asDoc.commentNoEnd());
                     else
                         begin();
@@ -138,7 +139,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
                 {
                     if (!hasDoc)
                     {
-                        if (asDoc != null)
+                        if (asDoc != null && MXMLJSC.keepASDoc)
                             write(asDoc.commentNoEnd());
                         else
                             begin();
@@ -164,7 +165,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
                 {
                     if (!hasDoc)
                     {
-                        if (asDoc != null)
+                        if (asDoc != null && MXMLJSC.keepASDoc)
                             write(asDoc.commentNoEnd());
                         else
                             begin();
@@ -191,7 +192,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
         if (returnType != ""
                 && returnType != ASEmitterTokens.VOID.getToken()) // has return
         {
-            if (asDoc != null)
+            if (asDoc != null && MXMLJSC.keepASDoc)
                 write(asDoc.commentNoEnd());
             else
                 begin();
@@ -208,7 +209,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
         {
             if (!hasDoc)
             {
-                if (asDoc != null)
+                if (asDoc != null && MXMLJSC.keepASDoc)
                     write(asDoc.commentNoEnd());
                 else
                     begin();

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dcb5c706/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/goog/JSGoogConfiguration.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/goog/JSGoogConfiguration.java
b/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/goog/JSGoogConfiguration.java
index e5216e6..d5608ea 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/goog/JSGoogConfiguration.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/goog/JSGoogConfiguration.java
@@ -211,6 +211,27 @@ public class JSGoogConfiguration extends JSConfiguration
         strictPublish = value;
     }
 
+    //
+    // 'keep-asdoc'
+    //
+
+    private boolean keepASDoc = true;
+
+    public boolean getKeepASDoc()
+    {
+        return keepASDoc;
+    }
+
+    @Config
+    @Mapping("keep-asdoc")
+    public void setKeepASDoc(ConfigurationValue cv, boolean value)
+            throws ConfigurationException
+    {
+    	keepASDoc = value;
+    }
+
+    
+    
     protected String getAbsolutePathFromPathRelativeToMXMLC(String relativePath)
         throws IOException
     {


Mime
View raw message