flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [04/34] git commit: [flex-asjs] [refs/heads/develop] - add 'Main.as' from flex-falcon as example for using js.swc
Date Mon, 24 Aug 2015 05:32:54 GMT
add 'Main.as' from flex-falcon as example for using js.swc


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

Branch: refs/heads/develop
Commit: 3b2339a57f1e8141460006c704722be2614ae4bb
Parents: e5858c5
Author: Alex Harui <aharui@apache.org>
Authored: Sat Aug 22 23:24:08 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Sun Aug 23 07:13:36 2015 -0700

----------------------------------------------------------------------
 examples/native/ButtonExample/build.xml         | 118 +++++++++++++++++++
 .../native/ButtonExample/src/ButtonExample.as   |  34 ++++++
 2 files changed, 152 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b2339a5/examples/native/ButtonExample/build.xml
----------------------------------------------------------------------
diff --git a/examples/native/ButtonExample/build.xml b/examples/native/ButtonExample/build.xml
new file mode 100644
index 0000000..7c4b49d
--- /dev/null
+++ b/examples/native/ButtonExample/build.xml
@@ -0,0 +1,118 @@
+<?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="native buttonexample" default="main" basedir=".">
+    <property name="FLEXJS_HOME" location="../../.."/>
+    <property name="example" value="ButtonExample" />
+    
+    <property file="${FLEXJS_HOME}/env.properties"/>
+    <property environment="env"/>
+    <property file="${FLEXJS_HOME}/build.properties"/>
+    <property name="FLEX_HOME" value="${FLEXJS_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/generated/dist/sdk/lib/falcon-mxmlc.jar"
+        type="file"
+        property="FALCON_HOME"
+        value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/>
+        
+    <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"/>
+        
+    <available file="${env.GOOG_HOME}/closure/goog/base.js"
+        type="file"
+        property="GOOG_HOME"
+        value="${env.GOOG_HOME}"/>
+        
+    <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js"
+        type="file"
+        property="GOOG_HOME"
+        value="${FLEXJS_HOME}/js/lib/google/closure-library"/>
+
+    <available file="${FLEXJS_HOME}/js/libs/js.swc"
+        type="file"
+        property="JS.SWC"
+        value="${FLEXJS_HOME}/js/libs/js.swc" />
+        
+    <available file="${FALCONJX_HOME}/../externs/js/out/bin/js.swc"
+        type="file"
+        property="JS.SWC"
+        value="${FALCONJX_HOME}/../externs/js/out/bin/js.swc" />
+        
+    <path id="lib.path">
+        <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+    </path>
+
+    <target name="main" depends="clean,build" description="Clean build of ${example}">
+    </target>
+    
+    <target name="build">
+        <java jar="${FALCONJX_HOME}/lib/mxmlc.jar" resultProperty="errorCode"
+            fork="true">
+            <jvmarg line="${mxmlc.jvm.args}"/>
+            <jvmarg line="-Dflexlib=${FLEXJS_HOME}/frameworks}"/>
+            <arg value="+flexlib=${FLEXJS_HOME}/frameworks" />
+            <arg value="-debug" />
+            <arg value="-define=CONFIG::as_only,false" />
+            <arg value="-define=CONFIG::js_only,true" />
+            <arg value="-external-library-path=${JS.SWC}" />
+            <arg value="-compiler.mxml.children-as-data" />
+            <arg value="-compiler.binding-value-change-event=org.apache.flex.events.ValueChangeEvent"
/>
+            <arg value="-compiler.binding-value-change-event-kind=org.apache.flex.events.ValueChangeEvent"
/>
+            <arg value="-compiler.binding-value-change-event-type=valueChange" />
+            <arg value="+playerglobal.version=${playerglobal.version}" />
+            <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+            <arg value="-js-output-type=FLEXJS" />
+            <arg value="-closure-lib=${GOOG_HOME}" />
+            <arg value="-sdk-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
+            <arg value="${basedir}/src/${example}.as" />
+        </java>
+        <fail>
+            <condition>
+                <not>
+                    <or>
+                        <equals arg1="${errorCode}" arg2="0" />
+                        <equals arg1="${errorCode}" arg2="2" />
+                    </or>
+                </not>
+            </condition>
+        </fail>        
+    </target>
+    
+    <target name="clean">
+        <delete dir="${basedir}/bin" failonerror="false" />
+        <delete dir="${basedir}/bin-debug" failonerror="false" />
+        <delete dir="${basedir}/bin-release" failonerror="false" />
+    </target>
+
+    
+    
+</project>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b2339a5/examples/native/ButtonExample/src/ButtonExample.as
----------------------------------------------------------------------
diff --git a/examples/native/ButtonExample/src/ButtonExample.as b/examples/native/ButtonExample/src/ButtonExample.as
new file mode 100644
index 0000000..a3772e9
--- /dev/null
+++ b/examples/native/ButtonExample/src/ButtonExample.as
@@ -0,0 +1,34 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+package
+{
+public class ButtonExample
+{
+	public function start():void
+	{
+		var button:Element = document.createElement("button");
+        button.onclick = function ():void {
+            alert("Hello browser from FalconJX!");
+        };
+        button.textContent = "Say Hello";
+        document.body.appendChild(button);
+	}
+}
+}
\ No newline at end of file


Mime
View raw message