You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2014/11/10 10:16:04 UTC

git commit: [flex-sdk] [refs/heads/feature/flex-tool-api] - Changed the tool classes to implement the flex-tool-api interfaces

Repository: flex-sdk
Updated Branches:
  refs/heads/feature/flex-tool-api [created] ee16e8bc3


Changed the tool classes to implement the flex-tool-api interfaces


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

Branch: refs/heads/feature/flex-tool-api
Commit: ee16e8bc36ea1a918cdf9b0e23183d1eb814e0b9
Parents: e7e441d
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Mon Nov 10 10:15:45 2014 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Mon Nov 10 10:15:45 2014 +0100

----------------------------------------------------------------------
 build.xml                                       |  1 +
 modules/compiler/build.xml                      |  9 ++++++--
 .../compiler/src/java/flex2/tools/ASDoc.java    | 15 ++++++++++++-
 .../compiler/src/java/flex2/tools/Compc.java    | 14 +++++++++++-
 .../compiler/src/java/flex2/tools/Mxmlc.java    | 14 +++++++++++-
 .../src/java/flex2/tools/Optimizer.java         | 17 +++++++++++++--
 modules/downloads.xml                           | 23 ++++++++++++++++++--
 7 files changed, 84 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ee16e8bc/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 8acac59..e82c1f6 100644
--- a/build.xml
+++ b/build.xml
@@ -1038,6 +1038,7 @@ There are no known issues.
                 <include name="swfutils.jar"/>
                 <include name="fxgutils.jar"/>
                 <include name="velocity-dep-1.4-flex.jar"/>
+                <include name="flex-tool-api.jar"/>
                 <exclude name="external/optional/**"/>
             </fileset>
         </copy>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ee16e8bc/modules/compiler/build.xml
----------------------------------------------------------------------
diff --git a/modules/compiler/build.xml b/modules/compiler/build.xml
index 1948f90..561711b 100644
--- a/modules/compiler/build.xml
+++ b/modules/compiler/build.xml
@@ -32,6 +32,8 @@
     <property name="lib.ext.dir" value="${lib.dir}/external"/>      
     <property name="lib.opt.dir" value="${lib.ext.dir}/optional"/>
 
+    <property name="lib.in.dir" value="${FLEX_HOME}/in"/>
+
     <property name="ext.dir" value="external"/>      
     <property name="opt.dir" value="${ext.dir}/optional"/>
 
@@ -57,7 +59,7 @@
     
 	<!-- Including Adobe proprietary font and license code.  -->
 	<property name="mxmlc.mpl_excludes.classpath" value="${opt.dir}/afe.jar ${opt.dir}/aglj40.jar ${opt.dir}/rideau.jar ${opt.dir}/flex-fontkit.jar "/>
-    <property name="mxmlc.adobe.classpath" value="${mxmlc.mpl_excludes.classpath} asc.jar ${ext.dir}/xml-apis.jar batik-all-flex.jar velocity-dep-1.4-flex.jar ${ext.dir}/commons-collections.jar ${ext.dir}/commons-discovery.jar ${ext.dir}/commons-logging.jar swfutils.jar fxgutils.jar ${opt.dir}/flex-messaging-common.jar ${localized.mxmlc.jars} ${ext.dir}/xalan.jar"/>
+    <property name="mxmlc.adobe.classpath" value="${mxmlc.mpl_excludes.classpath} asc.jar ${ext.dir}/xml-apis.jar batik-all-flex.jar velocity-dep-1.4-flex.jar ${ext.dir}/commons-collections.jar ${ext.dir}/commons-discovery.jar ${ext.dir}/commons-logging.jar swfutils.jar fxgutils.jar ${opt.dir}/flex-messaging-common.jar ${localized.mxmlc.jars} ${ext.dir}/xalan.jar flex-tool-api.jar"/>
     <property name="mxmlc.classpath" value="${mxmlc.adobe.classpath} ${ext.dir}/xml-apis-ext.jar ${env.property.dir}"/>
     
 	<property name="compc.main" value="flex2.tools.Compc"/>
@@ -165,7 +167,10 @@
         <copy file="${FLEX_HOME}/LICENSE" todir="${module.classes}/META-INF"/>
         <copy file="${FLEX_HOME}/NOTICE" todir="${module.classes}/META-INF"/>
 
