royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [royale-asjs.wiki] branch master updated: Added ant typedef script
Date Thu, 19 Oct 2017 13:09:19 GMT
This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-asjs.wiki.git


The following commit(s) were added to refs/heads/master by this push:
     new fb5238a  Added ant typedef script
fb5238a is described below

commit fb5238a0f5840a003f9b8795b0c030e031edf4e8
Author: Harbs <harbs@in-tools.com>
AuthorDate: Thu Oct 19 16:09:15 2017 +0300

    Added ant typedef script
---
 build-scripts.md       |   2 +-
 typedef-ant.md         | 121 +++++++++++++++++++++++++++++++++++++++++++++++++
 typedef-config-file.md |  28 ++++++++++++
 3 files changed, 150 insertions(+), 1 deletion(-)

diff --git a/build-scripts.md b/build-scripts.md
index 938a5e0..6c41a83 100644
--- a/build-scripts.md
+++ b/build-scripts.md
@@ -10,7 +10,7 @@ Here's a collection of sample scripts which can be used as a starting point
for
 ### Ant Scripts
 - Application Script
 - Library Script
-- Typedef Script
+- [Typedef Script](typedef-ant)
 
 ### Maven
 - Maven experts??
diff --git a/typedef-ant.md b/typedef-ant.md
new file mode 100644
index 0000000..1bfe806
--- /dev/null
+++ b/typedef-ant.md
@@ -0,0 +1,121 @@
+## Sample Ant Script for Generating Typedef SWC files
+
+To use this script, you need the following:
+
+1. A project with a structure as follows:
+- src
+  - com
+    - acme
+      - etc
+  - main
+    - config
+      - compile-as-config.xml
+2. Create the `compile-as-config.xml` using the [provided template](typedef-config-file).
+3. Create the `build.xml` file at the root of your project.
+4. Replace `PROJECT_NAME` with the name of your project.
+
+`build.xml`
+
+    <?xml version="1.0" ?>
+    <project name="PROJECT_NAME" default="main" basedir=".">
+        <property environment="env"/>
+        <condition property="ROYALE_HOME" value="${env.ROYALE_HOME}">
+            <and>
+                <not>
+                    <isset property="ROYALE_HOME" />
+                </not>
+                <available file="${env.ROYALE_HOME}/royale-sdk-description.xml" type="file"
/>
+            </and>
+        </condition>
+        <condition property="ROYALE_HOME" value="/FlexSDK/FlexJSNightly">
+            <not>
+                <isset property="ROYALE_HOME" />
+            </not>
+        </condition>
+        
+        <!-- <property name="ROYALE_HOME" value="${basedir}/.." /> -->
+        
+        <condition property="FALCON_HOME" value="${env.FALCON_HOME}">
+            <and>
+                <not>
+                    <isset property="FALCON_HOME" />
+                </not>
+                <available file="${env.FALCON_HOME}/lib/compiler-mxmlc.jar" type="file"
/>
+            </and>
+        </condition>
+        
+        <condition property="FALCON_HOME" value="${ROYALE_HOME}/../royale-compiler/compiler">
+            <and>
+                <not>
+                    <isset property="FALCON_HOME" />
+                </not>
+                <available file="${ROYALE_HOME}/../royale-compiler/compiler/lib/compiler-mxmlc.jar"
type="file" />
+            </and>
+        </condition>
+        
+        <condition property="FALCON_HOME" value="${ROYALE_HOME}">
+            <and>
+                <not>
+                    <isset property="FALCON_HOME" />
+                </not>
+                <available file="${ROYALE_HOME}/lib/compiler-mxmlc.jar" type="file" />
+            </and>
+        </condition>
+        
+        <condition property="FALCONJX_HOME" value="${env.FALCONJX_HOME}">
+            <and>
+                <not>
+                    <isset property="FALCONJX_HOME" />
+                </not>
+                <available file="${env.FALCONJX_HOME}/lib/jsc.jar" type="file" />
+            </and>
+        </condition>
+        
+        <condition property="FALCONJX_HOME" value="${ROYALE_HOME}/js">
+            <and>
+                <not>
+                    <isset property="FALCONJX_HOME" />
+                </not>
+                <available file="${ROYALE_HOME}/js/lib/jsc.jar" type="file" />
+            </and>
+        </condition>
+        
+        <condition property="FALCONJX_HOME" value="${ROYALE_HOME}/../royale-compiler/compiler-jx">
+            <and>
+                <not>
+                    <isset property="FALCONJX_HOME" />
+                </not>
+                <available file="${ROYALE_HOME}/../royale-compiler/compiler-jx/lib/jsc.jar"
type="file" />
+            </and>
+        </condition>
+        
+        <target name="main" depends="clean, preprocess, externc, postprocess, compc" />
+
+        <!-- we need to insert a line near the beginning of the file to make the
+            compiler happy. -->
+        <target name="preprocess">
+        </target>
+        
+        <target name="externc" >
+        </target>
+        
+        <target name="postprocess" >
+        </target>
+        
+        <target name="compc" >
+            <copy file="${basedir}/src/main/config/compile-as-config.xml" todir="${basedir}/target"
/>
+            <java jar="${FALCON_HOME}/lib/compiler-compc.jar" fork="true"
+                failonerror="true">
+                <arg value="+royalelib=externs/frameworks" />
+                <arg value="-debug" />
+                <arg value="-load-config=${basedir}/src/main/config/compile-as-config.xml"
/>
+                <arg value="-output=${basedir}/target/${ant.project.name}.swc" />
+            </java>
+        </target>
+        
+        <target name="clean">
+            <delete dir="${basedir}/target" failonerror="false" includeEmptyDirs="true"/>
+        </target>
+        <target name="wipe" depends="clean">
+        </target>
+    </project>
\ No newline at end of file
diff --git a/typedef-config-file.md b/typedef-config-file.md
new file mode 100644
index 0000000..1d2ced5
--- /dev/null
+++ b/typedef-config-file.md
@@ -0,0 +1,28 @@
+## Sample Config File for Typdefs
+
+To use this file:
+
+1. Create a new file: `src/main/config/compile-as-config.xml`.
+2. Copy and paste the XML below.
+3. Replace `PATH_TO_AIR_GLOBAL` with the correct path on your system.
+4. If you have dependencies on Royale components, uncomment and specify the correct SWCs
with the correct paths.
+
+`compile-as-config.xml`
+
+    <royale-config>
+        <compiler>
+            <accessible>true</accessible>
+            <external-library-path>
+                <path-element>PATH_TO_AIR_GLOBAL/airglobal.swc</path-element>
+                <!-- <path-element>PATH_TO_SDK/frameworks/libs/Core.swc</path-element>
-->
+                <!-- <path-element>/PATH_TO_SDK/frameworks/libs/Network.swc</path-element>
-->
+            </external-library-path>
+            <source-path>
+                <path-element>../../</path-element>
+            </source-path>
+            <warn-no-constructor>false</warn-no-constructor>
+        </compiler>
+        <include-sources>
+            <path-element>../../</path-element>
+        </include-sources>
+    </royale-config>

-- 
To stop receiving notification emails like this one, please contact
['"commits@royale.apache.org" <commits@royale.apache.org>'].

Mime
View raw message