flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject git commit: [flex-falcon] [refs/heads/feature/flex-tool-api] - - Made Falcon implement the flex-tool-api
Date Mon, 10 Nov 2014 09:25:39 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/feature/flex-tool-api [created] 7923ce9d7


- Made Falcon implement the flex-tool-api


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

Branch: refs/heads/feature/flex-tool-api
Commit: 7923ce9d7aa590380f0606ed4e1df15592db0543
Parents: 3011d63
Author: Christofer Dutz <christofer.dutz@codecentric.de>
Authored: Mon Nov 10 10:25:28 2014 +0100
Committer: Christofer Dutz <christofer.dutz@codecentric.de>
Committed: Mon Nov 10 10:25:28 2014 +0100

----------------------------------------------------------------------
 compiler/downloads.xml                          | 14 +++++++
 .../org.apache.flex.tools.FlexToolGroup         |  1 +
 .../org/apache/flex/compiler/clients/COMPC.java | 15 +++++++-
 .../flex/compiler/clients/FalconToolGroup.java  | 39 ++++++++++++++++++++
 .../org/apache/flex/compiler/clients/MXMLC.java | 16 +++++++-
 .../apache/flex/compiler/clients/Optimizer.java | 12 +++++-
 6 files changed, 92 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7923ce9d/compiler/downloads.xml
----------------------------------------------------------------------
diff --git a/compiler/downloads.xml b/compiler/downloads.xml
index 28f1fd9..60b7f07 100644
--- a/compiler/downloads.xml
+++ b/compiler/downloads.xml
@@ -216,6 +216,20 @@
       <param name="dest.filename" value="${lzma.name}-sdk.jar"/>
       <param name="license.use.url" value="http://www.7-zip.org/sdk.html"/>
     </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>
 
   <target name="maven-related" description="Downloads and copies all dependencies to the
lib directory.">

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7923ce9d/compiler/src/META-INF/services/org.apache.flex.tools.FlexToolGroup
----------------------------------------------------------------------
diff --git a/compiler/src/META-INF/services/org.apache.flex.tools.FlexToolGroup b/compiler/src/META-INF/services/org.apache.flex.tools.FlexToolGroup
new file mode 100644
index 0000000..1a8af6d
--- /dev/null
+++ b/compiler/src/META-INF/services/org.apache.flex.tools.FlexToolGroup
@@ -0,0 +1 @@
+org.apache.flex.compiler.clients.FalconToolGroup
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7923ce9d/compiler/src/org/apache/flex/compiler/clients/COMPC.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/clients/COMPC.java b/compiler/src/org/apache/flex/compiler/clients/COMPC.java
index 6216855..af55eac 100644
--- a/compiler/src/org/apache/flex/compiler/clients/COMPC.java
+++ b/compiler/src/org/apache/flex/compiler/clients/COMPC.java
@@ -43,6 +43,7 @@ import org.apache.flex.swc.io.ISWCWriter;
 import org.apache.flex.swc.io.SWCDirectoryWriter;
 import org.apache.flex.swc.io.SWCWriter;
 import org.apache.flex.swf.io.SizeReportWritingSWFWriter;
+import org.apache.flex.tools.FlexTool;
 import org.apache.flex.utils.FilenameNormalization;
 
 /**
@@ -51,7 +52,7 @@ import org.apache.flex.utils.FilenameNormalization;
  * This class is a quick start of component compiler. It depends on most of the
  * functionalities developed for mxmlc.
  */