-		<echo message="Building lib/mxmlc.jar"/>
+        <!-- Copy the flex-tool-api jar -->
+        <copy file="${lib.in.dir}/flex-tool-api.jar" todir="${lib.dir}"/>
+
+        <echo message="Building lib/mxmlc.jar"/>
         <jar file="${module.jar}" basedir="${module.classes}"
             includes="**/*.properties,flex2/compiler/**/*,flex2/license/**/*,flex2/linker/**/*,flex2/tools/*,flex2/tools/oem/Message.class,flex2/tools/oem/ProgressMeter.class,flex2/tools/oem/Component.class,flex2/tools/oem/Script.class,flash/**/*,flex/**/*"
             excludes="flex2/tools/Shell*,flex2/tools/Optimizer*,flex2/tools/Digest*,flex2/tools/SwcDependencies*">

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ee16e8bc/modules/compiler/src/java/flex2/tools/ASDoc.java
----------------------------------------------------------------------
diff --git a/modules/compiler/src/java/flex2/tools/ASDoc.java b/modules/compiler/src/java/flex2/tools/ASDoc.java
index a79a7de..a8c5fde 100644
--- a/modules/compiler/src/java/flex2/tools/ASDoc.java
+++ b/modules/compiler/src/java/flex2/tools/ASDoc.java
@@ -29,6 +29,7 @@ import flash.localization.LocalizationManager;
 import flash.localization.XLRLocalizer;
 import flash.localization.ResourceBundleLocalizer;
 import flash.util.Trace;
+import org.apache.flex.tools.FlexTool;
 
 /**
  * The entry-point for ASDoc.
@@ -36,8 +37,20 @@ import flash.util.Trace;
  * @see flex2.compiler.asdoc.AsDocAPI
  * @author Brian Deitte
  */
