You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2021/12/20 14:02:05 UTC
[royale-asjs] branch develop updated: Make ExternsJS compile in ant
This is an automated email from the ASF dual-hosted git repository.
harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 19a518d Make ExternsJS compile in ant
19a518d is described below
commit 19a518d75fad238a348602626f3d8251791cb7c3
Author: Harbs <ha...@in-tools.com>
AuthorDate: Mon Dec 20 16:01:41 2021 +0200
Make ExternsJS compile in ant
---
frameworks/js/projects/ExternsJSJS/build.xml | 136 +++++++++++++++++++++
.../src/main/config/compile-js-config.xml | 96 +++++++++++++++
2 files changed, 232 insertions(+)
diff --git a/frameworks/js/projects/ExternsJSJS/build.xml b/frameworks/js/projects/ExternsJSJS/build.xml
new file mode 100644
index 0000000..bb19837
--- /dev/null
+++ b/frameworks/js/projects/ExternsJSJS/build.xml
@@ -0,0 +1,136 @@
+<?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="ExternsJSJS" default="main" basedir=".">
+ <property name="ROYALE_HOME" location="../../../.."/>
+
+ <property file="${ROYALE_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${ROYALE_HOME}/local.properties"/>
+ <property file="${ROYALE_HOME}/build.properties"/>
+ <property name="ROYALE_HOME" value="${ROYALE_HOME}"/>
+
+ <property name="target.name" value="${ant.project.name}.swc" />
+ <tstamp>
+ <format property="royale.swc-date" pattern="MM/dd/yy HH:mm Z"/>
+ </tstamp>
+ <echo>swc-date is ${royale.swc-date}</echo>
+
+ <echo file="${basedir}/${target.name}.properties">target.name.nojs=${ant.project.name}</echo>
+ <replaceregexp file="${basedir}/${target.name}.properties" match="(.*)JS$" replace="\1" flags="m" />
+ <property file="${basedir}/${target.name}.properties"/>
+ <delete file="${basedir}/${target.name}.properties"/>
+
+ <target name="main" depends="clean,check-compiler,compile" description="Full build of ${ant.project.name}.swc">
+ </target>
+
+ <target name="check-for-tests" >
+ <condition property="skip-tests" >
+ <not>
+ <available file="${basedir}/src/test/royale/build.xml" />
+ </not>
+ </condition>
+ </target>
+
+ <target name="test" depends="check-for-tests,check-compiler" unless="skip-tests">
+ <ant dir="src/test/royale" />
+ </target>
+
+ <target name="clean">
+ <delete failonerror="false">
+ <fileset dir="${ROYALE_HOME}/frameworks/js/libs">
+ <include name="${target.name}"/>
+ </fileset>
+ </delete>
+ <delete failonerror="false" includeemptydirs="true">
+ <fileset dir="${basedir}/target">
+ <include name="**/**"/>
+ </fileset>
+ </delete>
+ <antcall target="clean-tests" />
+ </target>
+
+ <target name="clean-tests" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/royale" target="clean"/>
+ </target>
+
+ <target name="compile" depends="check-compiler">
+ <echo message="Cross-compiling ${target.name}"/>
+ <echo message="ROYALE_COMPILER_HOME: ${ROYALE_COMPILER_HOME}"/>
+ <mkdir dir="${basedir}/target/generated-sources/royale"/>
+ <java jar="${ROYALE_COMPILER_HOME}/lib/compc.jar" fork="true" >
+ <jvmarg value="-Xmx384m" />
+ <jvmarg value="-Dsun.io.useCanonCaches=false" />
+ <jvmarg value="-Droyalelib=${ROYALE_HOME}/frameworks" />
+ <arg value="+royalelib=${ROYALE_HOME}/frameworks" />
+ <arg value="-compiler.strict-xml=true" />
+ <arg value="-compiler.targets=SWF,JSRoyale" />
+ <arg line="-metadata.date="${royale.swc-date}"" />
+ <arg line="-metadata.dateFormat="MM/dd/yy HH:mm Z"" />
+ <arg line="-swf-debugfile-alias="/org/apache/royale/${release.version}"" />
+ <arg value="-output=${basedir}/target/${target.name}" />
+ <arg value="-load-config=${ROYALE_HOME}/frameworks/js-config.xml" />
+ <arg value="-load-config+=${basedir}/src/main/config/compile-js-config.xml" />
+ </java>
+ <copy file="${basedir}/target/${target.name}" tofile="${ROYALE_HOME}/frameworks/js/libs/${target.name}" />
+ </target>
+
+ <target name="copy-js" >
+ <mkdir dir="${ROYALE_HOME}/frameworks/js/generated-sources"/>
+ <copy todir="${ROYALE_HOME}/frameworks/js/generated-sources">
+ <fileset dir="${basedir}/target/generated-sources/royale">
+ <include name="**/**" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="check-compiler" depends="check-compiler-home,check-transpiler-home">
+ <path id="lib.path">
+ <fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="compiler-royaleTasks.jar"/>
+ </path>
+ <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ </target>
+
+ <target name="check-compiler-home"
+ description="Set ROYALE_SWF_COMPILER_HOME to point at the compiler.">
+
+ <available file="${ROYALE_HOME}/lib/compiler-mxmlc.jar"
+ type="file"
+ property="ROYALE_SWF_COMPILER_HOME"
+ value="${ROYALE_HOME}"/>
+
+ <fail message="ROYALE_SWF_COMPILER_HOME must be set to a folder with a lib sub-folder containing compiler-mxmlc.jar such as the compiler folder in royale-compiler repo or the root of a Royale SDK"
+ unless="ROYALE_SWF_COMPILER_HOME"/>
+ </target>
+
+ <target name="check-transpiler-home"
+ description="Set ROYALE_COMPILER_HOME to point at the cross-compiler.">
+
+ <available file="${ROYALE_HOME}/js/lib/jsc.jar"
+ type="file"
+ property="ROYALE_COMPILER_HOME"
+ value="${ROYALE_HOME}/js"/>
+
+ <fail message="ROYALE_COMPILER_HOME must be set to a folder with a lib sub-folder containing jsc.jar such as the compiler-jx folder in royale-compiler repo or the js folder of a Royale SDK"
+ unless="ROYALE_COMPILER_HOME"/>
+ </target>
+
+</project>
diff --git a/frameworks/js/projects/ExternsJSJS/src/main/config/compile-js-config.xml b/frameworks/js/projects/ExternsJSJS/src/main/config/compile-js-config.xml
new file mode 100644
index 0000000..63ce2eb
--- /dev/null
+++ b/frameworks/js/projects/ExternsJSJS/src/main/config/compile-js-config.xml
@@ -0,0 +1,96 @@
+<!--
+
+ 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.
+
+-->
+<royale-config>
+
+ <compiler>
+ <accessible>false</accessible>
+
+ <!-- build both SWF and JS. -->
+ <targets>
+ <target>SWF</target>
+ <target>JSRoyale</target>
+ </targets>
+ <strict-xml>true</strict-xml>
+
+ <mxml>
+ <children-as-data>true</children-as-data>
+ </mxml>
+ <binding-value-change-event>org.apache.royale.events.ValueChangeEvent</binding-value-change-event>
+ <binding-value-change-event-kind>org.apache.royale.events.ValueChangeEvent</binding-value-change-event-kind>
+ <binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+ <define>
+ <name>COMPILE::SWF</name>
+ <value>false</value>
+ </define>
+ <define>
+ <name>COMPILE::JS</name>
+ <value>true</value>
+ </define>
+
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Managed</name>
+ <name>ChangeEvent</name>
+ <name>NonCommittingChangeEvent</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <locale/>
+
+ <external-library-path append="true">
+ <path-element>../../../../../libs/LanguageJS.swc</path-element>
+ <path-element>../../../../../libs/CoreJS.swc</path-element>
+ <path-element>../../../../../libs/BasicJS.swc</path-element>
+ <path-element>../../../../../libs/CollectionsJS.swc</path-element>
+ </external-library-path>
+
+ <source-path>
+ <path-element>../../../../../../projects/ExternsJS/src/main/royale</path-element>
+ </source-path>
+
+ <namespaces>
+ <namespace>
+ <uri>library://ns.apache.org/royale/externsjs</uri>
+ <manifest>../../../../../../projects/ExternsJS/src/main/resources/externsjs-manifest.xml</manifest>
+ </namespace>
+ </namespaces>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ </include-file>
+
+ <include-classes>
+ <class>ExternsJSClasses</class>
+ </include-classes>
+
+ <include-namespaces>
+ <uri>library://ns.apache.org/royale/basic</uri>
+ </include-namespaces>
+
+ <js-default-initializers>false</js-default-initializers>
+
+ <js-complex-implicit-coercions>false</js-complex-implicit-coercions>
+ <js-resolve-uncertain>false</js-resolve-uncertain>
+ <js-vector-index-checks>false</js-vector-index-checks>
+
+
+</royale-config>