flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject [2/6] git commit: [flex-falcon] [refs/heads/develop] - Added FlexToolGroup and FlexTool implementations for: - Falcon - FlexJS - VF2JS
Date Sun, 23 Nov 2014 12:26:39 GMT
Added FlexToolGroup and FlexTool implementations for:
- Falcon
- FlexJS
- VF2JS


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

Branch: refs/heads/develop
Commit: 8c2f634dbb4bd472e0ea8d8a2468d090def6cb34
Parents: 7923ce9
Author: Christofer Dutz <christofer.dutz@codecentric.de>
Authored: Mon Nov 10 11:44:33 2014 +0100
Committer: Christofer Dutz <christofer.dutz@codecentric.de>
Committed: Mon Nov 10 11:44:33 2014 +0100

----------------------------------------------------------------------
 compiler.jx/build.xml                           |  4 +-
 compiler.jx/downloads.xml                       | 14 +++++++
 .../apache/flex/compiler/clients/COMPJSC.java   | 13 ++++++-
 .../flex/compiler/clients/FlexJSToolGroup.java  | 39 +++++++++++++++++++
 .../apache/flex/compiler/clients/MXMLJSC.java   | 28 +++++++++++++-
 .../flex/compiler/clients/VF2JSToolGroup.java   | 40 ++++++++++++++++++++
 compiler/build.xml                              |  2 +-
 7 files changed, 135 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c2f634d/compiler.jx/build.xml
----------------------------------------------------------------------
diff --git a/compiler.jx/build.xml b/compiler.jx/build.xml
index dc7d889..9a37be9 100644
--- a/compiler.jx/build.xml
+++ b/compiler.jx/build.xml
@@ -42,6 +42,7 @@
 			<file name="commons-io.jar" />
             <file name="guava.jar" />
             <file name="antlr.jar" />
+			<file name="flex-tool-api.jar" />
         </filelist>
 		<filelist dir="${build.lib.dir}/google/closure-compiler">
             <file name="compiler.jar" />
@@ -54,6 +55,7 @@
 				<file name="commons-io.jar" />
 				<file name="guava.jar" />
 				<file name="antlr.jar" />
+				<file name="flex-tool-api.jar"/>
 			</filelist>
 		</copy>
 		<copy todir="${build.lib.dir}/google/closure-compiler">
@@ -84,7 +86,7 @@
 	
 	<target name="main" depends="prebuild,copyFiles,compile">
         
-        <property name="jar.classpath" value="commons-io.jar ../../lib/external/guava.jar
 ../../lib/external/antlr.jar google/closure-compiler/compiler.jar ../../compiler/generated/dist/sdk/lib/compiler.jar
../../lib/compiler.jar" />
+        <property name="jar.classpath" value="commons-io.jar ../../lib/external/guava.jar
 ../../lib/external/antlr.jar ../../lib/external/flex-tool-api.jar google/closure-compiler/compiler.jar
../../compiler/generated/dist/sdk/lib/compiler.jar ../../lib/compiler.jar" />
 
 		<echo message="Building ${jsc.jar}" />
 		<jar file="${jsc.jar}" basedir="${classes.dir}"

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c2f634d/compiler.jx/downloads.xml
----------------------------------------------------------------------
diff --git a/compiler.jx/downloads.xml b/compiler.jx/downloads.xml
index cc998a7..dd64945 100644
--- a/compiler.jx/downloads.xml
+++ b/compiler.jx/downloads.xml
@@ -150,6 +150,20 @@
       <param name="dest.folder" value=""/>
       <param name="dest.filename" value="${org.json.name}.jar"/>
     </antcall>
+
+      <!--  flex-tool-api -->
+      <property name="flexToolApi.name" value="flex-tool-api"/>
+      <property name="flexToolApi.version" value="1.0.0-SNAPSHOT"/>
+      <antcall target="download-dependency">
+          <param name="name" value="${flexToolApi.name}"/>
+          <param name="src.server" value="http://repository.apache.org/content/groups/snapshots"/>
+          <param name="src.folder" value="org/apache/flex/flex-tool-api/${flexToolApi.version}"/>
+          <param name="src.filename" value="flex-tool-api-1.0.0-20141105.140704-1.jar"/>
+          <param name="src.checksum" value="b37c99011d06e1ff794d8ee9153ab2c4"/>
+          <param name="dest.folder" value=""/>
+          <param name="dest.filename" value="${flexToolApi.name}.jar"/>
+          <param name="license.use.apache" value="true"/>
+      </antcall>
   </target>
 
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c2f634d/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 99140bb..068b2f3 100644
--- a/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
@@ -51,6 +51,7 @@ import org.apache.flex.compiler.problems.UnableToBuildSWFProblem;
 import org.apache.flex.compiler.targets.ITarget.TargetType;
 import org.apache.flex.compiler.targets.ITargetSettings;
 import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.tools.FlexTool;
 import org.apache.flex.utils.FileUtils;
 
 import sun.reflect.generics.reflectiveObjects.NotImplementedException;
@@ -60,7 +61,7 @@ import sun.reflect.generics.reflectiveObjects.NotImplementedException;
  * @author Erik de Bruin
  * @author Michael Schmalle
  */
