flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [50/51] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - first attempt at build file for MXJS
Date Thu, 26 May 2016 23:05:34 GMT
first attempt at build file for MXJS


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

Branch: refs/heads/spark
Commit: 89bc26cba2ac5d1fc01cf5d8edf1db5c39c29614
Parents: c8ddd96
Author: Alex Harui <aharui@apache.org>
Authored: Thu May 26 15:42:22 2016 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu May 26 16:04:24 2016 -0700

----------------------------------------------------------------------
 frameworks/js/FlexJS/projects/MXJS/build.xml | 163 ++++++++++++++++++++++
 1 file changed, 163 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/89bc26cb/frameworks/js/FlexJS/projects/MXJS/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/MXJS/build.xml b/frameworks/js/FlexJS/projects/MXJS/build.xml
new file mode 100644
index 0000000..e89c7f6
--- /dev/null
+++ b/frameworks/js/FlexJS/projects/MXJS/build.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+
+<project name="MXJS" default="main" basedir=".">
+    <property name="FLEXJS_HOME" location="../../../../.."/>
+    
+    <property file="${FLEXJS_HOME}/env.properties"/>
+    <property environment="env"/>
+    <property file="${FLEXJS_HOME}/build.properties"/>
+    <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+    
+    <property name="target.name" value="${ant.project.name}.swc" />
+    
+    <target name="main" depends="clean,check-compiler,compile-js-swc,compile-asjs,copy-js"
description="Full build of ${ant.project.name}.swc">
+    </target>
+    
+    <target name="clean">
+        <delete failonerror="false">
+            <fileset dir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs">
+                <include name="${target.name}"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false" includeemptydirs="true">
+            <fileset dir="${basedir}/target">
+                <include name="**/**"/>
+            </fileset>
+        </delete>
+    </target>
+    
+    <target name="compile-asjs" depends="check-compiler">
+        <echo message="Cross-compiling ${target.name}"/>
+        <echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
+        <mkdir dir="${basedir}/target/generated-sources/flexjs"/>
+        <java jar="${FALCONJX_HOME}/lib/compc.jar" fork="true" >
+            <jvmarg value="-Xmx384m" />
+            <jvmarg value="-Dsun.io.useCanonCaches=false" />
+            <jvmarg value="-Dflexcompiler=${FALCONJX_HOME}/../compiler" />
+            <jvmarg value="-Dflexlib=${FLEXJS_HOME}/frameworks" />
+            <arg value="+flexlib=${FLEX_HOME}/frameworks" />
+            <arg value="-js-output-type=FLEXJS" />
+            <arg value="-compiler.strict-xml=true" />
+            <arg value="-keep-asdoc" /><!-- allows compiler to see @flexjsignorecoercion
annotations -->
+            <arg value="-output=${basedir}/target/generated-sources/flexjs" />
+            <arg value="-load-config=${basedir}/src/main/config/compile-js-config.xml"
/>
+            <arg value="+playerglobal.version=${playerglobal.version}" />
+            <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+            <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
+            <arg value="-external-library-path+=${JS.SWC}" />
+            <!-- this is not on external-library path otherwise goog.requires are not
generated -->
+            <arg value="-library-path+=${GCL.SWC}" />
+            <arg value="-define=COMPILE::AS3,false" />
+            <arg value="-define=COMPILE::JS,true" />
+            <arg value="-define=COMPILE::LATER,false" />
+            <arg value="-define=CONFIG::performanceInstrumentation,false" />
+        </java>
+    </target>
+    
+    <target name="compile-js-swc" description="Compiles .as files into .swc used for cross-compiling
other projects">
+        <echo message="Compiling target/${target.name}"/>
+        <echo message="FLEX_HOME: ${FLEX_HOME}"/>
+        <echo message="FALCON_HOME: ${FALCON_HOME}"/>
+        <mkdir dir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs"/>
+        <mkdir dir="${basedir}/target"/>
+        
+        <compc fork="true"
+            output="${basedir}/target/${target.name}">
+            <jvmarg line="${compc.jvm.args}"/>
+            <load-config filename="src/main/config/compile-js-config.xml" />
+            <arg value="+playerglobal.version=${playerglobal.version}" />
+            <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
+            <arg value="-compiler.strict-xml=true" />
+            <arg value="-external-library-path=${JS.SWC}" />
+            <!-- this is not on external-library path otherwise goog.requires are not
generated -->
+            <arg value="-library-path+=${GCL.SWC}" />
+            <arg value="-define=COMPILE::AS3,false" />
+            <arg value="-define=COMPILE::JS,true" />
+            <arg value="-define=COMPILE::LATER,false" />
+            <arg value="-define=CONFIG::performanceInstrumentation,false" />
+        </compc>
+        <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/js/FlexJS/libs/${target.name}"
/>
+    </target>
+    
+    <target name="copy-js" >
+        <mkdir dir="${FLEXJS_HOME}/frameworks/js/FlexJS/generated-sources"/>
+        <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/generated-sources">
+            <fileset dir="${basedir}/target/generated-sources/flexjs">
+                <include name="**/**" />
+            </fileset>
+        </copy>
+    </target>
+    
+    <target name="check-compiler" depends="check-falcon-home, check-falconjx-home">
+        <condition property="JS.SWC" value="${FALCONJX_HOME}/../js/libs/js.swc" >
+            <available file="${FALCONJX_HOME}/../js/libs/js.swc" />
+        </condition>
+        <property name="JS.SWC" value="${FALCONJX_HOME}/../externs/js/target/js.swc" />
+        <condition property="GCL.SWC" value="${FALCONJX_HOME}/../js/libs/GCL.swc" >
+            <available file="${FALCONJX_HOME}/../js/libs/GCL.swc" />
+        </condition>
+        <property name="GCL.SWC" value="${FALCONJX_HOME}/../externs/GCL/target/GCL.swc"
/>
+        <path id="lib.path">
+            <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+        </path>
+        <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+    </target>
+    
+    <target name="check-falcon-home" unless="FALCON_HOME"
+        description="Check FALCON_HOME is a directory.">
+        
+        <echo message="FALCON_HOME is ${env.FALCON_HOME}"/>
+        
+        <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar"
+        type="file"
+        property="FALCON_HOME"
+        value="${env.FALCON_HOME}"/>
+        
+        <available file="${FLEXJS_HOME}/../flex-falcon/compiler/lib/falcon-mxmlc.jar"
+        type="file"
+        property="FALCON_HOME"
+        value="${FLEXJS_HOME}/../flex-falcon/compiler"/>
+        
+        <fail message="FALCON_HOME must be set to a folder with a lib sub-folder containing
falcon-mxmlc.jar such as the compiler folder in flex-falcon repo or a FlexJS SDK folder"
+        unless="FALCON_HOME"/>
+    </target>
+    
+    <target name="check-falconjx-home" unless="FALCONJX_HOME"
+        description="Check FALCON_HOME is a directory.">
+        
+        <echo message="FALCONJX_HOME is ${env.FALCONJX_HOME}"/>
+        
+        <available file="${env.FALCONJX_HOME}/lib/jsc.jar"
+        type="file"
+        property="FALCONJX_HOME"
+        value="${env.FALCONJX_HOME}"/>
+        
+        <available file="${FLEXJS_HOME}/../flex-falcon/compiler-jx/lib/jsc.jar"
+        type="file"
+        property="FALCONJX_HOME"
+        value="${FLEXJS_HOME}/../flex-falcon/compiler-jx"/>
+        
+        <fail message="FALCONJX_HOME must be set to a folder with a lib sub-folder containing
jsc.jar such as the compiler-jx folder in flex-falcon repo or the js folder of a FlexJS SDK"
+        unless="FALCONJX_HOME"/>
+    </target>
+    
+</project>


Mime
View raw message