Repository: flex-falcon
Updated Branches:
  refs/heads/develop 33c5d98c8 -> eb57102f9


FLEX-35335 flex-compiler-oem: updated to support dual changes


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

Branch: refs/heads/develop
Commit: eb57102f911816a1a6829403ac051db2e6484fde
Parents: 33c5d98
Author: Josh Tynjala <[email protected]>
Authored: Thu Jul 6 11:42:38 2017 -0700
Committer: Josh Tynjala <[email protected]>
Committed: Thu Jul 6 11:42:48 2017 -0700

----------------------------------------------------------------------
 .../src/main/java/flex2/tools/CompJSC.java      |  3 +-
 .../src/main/java/flex2/tools/MxmlJSC.java      | 51 ++------------------
 2 files changed, 4 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/eb57102f/flex-compiler-oem/src/main/java/flex2/tools/CompJSC.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/main/java/flex2/tools/CompJSC.java 
b/flex-compiler-oem/src/main/java/flex2/tools/CompJSC.java
index c81f180..396acd1 100644
--- a/flex-compiler-oem/src/main/java/flex2/tools/CompJSC.java
+++ b/flex-compiler-oem/src/main/java/flex2/tools/CompJSC.java
@@ -28,9 +28,8 @@ import java.lang.reflect.InvocationTargetException;
 public class CompJSC extends MxmlJSC {
 
     protected JSCompilerEntryPoint getCompilerInstance(IBackend backend) 
throws NoSuchMethodException, IllegalAccessException, 
InvocationTargetException, InstantiationException {
-        COMPILER = COMPJSC.class;
         if (compiler == null) {
-            compiler = 
COMPILER.getDeclaredConstructor(IBackend.class).newInstance(backend);
+            compiler = new COMPJSC();
         }
         return compiler;
     }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/eb57102f/flex-compiler-oem/src/main/java/flex2/tools/MxmlJSC.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/main/java/flex2/tools/MxmlJSC.java 
b/flex-compiler-oem/src/main/java/flex2/tools/MxmlJSC.java
index 014e0be..bb7c45e 100644
--- a/flex-compiler-oem/src/main/java/flex2/tools/MxmlJSC.java
+++ b/flex-compiler-oem/src/main/java/flex2/tools/MxmlJSC.java
@@ -23,13 +23,6 @@ import org.apache.flex.compiler.clients.JSCompilerEntryPoint;
 import org.apache.flex.compiler.clients.MXMLJSC;
 import org.apache.flex.compiler.clients.problems.ProblemQuery;
 import org.apache.flex.compiler.clients.problems.ProblemQueryProvider;
-import org.apache.flex.compiler.driver.IBackend;
-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.jsc.JSCBackend;
-import org.apache.flex.compiler.internal.driver.js.node.NodeBackend;
-import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSBackend;
 import org.apache.flex.compiler.problems.ICompilerProblem;
 
 import java.lang.reflect.InvocationTargetException;
@@ -37,56 +30,18 @@ import java.util.ArrayList;
 import java.util.List;
 
 public class MxmlJSC implements ProblemQueryProvider {
-
-    protected static Class<? extends MXMLJSC> COMPILER;
-
     protected JSCompilerEntryPoint compiler;
 
-    protected JSCompilerEntryPoint getCompilerInstance(IBackend backend) 
throws NoSuchMethodException, IllegalAccessException, 
InvocationTargetException, InstantiationException {
-        COMPILER = MXMLJSC.class;
+    protected JSCompilerEntryPoint getCompilerInstance() throws 
NoSuchMethodException, IllegalAccessException, InvocationTargetException, 
InstantiationException {
         if (compiler == null) {
-            compiler = 
COMPILER.getDeclaredConstructor(IBackend.class).newInstance(backend);
+            compiler = new MXMLJSC();
         }
         return compiler;
     }
 
     public int execute(String[] args) throws InvocationTargetException, 
NoSuchMethodException, InstantiationException, IllegalAccessException {
-        IBackend backend = new ASBackend();
-        String jsOutputTypeString = "";
-        for (String s : args) {
-            String[] kvp = s.split("=");
-
-            if (s.contains("-js-output-type")) {
-                jsOutputTypeString = kvp[1];
-            }
-        }
-
-        if (jsOutputTypeString.equals("")) {
-            jsOutputTypeString = MXMLJSC.JSOutputType.FLEXJS.getText();
-        }
-
-        MXMLJSC.JSOutputType jsOutputType = 
MXMLJSC.JSOutputType.fromString(jsOutputTypeString);
-        switch (jsOutputType) {
-            case AMD:
-                backend = new AMDBackend();
-                break;
-            case FLEXJS:
-            case FLEXJS_DUAL:
-                backend = new MXMLFlexJSBackend();
-                break;
-            case GOOG:
-                backend = new GoogBackend();
-                break;
-            case JSC:
-                backend = new JSCBackend();
-                break;
-            case NODE:
-                backend = new NodeBackend();
-                break;
-        }
-
         final List<ICompilerProblem> problems = new 
ArrayList<ICompilerProblem>();
-        return getCompilerInstance(backend).mainNoExit(args, problems, false);
+        return getCompilerInstance().mainNoExit(args, problems, false);
     }
 
     @Override

Reply via email to