-public class COMPJSC extends MXMLJSC
+public class COMPJSC extends MXMLJSC implements FlexTool
 {
     /*
      * Exit code enumerations.
@@ -81,6 +82,16 @@ public class COMPJSC extends MXMLJSC
         final int code;
     }
 
+    @Override
+    public String getName() {
+        return "COMPC";
+    }
+
+    @Override
+    public int execute(String[] args) {
+        return staticMainNoExit(args);
+    }
+
     /**
      * Java program entry point.
      * 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c2f634d/compiler.jx/src/org/apache/flex/compiler/clients/FlexJSToolGroup.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/clients/FlexJSToolGroup.java b/compiler.jx/src/org/apache/flex/compiler/clients/FlexJSToolGroup.java
new file mode 100644
index 0000000..f33e346
--- /dev/null
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/FlexJSToolGroup.java
@@ -0,0 +1,39 @@
+package org.apache.flex.compiler.clients;
+
+import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSBackend;
+import org.apache.flex.tools.FlexTool;
+import org.apache.flex.tools.FlexToolGroup;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by christoferdutz on 10.11.14.
+ */
+public class FlexJSToolGroup implements FlexToolGroup {
+
+    Map<String, FlexTool> tools;
+
+    public FlexJSToolGroup() {
+        tools = new HashMap<String, FlexTool>();
+        tools.put("COMPC", new COMPJSC(new MXMLFlexJSBackend()));
+        tools.put("MXMLC", new MXMLJSC(new MXMLFlexJSBackend()));
+    }
+
+    @Override
+    public String getName() {
+        return "FlexJS";
+    }
+
+    @Override
+    public Collection<String> getFlexToolNames() {
+        return tools.keySet();
+    }
+
+    @Override
+    public FlexTool getFlexTool(String toolName) {
+        return tools.get(toolName);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c2f634d/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 e08cd6c..2716aea 100644
--- a/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
@@ -77,6 +77,7 @@ import org.apache.flex.compiler.targets.ITarget;
 import org.apache.flex.compiler.targets.ITarget.TargetType;
 import org.apache.flex.compiler.targets.ITargetSettings;
 import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.tools.FlexTool;
 import org.apache.flex.utils.FileUtils;
 import org.apache.flex.utils.FilenameNormalization;
 
@@ -88,7 +89,7 @@ import com.google.common.collect.Iterables;
  * @author Erik de Bruin
  * @author Michael Schmalle
  */
-public class MXMLJSC
+public class MXMLJSC implements FlexTool
 {
     /*
      * JS output type enumerations.
@@ -143,6 +144,17 @@ public class MXMLJSC
     public static JSOutputType jsOutputType;
     public static boolean keepASDoc;
 
+    @Override
+    public String getName() {
+        return "MXMLC";
+    }
+
+    @Override
+    public int execute(String[] args) {
+        final Set<ICompilerProblem> problems = new HashSet<ICompilerProblem>();
+        return mainNoExit(args, problems, true);
+    }
+
     /**
      * Java program entry point.
      * 
@@ -150,6 +162,18 @@ public class MXMLJSC
      */
     public static void main(final String[] args)
     {
+        int exitCode = staticMainNoExit(args);
+        System.exit(exitCode);
+    }
+
+    /**
+     * Entry point for the {@code <compc>} Ant task.
+     *
+     * @param args Command line arguments.
+     * @return An exit code.
+     */
+    public static int staticMainNoExit(final String[] args)
+    {
         long startTime = System.nanoTime();
 
         IBackend backend = new ASBackend();
@@ -193,7 +217,7 @@ public class MXMLJSC
         long endTime = System.nanoTime();
         JSSharedData.instance.stdout((endTime - startTime) / 1e9 + " seconds");
 
-        System.exit(exitCode);
+        return exitCode;
     }
 
     protected Workspace workspace;

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c2f634d/compiler.jx/src/org/apache/flex/compiler/clients/VF2JSToolGroup.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/clients/VF2JSToolGroup.java b/compiler.jx/src/org/apache/flex/compiler/clients/VF2JSToolGroup.java
new file mode 100644
index 0000000..2918e68
--- /dev/null
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/VF2JSToolGroup.java
@@ -0,0 +1,40 @@
+package org.apache.flex.compiler.clients;
+
+import org.apache.flex.compiler.internal.driver.js.vf2js.VF2JSBackend;
+import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSBackend;
+import org.apache.flex.tools.FlexTool;
+import org.apache.flex.tools.FlexToolGroup;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by christoferdutz on 10.11.14.
+ */
+public class VF2JSToolGroup implements FlexToolGroup {
+
+    Map<String, FlexTool> tools;
+
+    public VF2JSToolGroup() {
+        tools = new HashMap<String, FlexTool>();
+        tools.put("COMPC", new COMPJSC(new VF2JSBackend()));
+        tools.put("MXMLC", new MXMLJSC(new VF2JSBackend()));
+    }
+
+    @Override
+    public String getName() {
+        return "VF2JS";
+    }
+
+    @Override
+    public Collection<String> getFlexToolNames() {
+        return tools.keySet();
+    }
+
+    @Override
+    public FlexTool getFlexTool(String toolName) {
+        return tools.get(toolName);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c2f634d/compiler/build.xml
----------------------------------------------------------------------
diff --git a/compiler/build.xml b/compiler/build.xml
index 13d1ce8..7c0172e 100644
--- a/compiler/build.xml
+++ b/compiler/build.xml
@@ -605,7 +605,7 @@
                 <attribute name="Implementation-Title" value="${manifest.Implementation-Title}"/>
                 <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/>
                 <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
-                <attribute name="Class-Path" value="external/antlr.jar external/commons-cli.jar
external/commons-io.jar external/guava.jar external/lzma-sdk.jar .."/>
+                <attribute name="Class-Path" value="external/antlr.jar external/commons-cli.jar
external/commons-io.jar external/guava.jar external/lzma-sdk.jar external/flex-tool-api.jar
.."/>
                 <!-- The .. in the line above allows the compiler to load the env.properties
file -->
             </manifest>
         </jar>


Mime
View raw message