-public class COMPC extends MXMLC
+public class COMPC extends MXMLC implements FlexTool
 {
     /**
      * Entry point for <code>compc</code> tool.
@@ -75,7 +76,17 @@ public class COMPC extends MXMLC
         final COMPC compc = new COMPC();
         return compc.mainNoExit(args);
     }
-    
+
+    @Override
+    public String getName() {
+        return "COMPC";
+    }
+
+    @Override
+    public int execute(String[] args) {
+        return mainNoExit(args);
+    }
+
     /**
      * Console message describing the size and location of the created 
      * SWC file.

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7923ce9d/compiler/src/org/apache/flex/compiler/clients/FalconToolGroup.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/clients/FalconToolGroup.java b/compiler/src/org/apache/flex/compiler/clients/FalconToolGroup.java
new file mode 100644
index 0000000..3185155
--- /dev/null
+++ b/compiler/src/org/apache/flex/compiler/clients/FalconToolGroup.java
@@ -0,0 +1,39 @@
+package org.apache.flex.compiler.clients;
+
+import org.apache.flex.tools.FlexTool;
+import org.apache.flex.tools.FlexToolGroup;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * FlexToolGroup exposing the implementations of the Falcon compilers tools.
+ */
+public class FalconToolGroup implements FlexToolGroup {
+
+    Map<String, FlexTool> tools;
+
+    public FalconToolGroup() {
+        tools = new HashMap<String, FlexTool>();
+        tools.put("COMPC", new COMPC());
+        tools.put("MXMLC", new MXMLC());
+        tools.put("OPTIMIZER", new Optimizer());
+    }
+
+    @Override
+    public String getName() {
+        return "Falcon";
+    }
+
+    @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/7923ce9d/compiler/src/org/apache/flex/compiler/clients/MXMLC.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/clients/MXMLC.java b/compiler/src/org/apache/flex/compiler/clients/MXMLC.java
index c10d826..2b7e97b 100644
--- a/compiler/src/org/apache/flex/compiler/clients/MXMLC.java
+++ b/compiler/src/org/apache/flex/compiler/clients/MXMLC.java
@@ -89,6 +89,7 @@ import org.apache.flex.swf.Header;
 import org.apache.flex.swf.ISWF;
 import org.apache.flex.swf.io.ISWFWriter;
 import org.apache.flex.swf.io.SizeReportWritingSWFWriter;
+import org.apache.flex.tools.FlexTool;
 import org.apache.flex.utils.FilenameNormalization;
 
 import com.google.common.base.Function;
@@ -101,7 +102,7 @@ import com.google.common.collect.Lists;
 /**
  * The entry-point class for mxmlc.
  */
-public class MXMLC
+public class MXMLC implements FlexTool
 {
     static final String NEWLINE = System.getProperty("line.separator");
     private static final String SWF_EXT = ".swf";
@@ -173,7 +174,18 @@ public class MXMLC
                code == ExitCode.FAILED_WITH_EXCEPTIONS.getCode() ||
                code == ExitCode.FAILED_WITH_CONFIG_ERRORS.getCode();
     }
-    
+
+    @Override
+    public String getName() {
+        return "MXMLC";
+    }
+
+    @Override
+    public int execute(String[] args) {
+        return mainNoExit(args);
+    }
+
+
     /**
      * Entry point for when you already have an MXMLC instance.
      * This is for unit testing.

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7923ce9d/compiler/src/org/apache/flex/compiler/clients/Optimizer.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/clients/Optimizer.java b/compiler/src/org/apache/flex/compiler/clients/Optimizer.java
index 9fadf6d..1566cf5 100644
--- a/compiler/src/org/apache/flex/compiler/clients/Optimizer.java
+++ b/compiler/src/org/apache/flex/compiler/clients/Optimizer.java
@@ -69,12 +69,13 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.flex.tools.FlexTool;
 
 /**
  * Command line optimizer - can read in a swf, apply the optimizations usually done during
swf linking,
  * and write out the swf again.
  */
-public class Optimizer
+public class Optimizer implements FlexTool
 {
     static final String NEWLINE = System.getProperty("line.separator");
     private static final String DEFAULT_VAR = "input";
@@ -98,6 +99,15 @@ public class Optimizer
         return optimizer.mainNoExit(args);
     }
 
+    @Override
+    public String getName() {
+        return "OPTIMIZER";
+    }
+
+    @Override
+    public int execute(String[] args) {
+        return mainNoExit(args);
+    }
 
     public int mainNoExit(final String[] args)
     {


Mime
View raw message