This is an automated email from the ASF dual-hosted git repository. yishayw pushed a commit to branch feature/ace-editor in repository https://gitbox.apache.org/repos/asf/royale-typedefs.git
commit 08e1299f45082fcaa8904a865474dd3328150275 Author: DESKTOP-RH4S838\Yishay <[email protected]> AuthorDate: Thu Feb 8 17:30:53 2018 +0200 create ace externs --- ace/build.xml | 168 ++++++++++++++++++++++++++++++ ace/src/main/config/compile-as-config.xml | 45 ++++++++ ace/src/main/config/externc-config.xml | 35 +++++++ 3 files changed, 248 insertions(+) diff --git a/ace/build.xml b/ace/build.xml new file mode 100644 index 0000000..695c9f5 --- /dev/null +++ b/ace/build.xml @@ -0,0 +1,168 @@ +<?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="ace" default="main" basedir="."> + + <property name="ROYALE_HOME" value="${basedir}/.." /> + + <condition property="ROYALE_COMPILER_HOME" value="${env.ROYALE_COMPILER_HOME}"> + <and> + <not> + <isset property="ROYALE_COMPILER_HOME" /> + </not> + <available file="${env.ROYALE_COMPILER_HOME}/lib/compiler-mxmlc.jar" type="file" /> + </and> + </condition> + + <condition property="ROYALE_COMPILER_HOME" value="${ROYALE_HOME}/../royale-compiler/compiler"> + <and> + <not> + <isset property="ROYALE_COMPILER_HOME" /> + </not> + <available file="${ROYALE_HOME}/../royale-compiler/compiler/lib/compiler-mxmlc.jar" type="file" /> + </and> + </condition> + + <condition property="ROYALE_COMPILER_HOME" value="${ROYALE_HOME}"> + <and> + <not> + <isset property="ROYALE_COMPILER_HOME" /> + </not> + <available file="${ROYALE_HOME}/lib/compiler-mxmlc.jar" type="file" /> + </and> + </condition> + + <condition property="ROYALE_TRANSPILER_HOME" value="${env.ROYALE_TRANSPILER_HOME}"> + <and> + <not> + <isset property="ROYALE_TRANSPILER_HOME" /> + </not> + <available file="${env.ROYALE_TRANSPILER_HOME}/lib/jsc.jar" type="file" /> + </and> + </condition> + + <condition property="ROYALE_TRANSPILER_HOME" value="${ROYALE_HOME}/js"> + <and> + <not> + <isset property="ROYALE_TRANSPILER_HOME" /> + </not> + <available file="${ROYALE_HOME}/js/lib/jsc.jar" type="file" /> + </and> + </condition> + + <condition property="ROYALE_TRANSPILER_HOME" value="${ROYALE_HOME}/../royale-compiler/compiler-jx"> + <and> + <not> + <isset property="ROYALE_TRANSPILER_HOME" /> + </not> + <available file="${ROYALE_HOME}/../royale-compiler/compiler-jx/lib/jsc.jar" type="file" /> + </and> + </condition> + + <target name="main" depends="preprocess, externc, postprocess, compc" /> + + <target name="preprocess" depends="download"></target> + + + + <target name="download" > + <mkdir dir="${basedir}/target/downloads" /> + <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/ace-1.2.3.js" dest="${basedir}/target/downloads/ace-1.2.3.js" ignoreerrors="true"/> + <antcall target="get-from-cache-if-needed" > + <param name="srcFile" value="ace-1.2.3.js" /> + <param name="destFile" value="ace-1.2.3.js" /> + <param name="destDir" value="${basedir}/target/downloads" /> + </antcall> + <antcall target="fail-if-not-found" > + <param name="destFile" value="ace-1.2.3.js" /> + <param name="destDir" value="${basedir}/target/downloads" /> + </antcall> + </target> + + <target name="externc" > + <java jar="${ROYALE_TRANSPILER_HOME}/lib/externc.jar" fork="true" + failonerror="true"> + <arg value="+royalelib=externs" /> + <arg value="-debug" /> + <arg value="-load-config=${basedir}/src/main/config/externc-config.xml" /> + </java> + </target> + + <target name="postprocess" > + </target> + + <target name="compc" > + <copy file="${basedir}/src/main/config/compile-as-config.xml" + todir="${basedir}/target" /> + <java jar="${ROYALE_COMPILER_HOME}/lib/compiler-compc.jar" fork="true" + failonerror="true"> + <arg value="+royalelib=externs/frameworks" /> + <arg value="-debug" /> + <arg value="-external-library-path+=${basedir}/../js/target/js.swc" /> + <arg value="-load-config=${basedir}/target/compile-as-config.xml" /> + <arg value="-output=${basedir}/target/ace-1.2.3.swc" /> + </java> + </target> + + <target name="clean"> + <delete failonerror="false" includeEmptyDirs="true" > + <fileset dir="${basedir}/target"> + <include name="**/**"/> + <exclude name="downloads/**"/> + </fileset> + </delete> + </target> + + <target name="wipe"> + <delete failonerror="false" includeEmptyDirs="true" > + <fileset dir="${basedir}/target"> + <include name="**/**"/> + </fileset> + </delete> + </target> + + <target name="fail-if-not-found"> + <fail message="${destDir}/${destFile} could not be downloaded or found in cache"> + <condition> + <not> + <available file="${destDir}/${destFile}" /> + </not> + </condition> + </fail> + </target> + + <target name="double-check-file" > + <echo>${env.ROYALE_DOWNLOAD_CACHE}</echo> + <condition property="still-no-file" value="true"> + <and> + <not> + <available file="${destDir}/${destFile}" /> + </not> + <isset property="env.ROYALE_DOWNLOAD_CACHE" /> + </and> + </condition> + <echo>Need file: ${still_no_file}</echo> + </target> + <target name="get-from-cache-if-needed" depends="double-check-file" if="still-no-file"> + <copy file="${env.ROYALE_DOWNLOAD_CACHE}/${srcFile}" tofile="${destDir}/${destFile}" /> + </target> + +</project> diff --git a/ace/src/main/config/compile-as-config.xml b/ace/src/main/config/compile-as-config.xml new file mode 100644 index 0000000..accfe7a --- /dev/null +++ b/ace/src/main/config/compile-as-config.xml @@ -0,0 +1,45 @@ +<!-- + + 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>true</accessible> + + <external-library-path> + </external-library-path> + + <source-path> + <path-element>generated-sources/externc/classes</path-element> + <path-element>generated-sources/externc/constants</path-element> + </source-path> + + <warn-no-constructor>false</warn-no-constructor> + </compiler> + + <include-sources> + <path-element>generated-sources/externc/classes</path-element> + <path-element>generated-sources/externc/constants</path-element> + </include-sources> + + <include-file> + <name>externs/ace-1.2.3.js</name> + <path>downloads/ace-1.2.3.js</path> + </include-file> + +</royale-config> diff --git a/ace/src/main/config/externc-config.xml b/ace/src/main/config/externc-config.xml new file mode 100644 index 0000000..bfe03c6 --- /dev/null +++ b/ace/src/main/config/externc-config.xml @@ -0,0 +1,35 @@ +<!-- + + 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</name></exclude> 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>true</accessible> + + <locale/> + + <warn-no-constructor>false</warn-no-constructor> + </compiler> + + <typedefs> + <path-element>../../../target/downloads/ace-1.2.3.js</path-element> + </typedefs> + + <as-root>../../../target/generated-sources/externc</as-root> + +</royale-config> -- To stop receiving notification emails like this one, please contact [email protected].
