You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/06/04 08:06:43 UTC
[37/42] git commit: [flex-falcon] [refs/heads/develop] - Set the
compiler at right time
Set the compiler at right time
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/6675bd04
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/6675bd04
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/6675bd04
Branch: refs/heads/develop
Commit: 6675bd049f30f440ea06663d852cfa6301e28fbc
Parents: e0f0655
Author: Frédéric THOMAS <we...@gmail.com>
Authored: Mon Jun 1 19:23:03 2015 +0100
Committer: Frédéric THOMAS <we...@gmail.com>
Committed: Tue Jun 2 13:41:41 2015 +0100
----------------------------------------------------------------------
flex-compiler-oem/src/flex2/tools/CompJSC.java | 10 +++++++++-
flex-compiler-oem/src/flex2/tools/Compc.java | 9 ++++-----
flex-compiler-oem/src/flex2/tools/MxmlJSC.java | 3 ++-
flex-compiler-oem/src/flex2/tools/Mxmlc.java | 9 ++++-----
4 files changed, 19 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6675bd04/flex-compiler-oem/src/flex2/tools/CompJSC.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/flex2/tools/CompJSC.java b/flex-compiler-oem/src/flex2/tools/CompJSC.java
index cb2106c..c81f180 100644
--- a/flex-compiler-oem/src/flex2/tools/CompJSC.java
+++ b/flex-compiler-oem/src/flex2/tools/CompJSC.java
@@ -20,10 +20,18 @@
package flex2.tools;
import org.apache.flex.compiler.clients.COMPJSC;
+import org.apache.flex.compiler.clients.JSCompilerEntryPoint;
+import org.apache.flex.compiler.driver.IBackend;
+
+import java.lang.reflect.InvocationTargetException;
public class CompJSC extends MxmlJSC {
- static {
+ protected JSCompilerEntryPoint getCompilerInstance(IBackend backend) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
COMPILER = COMPJSC.class;
+ if (compiler == null) {
+ compiler = COMPILER.getDeclaredConstructor(IBackend.class).newInstance(backend);
+ }
+ return compiler;
}
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6675bd04/flex-compiler-oem/src/flex2/tools/Compc.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/flex2/tools/Compc.java b/flex-compiler-oem/src/flex2/tools/Compc.java
index a502217..38848fa 100644
--- a/flex-compiler-oem/src/flex2/tools/Compc.java
+++ b/flex-compiler-oem/src/flex2/tools/Compc.java
@@ -30,11 +30,6 @@ public class Compc extends Tool {
public static final String FILE_SPECS = "include-classes";
- static {
- COMPILER = COMPC.class;
- JS_COMPILER = CompJSC.class;
- }
-
/**
* The entry-point for Mxmlc.
* Note that if you change anything in this method, make sure to check Compc, Shell, and
@@ -52,6 +47,10 @@ public class Compc extends Tool {
}
public static void compc(String[] args) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
+
+ COMPILER = COMPC.class;
+ JS_COMPILER = CompJSC.class;
+
compile(args);
}
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6675bd04/flex-compiler-oem/src/flex2/tools/MxmlJSC.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/flex2/tools/MxmlJSC.java b/flex-compiler-oem/src/flex2/tools/MxmlJSC.java
index c2923a1..f71633a 100644
--- a/flex-compiler-oem/src/flex2/tools/MxmlJSC.java
+++ b/flex-compiler-oem/src/flex2/tools/MxmlJSC.java
@@ -37,11 +37,12 @@ import java.util.Set;
public class MxmlJSC implements ProblemQueryProvider {
- protected static Class<? extends MXMLJSC> COMPILER = MXMLJSC.class;
+ protected static Class<? extends MXMLJSC> COMPILER;
protected JSCompilerEntryPoint compiler;
protected JSCompilerEntryPoint getCompilerInstance(IBackend backend) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
+ COMPILER = MXMLJSC.class;
if (compiler == null) {
compiler = COMPILER.getDeclaredConstructor(IBackend.class).newInstance(backend);
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6675bd04/flex-compiler-oem/src/flex2/tools/Mxmlc.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/flex2/tools/Mxmlc.java b/flex-compiler-oem/src/flex2/tools/Mxmlc.java
index abed94f..ed908f9 100644
--- a/flex-compiler-oem/src/flex2/tools/Mxmlc.java
+++ b/flex-compiler-oem/src/flex2/tools/Mxmlc.java
@@ -47,11 +47,6 @@ public final class Mxmlc extends Tool {
public static final String FILE_SPECS = "file-specs";
- static {
- COMPILER = MXMLC.class;
- JS_COMPILER = MxmlJSC.class;
- }
-
/**
* The entry-point for Mxmlc.
* Note that if you change anything in this method, make sure to check Compc, Shell, and
@@ -69,6 +64,10 @@ public final class Mxmlc extends Tool {
}
public static void mxmlc(String[] args) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
+
+ COMPILER = MXMLC.class;
+ JS_COMPILER = MxmlJSC.class;
+
compile(args);
}