You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ft...@apache.org on 2015/05/28 11:27:13 UTC
git commit: [flex-falcon] [refs/heads/IDEA-FLEX_JS_COMPILER] - Adding
support for COMP C/JSC
Repository: flex-falcon
Updated Branches:
refs/heads/IDEA-FLEX_JS_COMPILER bdf2549da -> 4d5fab885
Adding support for COMP C/JSC
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/4d5fab88
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/4d5fab88
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/4d5fab88
Branch: refs/heads/IDEA-FLEX_JS_COMPILER
Commit: 4d5fab88553ce486571a02c5abea328f0280d73a
Parents: bdf2549
Author: Frédéric THOMAS <we...@gmail.com>
Authored: Thu May 28 10:26:55 2015 +0100
Committer: Frédéric THOMAS <we...@gmail.com>
Committed: Thu May 28 10:26:55 2015 +0100
----------------------------------------------------------------------
.../apache/flex/compiler/clients/COMPJSC.java | 2 +-
flex-compiler-oem/src/flex2/tools/CompJSC.java | 12 ++++++++++
flex-compiler-oem/src/flex2/tools/Compc.java | 24 ++++++++++++++++++++
flex-compiler-oem/src/flex2/tools/MxmlJSC.java | 2 +-
flex-compiler-oem/src/flex2/tools/Mxmlc.java | 21 +++++++++++++++++
flex-compiler-oem/src/flex2/tools/Tool.java | 22 +-----------------
6 files changed, 60 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/4d5fab88/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java b/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
index ecae272..694e521 100644
--- a/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
@@ -153,7 +153,7 @@ public class COMPJSC extends MXMLJSC
return exitCode;
}
- protected COMPJSC(IBackend backend)
+ public COMPJSC(IBackend backend)
{
super(backend);
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/4d5fab88/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 c6f107b..0491ba0 100644
--- a/flex-compiler-oem/src/flex2/tools/CompJSC.java
+++ b/flex-compiler-oem/src/flex2/tools/CompJSC.java
@@ -1,6 +1,10 @@
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;
/**
* @author: Frederic Thomas
@@ -10,4 +14,12 @@ import org.apache.flex.compiler.clients.COMPJSC;
public class CompJSC extends MxmlJSC {
private static Class<COMPJSC> COMPILER = COMPJSC.class;
+
+ @Override
+ protected JSCompilerEntryPoint getCompilerInstance(IBackend backend) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
+ if (compiler == null) {
+ compiler = COMPILER.getDeclaredConstructor(IBackend.class).newInstance(backend);
+ }
+ return compiler;
+ }
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/4d5fab88/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 ac9a72b..a502217 100644
--- a/flex-compiler-oem/src/flex2/tools/Compc.java
+++ b/flex-compiler-oem/src/flex2/tools/Compc.java
@@ -21,13 +21,37 @@ package flex2.tools;
import org.apache.flex.compiler.clients.COMPC;
+import java.lang.reflect.InvocationTargetException;
+
/**
* Entry-point for compc, the command-line tool for compiling components.
*/
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
+ * the server's CompileFilter to see if the same change needs to be made there. You
+ * should also inform the Zorn team of the change.
+ *
+ * @param args
+ */
+ public static void main(String[] args) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
+ System.exit(compcNoExit(args));
+ }
+
+ public static int compcNoExit(String[] args) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
+ return compile(args);
+ }
+
+ public static void compc(String[] args) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
+ compile(args);
+ }
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/4d5fab88/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 df2bcc3..5dc4557 100644
--- a/flex-compiler-oem/src/flex2/tools/MxmlJSC.java
+++ b/flex-compiler-oem/src/flex2/tools/MxmlJSC.java
@@ -25,7 +25,7 @@ public class MxmlJSC implements ProblemQueryProvider {
private static Class<MXMLJSC> COMPILER = MXMLJSC.class;
- private JSCompilerEntryPoint compiler;
+ protected JSCompilerEntryPoint compiler;
protected JSCompilerEntryPoint getCompilerInstance(IBackend backend) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
if (compiler == null) {
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/4d5fab88/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 2bf9b63..abed94f 100644
--- a/flex-compiler-oem/src/flex2/tools/Mxmlc.java
+++ b/flex-compiler-oem/src/flex2/tools/Mxmlc.java
@@ -33,6 +33,7 @@ import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
import java.util.*;
import java.util.Map.Entry;
@@ -51,6 +52,26 @@ public final class Mxmlc extends Tool {
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
+ * the server's CompileFilter to see if the same change needs to be made there. You
+ * should also inform the Zorn team of the change.
+ *
+ * @param args
+ */
+ public static void main(String[] args) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
+ System.exit(mxmlcNoExit(args));
+ }
+
+ public static int mxmlcNoExit(String[] args) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
+ return compile(args);
+ }
+
+ public static void mxmlc(String[] args) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
+ compile(args);
+ }
+
public static Configuration processConfiguration(LocalizationManager lmgr, String program, String[] args,
ConfigurationBuffer cfgbuf, Class<? extends Configuration> cls, String defaultVar)
throws ConfigurationException, IOException {
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/4d5fab88/flex-compiler-oem/src/flex2/tools/Tool.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/flex2/tools/Tool.java b/flex-compiler-oem/src/flex2/tools/Tool.java
index d351912..b61fa43 100644
--- a/flex-compiler-oem/src/flex2/tools/Tool.java
+++ b/flex-compiler-oem/src/flex2/tools/Tool.java
@@ -50,27 +50,7 @@ public class Tool
protected static Class<? extends MXMLC> COMPILER;
protected static Class<? extends MxmlJSC> JS_COMPILER;
- /**
- * The entry-point for Mxmlc.
- * Note that if you change anything in this method, make sure to check Compc, Shell, and
- * the server's CompileFilter to see if the same change needs to be made there. You
- * should also inform the Zorn team of the change.
- *
- * @param args
- */
- public static void main(String[] args) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
- System.exit(mxmlcNoExit(args));
- }
-
- public static int mxmlcNoExit(String[] args) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
- return compile(args);
- }
-
- public static void mxmlc(String[] args) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
- compile(args);
- }
-
- private static int compile(String[] args) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
+ protected static int compile(String[] args) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
int exitCode;
if (hasJsOutputType(args)) {