-public class ASDoc extends Tool
+public class ASDoc extends Tool implements FlexTool
 {
+
+    @Override
+    public String getName() {
+        return "ASDOC";
+    }
+
+    @Override
+    public int execute(String[] args) {
+        ASDoc.asdoc(args);
+        return 0;
+    }
+
     public static void main(String[] args)
     {
 	    asdoc(args);

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ee16e8bc/modules/compiler/src/java/flex2/tools/Compc.java
----------------------------------------------------------------------
diff --git a/modules/compiler/src/java/flex2/tools/Compc.java b/modules/compiler/src/java/flex2/tools/Compc.java
index 8175f08..9591850 100644
--- a/modules/compiler/src/java/flex2/tools/Compc.java
+++ b/modules/compiler/src/java/flex2/tools/Compc.java
@@ -36,6 +36,7 @@ import flash.localization.LocalizationManager;
 import flash.localization.XLRLocalizer;
 import flash.localization.ResourceBundleLocalizer;
 import flash.util.Trace;
+import org.apache.flex.tools.FlexTool;
 
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -48,8 +49,19 @@ import java.util.*;
  *
  * @author Brian Deitte
  */
-public class Compc extends Tool
+public class Compc extends Tool implements FlexTool
 {
+    @Override
+    public String getName() {
+        return "COMPC";
+    }
+
+    @Override
+    public int execute(String[] args) {
+        compc(args);
+        return ThreadLocalToolkit.errorCount();
+    }
+
     public static void main(String[] args)
     {
         compc(args);

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ee16e8bc/modules/compiler/src/java/flex2/tools/Mxmlc.java
----------------------------------------------------------------------
diff --git a/modules/compiler/src/java/flex2/tools/Mxmlc.java b/modules/compiler/src/java/flex2/tools/Mxmlc.java
index dfec3e9..0854d1b 100644
--- a/modules/compiler/src/java/flex2/tools/Mxmlc.java
+++ b/modules/compiler/src/java/flex2/tools/Mxmlc.java
@@ -41,6 +41,7 @@ import flex2.compiler.util.ThreadLocalToolkit;
 import flex2.linker.ConsoleApplication;
 import flex2.linker.LinkerAPI;
 import flex2.linker.LinkerException;
+import org.apache.flex.tools.FlexTool;
 
 import java.io.*;
 import java.util.*;
@@ -53,10 +54,21 @@ import java.util.Map.Entry;
  *
  * @author Clement Wong
  */
-public final class Mxmlc extends Tool
+public final class Mxmlc extends Tool implements FlexTool
 {
     public static final String FILE_SPECS = "file-specs";
 
+    @Override
+    public String getName() {
+        return "MXMLC";
+    }
+
+    @Override
+    public int execute(String[] args) {
+        mxmlc(args);
+        return ThreadLocalToolkit.errorCount();
+    }
+
     /**
      * The entry-point for Mxmlc.
      * Note that if you change anything in this method, make sure to check Compc, Shell, and

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ee16e8bc/modules/compiler/src/java/flex2/tools/Optimizer.java
----------------------------------------------------------------------
diff --git a/modules/compiler/src/java/flex2/tools/Optimizer.java b/modules/compiler/src/java/flex2/tools/Optimizer.java
index d81787e..0a7f679 100644
--- a/modules/compiler/src/java/flex2/tools/Optimizer.java
+++ b/modules/compiler/src/java/flex2/tools/Optimizer.java
@@ -45,15 +45,28 @@ import flex2.compiler.config.ConfigurationValue;
 import flex2.compiler.io.FileUtil;
 import flex2.compiler.util.CompilerMessage;
 import flex2.compiler.util.ThreadLocalToolkit;
+import org.apache.flex.tools.FlexTool;
 
 /**
  * The post-link optimizer as a command-line tool...
  * 
  * @author Clement Wong
  */
-public class Optimizer
+public class Optimizer implements FlexTool
 {
-	public static void main(String[] args)
+
+    @Override
+    public String getName() {
+        return "OPTIMIZER";
+    }
+
+    @Override
+    public int execute(String[] args) {
+        main(args);
+        return 0;
+    }
+
+    public static void main(String[] args)
 	{
         flex2.compiler.CompilerAPI.useAS3();
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ee16e8bc/modules/downloads.xml
----------------------------------------------------------------------
diff --git a/modules/downloads.xml b/modules/downloads.xml
index 9275fc2..7c707e5 100644
--- a/modules/downloads.xml
+++ b/modules/downloads.xml
@@ -82,7 +82,7 @@
         they are each downloaded only if they don't already exist. 
     -->
     
-	<target name="main" depends="batik-jars, commons-jars, javacc-jar, saxon9-jar, velocity-jars, xalan-jar, xerces-jars" 
+	<target name="main" depends="batik-jars, commons-jars, javacc-jar, saxon9-jar, velocity-jars, xalan-jar, xerces-jars, flex-tool-api-jar"
 		description="Downloads all the required thirdparty JARs"/>
 
     <!--
@@ -559,5 +559,24 @@
             <globmapper from="*" to="xerces-LICENSE/*"/>
         </copy>
         <delete dir="${download.dir}/${xerces.dir}"/>
-    </target>    
+    </target>
+
+    <!--
+        flex-tool-api
+    -->
+
+    <target name="flex-tool-api-jar-check" description="Checks if flex-tool-api.jar is in lib directory.">
+        <available file="${lib.ext.dir}/flex-tool-api.jar" property="flexToolApi.jar.exists"/>
+    </target>
+
+    <target name="flex-tool-api-jar" depends="flex-tool-api-jar-check" unless="flexToolApi.jar.exists"
+            description="Downloads and copies flex-tool-api.jar to the lib directory.">
+
+        <get src="http://repository.apache.org/content/groups/snapshots/org/apache/flex/flex-tool-api/1.0.0-SNAPSHOT/flex-tool-api-1.0.0-20141105.140704-1.jar"
+             dest="${download.dir}/flex-tool-api.jar"
+             verbose="false"/>
+
+        <copy file="${download.dir}/flex-tool-api.jar" toDir="${lib.ext.dir}" verbose="true"/>
+    </target>
+
 </project>


Re: git commit: [flex-sdk] [refs/heads/feature/flex-tool-api] - Changed the tool classes to implement the flex-tool-api interfaces

Posted by Alex Harui <ah...@adobe.com>.

On 11/10/14, 1:16 AM, "cdutz@apache.org" <cd...@apache.org> wrote:

>+    <target name="flex-tool-api-jar" depends="flex-tool-api-jar-check"
>unless="flexToolApi.jar.exists"
>+            description="Downloads and copies flex-tool-api.jar to the
>lib directory.">
>+
>+        <get 
>src="http://repository.apache.org/content/groups/snapshots/org/apache/flex
>/flex-tool-api/1.0.0-SNAPSHOT/flex-tool-api-1.0.0-20141105.140704-1.jar"
>+             dest="${download.dir}/flex-tool-api.jar"
>+             verbose="false"/>
>+
>+        <copy file="${download.dir}/flex-tool-api.jar"
>toDir="${lib.ext.dir}" verbose="true"/>
>+    </target>
>+

Chris, should to toDir be lib.in.dir?  And why not just download the jar
to the lib folder and skip all of these intermediate folders?

Also check the “clean” targets to make sure they get rid of the jar in the
right scenarios.

-Alex


Re: git commit: [flex-sdk] [refs/heads/feature/flex-tool-api] - Changed the tool classes to implement the flex-tool-api interfaces

Posted by Alex Harui <ah...@adobe.com>.

On 11/10/14, 1:16 AM, "cdutz@apache.org" <cd...@apache.org> wrote:

>+    <target name="flex-tool-api-jar" depends="flex-tool-api-jar-check"
>unless="flexToolApi.jar.exists"
>+            description="Downloads and copies flex-tool-api.jar to the
>lib directory.">
>+
>+        <get 
>src="http://repository.apache.org/content/groups/snapshots/org/apache/flex
>/flex-tool-api/1.0.0-SNAPSHOT/flex-tool-api-1.0.0-20141105.140704-1.jar"
>+             dest="${download.dir}/flex-tool-api.jar"
>+             verbose="false"/>
>+
>+        <copy file="${download.dir}/flex-tool-api.jar"
>toDir="${lib.ext.dir}" verbose="true"/>
>+    </target>
>+

Chris, should to toDir be lib.in.dir?  And why not just download the jar
to the lib folder and skip all of these intermediate folders?

Also check the “clean” targets to make sure they get rid of the jar in the
right scenarios.

-Alex