Merge branch 'develop' into issue_143
diff --git a/compiler-build-tools/ApproveBuildTools.xml b/compiler-build-tools/ApproveBuildTools.xml
new file mode 100644
index 0000000..d497b23
--- /dev/null
+++ b/compiler-build-tools/ApproveBuildTools.xml
@@ -0,0 +1,632 @@
+<?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="ApproveApacheRoyaleBuildTools" default="main" basedir=".">
+
+
+ <!-- Required for OSX 10.6 / Snow Leopard Performance. -->
+ <!-- Java 7 on Mac requires OSX 10.7.3 or higher and is 64-bit only -->
+ <!-- local.d32 is set/used in build.properties so this needs to be done first. -->
+ <condition property="local.d32" value="-d32">
+ <and>
+ <os family="windows"/>
+ <equals arg1="${sun.arch.data.model}" arg2="64"/>
+ <equals arg1="${os.arch}" arg2="x86_64"/>
+ <equals arg1="${ant.java.version}" arg2="1.6"/>
+ </and>
+ </condition>
+
+ <condition property="isMac" value="mac">
+ <os family="mac" />
+ </condition>
+ <condition property="isWindows" value="windows">
+ <os family="windows" />
+ </condition>
+ <condition property="isLinux" value="linux">
+ <and>
+ <os family="unix" />
+ <not>
+ <isset property="isMac" />
+ </not>
+ </and>
+ </condition>
+ <condition property="package.suffix" value="zip">
+ <os family="windows" />
+ </condition>
+ <property name="package.suffix" value="tar.gz" />
+
+ <property name="src.rat.report" value="${basedir}/rat-report-src.txt"/>
+ <property name="bin.rat.report" value="${basedir}/rat-report-bin.txt"/>
+ <property name="apache.rat.jar" value="apache-rat-0.11.jar" />
+ <property name="apache.rat.tasks.jar" value="apache-rat-tasks-0.11.jar" />
+ <property name="apache.rat.url" value="https://search.maven.org/remotecontent?filepath=org/apache/rat/apache-rat/0.11" />
+ <property name="apache.rat.tasks.url" value="https://search.maven.org/remotecontent?filepath=org/apache/rat/apache-rat-tasks/0.11" />
+
+ <property file="${basedir}/approveroyale.properties"/>
+
+ <property name="mac.text.display" value="cat" />
+ <property name="win.text.display" value="type" />
+ <property name="linux.text.display" value="cat" />
+ <property environment="env"/>
+
+ <property name="build.target" value="main" />
+
+ <condition property="do.copy.downloads" >
+ <isset property="download.cache.dir" />
+ </condition>
+
+ <available file="${env.ANT_HOME}/lib/${apache.rat.jar}"
+ type="file"
+ property="apache.rat.found"/>
+ <available file="${env.ANT_HOME}/lib/${apache.rat.tasks.jar}"
+ type="file"
+ property="apache.rat.tasks.found"/>
+
+ <fail message="The release version is not set. Specify -Drelease.version=<release version (e.g. 3.1, 3.2, etc)>"
+ unless="release.version"/>
+
+ <property name="package.url.path" value="https://dist.apache.org/repos/dist/dev/royale/compiler-build-tools/${release.version}/rc${rc}" />
+ <property name="src.package.url.path" value="${package.url.path}" />
+ <property name="bin.package.url.path" value="${package.url.path}/binaries" />
+ <property name="src.package.url.name" value="apache-royale-compiler-build-tools-${release.version}-src" />
+ <property name="bin.package.url.name" value="compiler-build-tools-${release.version}" />
+
+ <condition property="zip.package">
+ <equals arg1="zip" arg2="${package.suffix}" />
+ </condition>
+
+ <target name="display-text-mac" if="isMac">
+ <echo>========================= Begin ${file} ==============================</echo>
+ <exec executable="${mac.text.display}" >
+ <arg value="${file}" />
+ </exec>
+ <echo>========================= End ${file} ==============================</echo>
+ </target>
+ <target name="display-text-win" if="isWindows">
+ <pathconvert targetos="windows" property="winfile">
+ <path path="${file}" />
+ </pathconvert>
+ <echo>========================= Begin ${winfile} ==============================</echo>
+ <exec executable="cmd.exe" >
+ <arg value="/c" />
+ <arg value="${win.text.display}" />
+ <arg value="${winfile}" />
+ </exec>
+ <echo>========================= End ${winfile} ==============================</echo>
+ </target>
+ <target name="display-text-linux" if="isLinux">
+ <echo>========================= Begin ${file} ==============================</echo>
+ <exec executable="${linux.text.display}" >
+ <arg value="${file}" />
+ </exec>
+ <echo>========================= End ${file} ==============================</echo>
+ </target>
+
+ <target name="install-rat" depends="install-rat.jar,install-rat.tasks.jar" />
+ <target name="install-rat.jar" unless="apache.rat.found">
+ <get src="${apache.rat.url}/${apache.rat.jar}" dest="${env.ANT_HOME}/lib/${apache.rat.jar}" />
+ </target>
+ <target name="install-rat.tasks.jar" unless="apache.rat.tasks.found">
+ <get src="${apache.rat.tasks.url}/${apache.rat.tasks.jar}" dest="${env.ANT_HOME}/lib/${apache.rat.tasks.jar}" />
+ </target>
+
+ <target name="rat-taskdef" description="Rat taskdef">
+ <typedef resource="org/apache/rat/anttasks/antlib.xml"
+ uri="antlib:org.apache.rat.anttasks"
+ classpathref="anttask.classpath"/>
+ </target>
+
+ <target name="main" depends="write-out-jars-list,install-rat,download,check-sigs,uncompress,rat-check,examine-jars,check-notices,build,approve" description="Perform required release approval steps">
+ </target>
+
+ <target name="main-no-download" depends="write-out-jars-list,install-rat,check-sigs,uncompress,rat-check,examine-jars,check-notices,build,approve" description="Perform required release approval steps">
+ </target>
+
+ <target name="test" >
+ <echo>${rat.report}.bin.txt</echo>
+ <replaceregexp file="${rat.report}.bin.txt" match="..AL.*" replace="" byline="true"/>
+ </target>
+
+ <target name="write-out-jars-list" >
+ <delete file="jars.txt" />
+ <!-- this is a comma-delimited, no spaces, no-line-breaks list used to decide which jars
+ to skip in the rat-check of the binaries and which jars to examine before approval -->
+ <property name="jars-list" value="compiler-build-tools-${release.version}.jar"/>
+ <echo file="${basedir}/jars.txt" message="${jars-list}"/>
+ <echo file="${basedir}/jarexcludes.txt" message="${jars-list}"/>
+ <replaceregexp file="${basedir}/jarexcludes.txt" match="," flags="g" replace="${line.separator}" />
+ </target>
+
+ <target name="display-text" >
+ <antcall target="display-text-mac" />
+ <antcall target="display-text-win" />
+ <antcall target="display-text-linux" />
+ </target>
+
+ <target name="display-text-test" >
+ <antcall target="display-text" >
+ <param name="file" value="${basedir}/rat-report.txt" />
+ </antcall>
+ </target>
+
+ <target name="download" description="download the release package">
+ <get src="${src.package.url.path}/${src.package.url.name}.${package.suffix}"
+ dest="${basedir}/${src.package.url.name}.${package.suffix}" />
+ <get src="${src.package.url.path}/${src.package.url.name}.${package.suffix}.sha512"
+ dest="${basedir}/${src.package.url.name}.${package.suffix}.sha512" />
+ <get src="${bin.package.url.path}/${bin.package.url.name}.jar"
+ dest="${basedir}/${bin.package.url.name}.jar" />
+ <get src="${bin.package.url.path}/${bin.package.url.name}.jar.sha512"
+ dest="${basedir}/${bin.package.url.name}.jar.sha512" />
+ <antcall target="asc_get" />
+ </target>
+
+ <target name="asc_get" if="rc" >
+ <get src="${src.package.url.path}/${src.package.url.name}.${package.suffix}.asc"
+ dest="${basedir}/${src.package.url.name}.${package.suffix}.asc" />
+ <get src="${bin.package.url.path}/${bin.package.url.name}.${package.suffix}.asc"
+ dest="${basedir}/${bin.package.url.name}.${package.suffix}.asc" />
+ </target>
+
+ <target name="check-sigs" description="check md5 and gpg sigs">
+ <replace file="${basedir}/${src.package.url.name}.${package.suffix}.md5"
+ token=" " />
+ <checksum file="${basedir}/${src.package.url.name}.${package.suffix}" algorithm="SHA-512" verifyproperty="src.md5.ok" fileext=".sha512"/>
+ <condition property="SourceMD5Invalid">
+ <not>
+ <equals arg1="${src.md5.ok}" arg2="true" />
+ </not>
+ </condition>
+ <fail message="Source Package SHA-512 checksum did not match" if="SourceMD5Invalid" />
+ <replace file="${basedir}/${bin.package.url.name}.jar.md5"
+ token=" " />
+ <checksum file="${basedir}/${bin.package.url.name}.jar" algorithm="SHA-512" verifyproperty="bin.md5.ok" fileext=".sha512" />
+ <condition property="BinaryMD5Invalid">
+ <not>
+ <equals arg1="${bin.md5.ok}" arg2="true" />
+ </not>
+ </condition>
+ <fail message="Binary Package SHA-512 checksum did not match" if="BinaryMD5Invalid" />
+ <echo>rc is ${rc}</echo>
+ <antcall target="gpg_check" />
+ </target>
+
+ <target name="gpg_check" if="rc">
+ <exec executable="gpg" failonerror="true">
+ <arg value="--verify" />
+ <arg value="${basedir}/${src.package.url.name}.${package.suffix}.asc" />
+ <arg value="${basedir}/${src.package.url.name}.${package.suffix}" />
+ </exec>
+ <exec executable="gpg" failonerror="true">
+ <arg value="--verify" />
+ <arg value="${basedir}/${bin.package.url.name}.jar.asc" />
+ <arg value="${basedir}/${bin.package.url.name}.jar" />
+ </exec>
+ </target>
+
+ <target name="uncompress" depends="pre-clean, untar-file, unzip-file" />
+
+ <target name="pre-clean" description="remove old uncompressed package" >
+ <delete dir="${basedir}/${src.package.url.name}" failonerror="false" />
+ <delete dir="${basedir}/${bin.package.url.name}" failonerror="false" />
+ </target>
+
+ <target name="untar-file" unless="zip.package" description="Untars zipFile">
+ <untar src="${basedir}/${src.package.url.name}.${package.suffix}"
+ dest="${basedir}" compression="gzip"/>
+ <untar src="${basedir}/${bin.package.url.name}.${package.suffix}"
+ dest="${basedir}" compression="gzip"/>
+ </target>
+
+ <target name="unzip-file" if="zip.package" description="Unzips zipFile">
+ <unzip src="${basedir}/${src.package.url.name}.${package.suffix}"
+ dest="${basedir}/${src.package.url.name}"/>
+ <unzip src="${basedir}/${bin.package.url.name}.${package.suffix}"
+ dest="${basedir}/${bin.package.url.name}"/>
+ </target>
+
+ <target name="rat-check" >
+
+ <echo message="Checking files at ${basedir}/${src.package.url.name}, report is ${src.rat.report}"/>
+
+ <rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
+ reportFile="${src.rat.report}">
+ <fileset dir="${basedir}/${src.package.url.name}">
+ <!-- exclude media (png, gif, jpg, mp3, flv) -->
+ <exclude name="**/*.png"/>
+ <exclude name="**/*.gif"/>
+ <exclude name="**/*.jpg"/>
+ <exclude name="**/*.mp3"/>
+ <exclude name="**/*.flv"/>
+ <exclude name="**/org.apache.royale.tools.FlexToolGroup"/>
+ <exclude name="debugger/META-INF/MANIFEST.MF"/>
+ <exclude name="flex-typedefs/target/maven-shared-archive-resources/META-INF/DEPENDENCIES"/>
+ <exclude name="**/*.patch"/>
+ <exclude name="README_MAVEN.txt"/>
+ <exclude name="RELEASE_NOTES_JX"/>
+ <exclude name="LICENSE.jx.bin"/>
+ <exclude name="NOTICE.jx"/>
+ <exclude name="README_JX"/>
+ <exclude name="NOTICE.base"/>
+ <exclude name="NOTICE.fdb"/>
+ <exclude name="NOTICE.oem"/>
+ <exclude name="NOTICE.swfutils"/>
+ </fileset>
+ </rat:report>
+ <antcall target="display-text" >
+ <param name="file" value="${src.rat.report}" />
+ </antcall>
+ <input
+ message="Check that there are no unknown or unapproved licenses or archives. Is it ok?"
+ validargs="y,n"
+ defaultvalue="y"
+ addproperty="rat.src.license.ok"/>
+ <echo>filtering out AL files to make it easier to see binary files</echo>
+ <copy file="${src.rat.report}" tofile="${src.rat.report}.bin.txt" />
+ <replaceregexp file="${src.rat.report}.bin.txt" match="..AL.*" replace="__AL" byline="true"/>
+ <replaceregexp file="${src.rat.report}.bin.txt" flags="gs" match="__AL." replace="" byline="false"/>
+ <antcall target="display-text" >
+ <param name="file" value="${src.rat.report}.bin.txt" />
+ </antcall>
+ <input
+ message="Check that there are no unexpected binaries. Is it ok?"
+ validargs="y,n"
+ defaultvalue="n"
+ addproperty="rat.src.binaries.ok"/>
+
+ <echo message="Checking files at ${basedir}/${bin.package.url.name}, report is ${bin.rat.report}"/>
+
+ <antcall target="binary-rat" />
+ <antcall target="display-text" >
+ <param name="file" value="${bin.rat.report}" />
+ </antcall>
+ <input
+ message="Check that there are no unknown or unapproved licenses or archives. Is it ok?"
+ validargs="y,n"
+ defaultvalue="y"
+ addproperty="rat.bin.license.ok"/>
+ <echo>filtering out AL files to make it easier to see binary files</echo>
+ <copy file="${bin.rat.report}" tofile="${bin.rat.report}.bin.txt" />
+ <replaceregexp file="${bin.rat.report}.bin.txt" match="..AL.*" replace="__AL" byline="true"/>
+ <replaceregexp file="${bin.rat.report}.bin.txt" flags="gs" match="__AL." replace="" byline="false"/>
+ <antcall target="display-text" >
+ <param name="file" value="${bin.rat.report}.bin.txt" />
+ </antcall>
+ <input
+ message="Check that there are no unexpected binaries. Is it ok?"
+ validargs="y,n"
+ defaultvalue="n"
+ addproperty="rat.bin.binaries.ok"/>
+ </target>
+
+ <target name="binary-rat" >
+ <echo>${jars-list}</echo>
+ <rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
+ reportFile="${bin.rat.report}">
+ <fileset dir="${basedir}/${bin.package.url.name}">
+ <!-- exclude media (png, gif, jpg, mp3, flv) -->
+ <exclude name="**/*.png"/>
+ <exclude name="**/*.gif"/>
+ <exclude name="**/*.jpg"/>
+ <exclude name="**/*.mp3"/>
+ <exclude name="**/*.flv"/>
+ <exclude name="**/org.apache.royale.tools.FlexToolGroup"/>
+ <exclude name="debugger/META-INF/MANIFEST.MF"/>
+ <exclude name="flex-typedefs/target/maven-shared-archive-resources/META-INF/DEPENDENCIES"/>
+ <exclude name="**/*.patch"/>
+ <exclude name="LICENSE.jx.bin"/>
+ <exclude name="README_MAVEN.txt"/>
+ <exclude name="RELEASE_NOTES_JX"/>
+ <exclude name="NOTICE.jx"/>
+ <exclude name="README_JX"/>
+ <exclude name="NOTICE.base"/>
+ <exclude name="NOTICE.fdb"/>
+ <exclude name="NOTICE.oem"/>
+ <exclude name="NOTICE.swfutils"/>
+ <exclude name="compiler/target/generated-sources/**" />
+ <exclude name="flex-typedefs/js/target/downloads/svg.js" />
+ <exclude name="flex-typedefs/createjs/target/downloads/**" />
+ <exclude name="flex-typedefs//**/*.swc" />
+ <exclude name="js/libs/cordova.swc"/>
+ <exclude name="js/libs/createjs.swc"/>
+ <exclude name="js/libs/GCL.swc"/>
+ <exclude name="js/libs/google_maps.swc"/>
+ <exclude name="js/libs/jasmine.swc"/>
+ <exclude name="js/libs/jquery.swc"/>
+ <exclude name="js/libs/js.swc"/>
+ <exclude name="js/libs/node.swc"/>
+ <excludesfile name="${basedir}/jarexcludes.txt" />
+ </fileset>
+ </rat:report>
+ </target>
+
+ <!-- someday figure out how to use
+ find . -name "*.jar" -exec tar ft {} \; | sort -u > paths.txt -->
+
+ <!-- how to do tar and sort on Windows? -->
+ <target name="examine-jars" if="isMac">
+ <!-- comma delimited list, no spaces, not one file per line -->
+ <copy file="jars.txt" tofile="loop.txt" />
+ <ant antfile="ApproveBuildTools.xml" target="loopOnce" inheritAll="false" />
+ </target>
+ <target name="loopOnce" >
+ <!-- make a copy of the list so we can munge it to
+ get the first item in the list -->
+ <delete file="loop1.txt" />
+ <copy file="loop.txt" tofile="loop1.txt" />
+ <loadfile srcFile="loop.txt" property="checkiflast" />
+ <condition property="islast" value="true">
+ <not>
+ <contains string="${checkiflast}" substring="," />
+ </not>
+ </condition>
+ <antcall target="notlast" />
+ <antcall target="lastone" />
+ </target>
+ <target name="notlast" unless="islast">
+ <loadfile srcFile="loop1.txt" property="echoFile" />
+ <replaceregexp file="loop1.txt" match="^(.*),(.*)" replace="\2" />
+ <loadfile srcFile="loop1.txt" property="thisFile" />
+ <antcall target="jar-check" />
+ <replaceregexp file="loop.txt" match="^(.*),(.*)" replace="\1" />
+ <ant antfile="ApproveBuildTools.xml" target="loopOnce" inheritAll="false"/>
+ </target>
+ <target name="lastone" if="islast">
+ <loadfile srcFile="loop1.txt" property="thisFile" />
+ <antcall target="jar-check" />
+ <delete file="loop.txt" />
+ <delete file="loop1.txt" />
+ </target>
+
+ <target name="jar-check" >
+ <delete dir="${basedir}/jar" failonerror="false" />
+ <mkdir dir="${basedir}/jar" />
+ <unjar src="${basedir}/${bin.package.url.name}/${thisFile}" dest="${basedir}/jar" />
+ <exec executable="tar" output="${basedir}/jarclasses.txt">
+ <arg value="tf" />
+ <arg value="${basedir}/${bin.package.url.name}/${thisFile}" />
+ </exec>
+ <replaceregexp file="${basedir}/jarclasses.txt" match="(.*)/(.*)" replace="\1" flags="m" byline="true"/>
+ <exec executable="sort" output="${basedir}/jarpaths.txt">
+ <arg value="-u" />
+ <arg value="${basedir}/jarclasses.txt" />
+ </exec>
+ <antcall target="display-text" >
+ <param name="file" value="${basedir}/jarpaths.txt" />
+ </antcall>
+ <input
+ message="Above is the list of folders in this ${thisFile}.
Folder names can sometimes indicate presence of third-party content that needs to be in LICENSE and/or NOTICE files.
Press the Enter key to see the LICENSE for this jar."/>
+
+ <fail message="LICENSE not in ${basedir}/${bin.package.url.name}/${thisFile}">
+ <condition>
+ <not>
+ <available file="${basedir}/jar/META-INF/LICENSE" />
+ </not>
+ </condition>
+ </fail>
+ <fail message="NOTICE not in ${basedir}/${bin.package.url.name}/${thisFile}">
+ <condition>
+ <not>
+ <available file="${basedir}/jar/META-INF/NOTICE" />
+ </not>
+ </condition>
+ </fail>
+ <antcall target="display-text" >
+ <param name="file" value="${basedir}/jar/META-INF/LICENSE" />
+ </antcall>
+ <input
+ message="Check the LICENSE for the Apache License and third-party licenses. Is it ok?"
+ validargs="y,n"
+ defaultvalue="y"
+ addproperty="jar.license.ok"/>
+ <fail message="LICENSE for ${basedir}/${bin.package.url.name}/${thisFile} not correct">
+ <condition>
+ <not>
+ <equals arg1="${jar.license.ok}" arg2="y" />
+ </not>
+ </condition>
+ </fail>
+ <antcall target="display-text" >
+ <param name="file" value="${basedir}/jar/META-INF/NOTICE" />
+ </antcall>
+ <input
+ message="Check the NOTICE for required notices from third-parties. Is it ok?"
+ validargs="y,n"
+ defaultvalue="y"
+ addproperty="jar.notice.ok"/>
+ <fail message="NOTICE for ${basedir}/${bin.package.url.name}/${thisFile} not correct">
+ <condition>
+ <not>
+ <equals arg1="${jar.notice.ok}" arg2="y" />
+ </not>
+ </condition>
+ </fail>
+
+ </target>
+
+ <target name="check-notices" description="open each notice file for review, grep for a few things" >
+ <!--
+ <fail message="README not in source package">
+ <condition>
+ <not>
+ <available file="${basedir}/${src.package.url.name}/README" />
+ </not>
+ </condition>
+ </fail>
+ <fail message="RELEASE_NOTES not in source package">
+ <condition>
+ <not>
+ <available file="${basedir}/${src.package.url.name}/RELEASE_NOTES" />
+ </not>
+ </condition>
+ </fail>
+ -->
+ <fail message="NOTICE not in source package">
+ <condition>
+ <not>
+ <available file="${basedir}/${src.package.url.name}/NOTICE" />
+ </not>
+ </condition>
+ </fail>
+ <fail message="LICENSE not in source package">
+ <condition>
+ <not>
+ <available file="${basedir}/${src.package.url.name}/LICENSE" />
+ </not>
+ </condition>
+ </fail>
+ <!--
+ <fail message="README not in binary package">
+ <condition>
+ <not>
+ <available file="${basedir}/${bin.package.url.name}/README" />
+ </not>
+ </condition>
+ </fail>
+ <fail message="RELEASE_NOTES not in binary package">
+ <condition>
+ <not>
+ <available file="${basedir}/${bin.package.url.name}/RELEASE_NOTES" />
+ </not>
+ </condition>
+ </fail>
+ <fail message="NOTICE not in binary package">
+ <condition>
+ <not>
+ <available file="${basedir}/${bin.package.url.name}/NOTICE" />
+ </not>
+ </condition>
+ </fail>
+ <fail message="LICENSE not in binary package">
+ <condition>
+ <not>
+ <available file="${basedir}/${bin.package.url.name}/LICENSE" />
+ </not>
+ </condition>
+ </fail>
+ -->
+ <!--
+ <antcall target="display-text" >
+ <param name="file" value="${basedir}/${src.package.url.name}/README" />
+ </antcall>
+ <input
+ message="Check the README for version numbers, spelling, grammar, accuracy. Is it ok?"
+ validargs="y,n"
+ defaultvalue="y"
+ addproperty="readme.ok"/>
+ <antcall target="display-text" >
+ <param name="file" value="${basedir}/${src.package.url.name}/RELEASE_NOTES" />
+ </antcall>
+ <input
+ message="Check the RELEASE_NOTES for copyright years, spelling, grammar, accuracy. Is it ok?"
+ validargs="y,n"
+ defaultvalue="y"
+ addproperty="releasenotes.ok"/>
+ -->
+
+ <antcall target="display-text" >
+ <param name="file" value="${basedir}/${src.package.url.name}/NOTICE" />
+ </antcall>
+ <input
+ message="Check the source package NOTICE for required notices from third-parties. Is it ok?"
+ validargs="y,n"
+ defaultvalue="y"
+ addproperty="src.notice.ok"/>
+
+ <antcall target="display-text" >
+ <param name="file" value="${basedir}/${src.package.url.name}/LICENSE" />
+ </antcall>
+ <input
+ message="Check the source package LICENSE for the Apache License and third-party licenses. Is it ok?"
+ validargs="y,n"
+ defaultvalue="y"
+ addproperty="src.license.ok"/>
+
+ <antcall target="display-text" >
+ <param name="file" value="${basedir}/${bin.package.url.name}/NOTICE" />
+ </antcall>
+ <input
+ message="Check the binary package NOTICE for required notices from third-parties. Is it ok?"
+ validargs="y,n"
+ defaultvalue="y"
+ addproperty="bin.notice.ok"/>
+
+ <antcall target="display-text" >
+ <param name="file" value="${basedir}/${bin.package.url.name}/LICENSE" />
+ </antcall>
+ <input
+ message="Check the binary package LICENSE for the Apache License and third-party licenses. Is it ok?"
+ validargs="y,n"
+ defaultvalue="y"
+ addproperty="bin.license.ok"/>
+ </target>
+
+ <target name="build" depends="copy.downloads">
+ <input
+ message="The final step is to run the build and any tests the build script runs. This can take several minutes. Press y to start the build."
+ validargs="y"
+ defaultvalue="y" />
+ <exec dir="${basedir}/${src.package.url.name}" target="all" />
+ </target>
+
+ <target name="approve" >
+ <condition property="vote" value="+1">
+ <and>
+ <equals arg1="${rat.src.license.ok}" arg2="y" />
+ <equals arg1="${rat.src.binaries.ok}" arg2="y" />
+ <!--
+ <equals arg1="${rat.bin.license.ok}" arg2="y" />
+ <equals arg1="${rat.bin.binaries.ok}" arg2="y" />
+ <equals arg1="${readme.ok}" arg2="y" />
+ <equals arg1="${releasenotes.ok}" arg2="y" />
+ -->
+ <equals arg1="${src.notice.ok}" arg2="y" />
+ <equals arg1="${bin.notice.ok}" arg2="y" />
+ <equals arg1="${src.license.ok}" arg2="y" />
+ <equals arg1="${bin.license.ok}" arg2="y" />
+ </and>
+ </condition>
+ <property name="vote" value="-1" />
+ <echo>
+${vote}
+Package ${src.package.url.path}/${src.package.url.name}.${package.suffix}
+Java ${ant.java.version}
+OS: ${os.name} ${os.arch} ${os.version}
+Source kit signatures match: y
+Source kit builds: y
+README is ok: ${readme.ok}
+RELEASE_NOTES is ok: ${releasenotes.ok}
+NOTICE is ok: ${src.notice.ok}
+LICENSE is ok: ${src.license.ok}
+No unapproved licenses or archives in source package: ${rat.src.license.ok}
+No unapproved binaries in source package: ${rat.src.binaries.ok}
+
+Package ${bin.package.url.path}/${bin.package.url.name}.jar
+Binary signatures match: y
+NOTICE is ok: ${bin.notice.ok}
+LICENSE is ok: ${bin.license.ok}
+ </echo>
+ <fail>
+ <condition>
+ <equals arg1="-1" arg2="${vote}"/>
+ </condition>
+ </fail>
+ </target>
+</project>
diff --git a/compiler-build-tools/pom.xml b/compiler-build-tools/pom.xml
index 816f645..62844bc 100644
--- a/compiler-build-tools/pom.xml
+++ b/compiler-build-tools/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
@@ -16,295 +16,304 @@
See the License for the specific language governing permissions and
limitations under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache</groupId>
- <artifactId>apache</artifactId>
- <version>23</version>
- <relativePath />
- </parent>
-
- <groupId>org.apache.royale.compiler</groupId>
- <artifactId>compiler-build-tools</artifactId>
- <version>1.2.1-SNAPSHOT</version>
- <packaging>maven-plugin</packaging>
-
- <name>Apache Royale: Build Tools</name>
-
- <scm>
- <connection>scm:git:https://gitbox.apache.org/repos/asf/royale-compiler.git</connection>
- <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/royale-compiler.git</developerConnection>
- <url>https://github.com/apache/royale-compiler</url>
- <tag>HEAD</tag>
- </scm>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>3.6.0</version>
- <configuration>
- <goalPrefix>compiler-build-tools</goalPrefix>
- <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
- </configuration>
- <executions>
- <execution>
- <id>mojo-descriptor</id>
- <goals>
- <goal>descriptor</goal>
- </goals>
- </execution>
- <execution>
- <id>help-goal</id>
- <goals>
- <goal>helpmojo</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- </plugin>
- <!-- This plugin cleans up the jars for anything that might cause problems for reproducible builds -->
- <plugin>
- <groupId>io.github.zlika</groupId>
- <artifactId>reproducible-build-maven-plugin</artifactId>
- <version>0.11</version>
- <executions>
- <execution>
- <goals>
- <goal>strip-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <tags>
- <tag>
- <name>goal</name>
- <placement>a</placement>
- <head>Goal:</head>
- </tag>
- <tag>
- <name>phase</name>
- <placement>a</placement>
- <head>Phase:</head>
- </tag>
- <tag>
- <name>threadSafe</name>
- <placement>a</placement>
- <head>Thread Safe:</head>
- </tag>
- <tag>
- <name>requiresDependencyResolution</name>
- <placement>a</placement>
- <head>Requires Dependency Resolution:</head>
- </tag>
- <tag>
- <name>requiresProject</name>
- <placement>a</placement>
- <head>Requires Project:</head>
- </tag>
- </tags>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-scm-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>3.2.0</version>
- <configuration>
- <finalName>apache-royale-${project.artifactId}-${project.version}</finalName>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.4</version>
- </plugin>
- </plugins>
- </reporting>
-
- <dependencies>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>25.1-jre</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core</artifactId>
- <version>3.5.4</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-api</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-compress</artifactId>
- <version>1.18</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.6</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>3.5.4</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-annotations</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- <version>3.0.3</version>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>apache-release</id>
- <build>
- <plugins>
- <plugin>
- <groupId>com.theoryinpractise</groupId>
- <artifactId>reproducible-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <preparationGoals>clean com.theoryinpractise:reproducible-maven-plugin:apply install</preparationGoals>
- <completionGoals>com.theoryinpractise:reproducible-maven-plugin:clear</completionGoals>
- </configuration>
- </plugin>
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>23</version>
+ <relativePath />
+ </parent>
+
+ <groupId>org.apache.royale.compiler</groupId>
+ <artifactId>compiler-build-tools</artifactId>
+ <version>1.2.1-SNAPSHOT</version>
+ <packaging>maven-plugin</packaging>
+
+ <name>Apache Royale: Build Tools</name>
+
+ <scm>
+ <connection>scm:git:https://gitbox.apache.org/repos/asf/royale-compiler.git</connection>
+ <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/royale-compiler.git</developerConnection>
+ <url>https://github.com/apache/royale-compiler</url>
+ <tag>HEAD</tag>
+ </scm>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>3.6.0</version>
+ <configuration>
+ <goalPrefix>compiler-build-tools</goalPrefix>
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
+ <executions>
+ <execution>
+ <id>mojo-descriptor</id>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>help-goal</id>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <!-- This plugin cleans up the jars for anything that might cause problems for reproducible builds -->
+ <plugin>
+ <groupId>io.github.zlika</groupId>
+ <artifactId>reproducible-build-maven-plugin</artifactId>
+ <version>0.11</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>strip-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <tags>
+ <tag>
+ <name>goal</name>
+ <placement>a</placement>
+ <head>Goal:</head>
+ </tag>
+ <tag>
+ <name>phase</name>
+ <placement>a</placement>
+ <head>Phase:</head>
+ </tag>
+ <tag>
+ <name>threadSafe</name>
+ <placement>a</placement>
+ <head>Thread Safe:</head>
+ </tag>
+ <tag>
+ <name>requiresDependencyResolution</name>
+ <placement>a</placement>
+ <head>Requires Dependency Resolution:</head>
+ </tag>
+ <tag>
+ <name>requiresProject</name>
+ <placement>a</placement>
+ <head>Requires Project:</head>
+ </tag>
+ </tags>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-scm-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>3.2.0</version>
+ <configuration>
+ <finalName>apache-royale-${project.artifactId}-${project.version}</finalName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.4</version>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>25.1-jre</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>3.5.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-compiler-api</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ <version>1.18</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>3.5.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>3.0.3</version>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>apache-release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.theoryinpractise</groupId>
+ <artifactId>reproducible-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <preparationGoals>clean com.theoryinpractise:reproducible-maven-plugin:apply install</preparationGoals>
+ <completionGoals>com.theoryinpractise:reproducible-maven-plugin:clear</completionGoals>
+ </configuration>
+ </plugin>
<!--
Create MD5 and SHA512 checksum files for the release artifacts.
- -->
- <plugin>
- <groupId>net.nicoulaj.maven.plugins</groupId>
- <artifactId>checksum-maven-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <goals>
- <goal>files</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <algorithms>
- <algorithm>SHA-512</algorithm>
- </algorithms>
- <fileSets>
- <fileSet>
- <directory>${project.build.directory}</directory>
- <includes>
- <include>apache-royale-${project.artifactId}-${project.version}-source-release.zip</include>
- </includes>
- </fileSet>
- </fileSets>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>royale-release</id>
- <properties>
- <!-- Ensure the royale-release plugin is enabled when running release:perform -->
- <release-profiles>apache-release</release-profiles>
- </properties>
-
- <!-- Redirect the deployment to a local directory -->
- <!-- Note: using the 'altReleaseDeploymentRepository' and alike were ignored in the release:perform phase -->
- <distributionManagement>
- <repository>
- <id>apache.releases.https</id>
- <name>Apache Release Distribution Repository</name>
+ -->
+ <plugin>
+ <groupId>net.nicoulaj.maven.plugins</groupId>
+ <artifactId>checksum-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>files</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <algorithms>
+ <algorithm>SHA-512</algorithm>
+ </algorithms>
+ <fileSets>
+ <fileSet>
+ <directory>${project.build.directory}</directory>
+ <includes>
+ <include>apache-royale-${project.artifactId}-${project.version}-source-release.zip</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>royale-release</id>
+ <properties>
+ <!-- Ensure the royale-release plugin is enabled when running release:perform -->
+ <release-profiles>apache-release</release-profiles>
+ </properties>
+
+ <!-- Redirect the deployment to a local directory -->
+ <!-- Note: using the 'altReleaseDeploymentRepository' and alike were ignored in the release:perform phase -->
+ <distributionManagement>
+ <repository>
+ <id>apache.releases.https</id>
+ <name>Apache Release Distribution Repository</name>
<!--
'maven.multiModuleProjectDirectory' is a property introduced with maven 3.3.1 ...
don't worry if your IDE is complaining.
Also this will be set to the 'target/checkout' directory the output will be in
'target/local-release-dir'.
- -->
- <url>file://${maven.multiModuleProjectDirectory}/../local-release-dir</url>
- </repository>
- </distributionManagement>
-
- <build>
- <plugins>
- <!-- Generate the effective poms for this build -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-help-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-effective-pom</id>
- <phase>compile</phase>
- <goals>
- <goal>effective-pom</goal>
- </goals>
- <configuration>
- <output>${project.build.directory}/effective.pom</output>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <!-- We require the release manager to manually login an sign using his credentials -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-gpg-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <!-- We require the release manager to login and push the changes using his credentials -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <pushChanges>false</pushChanges>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- </profile>
- </profiles>
-
-</project>
+ -->
+ <url>file://${maven.multiModuleProjectDirectory}/../local-release-dir</url>
+ </repository>
+ </distributionManagement>
+
+ <build>
+ <plugins>
+ <!-- Generate the effective poms for this build -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-help-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-effective-pom</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>effective-pom</goal>
+ </goals>
+ <configuration>
+ <output>${project.build.directory}/effective.pom</output>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!-- We require the release manager to manually login an sign using his credentials -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <!-- We require the release manager to login and push the changes using his credentials -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <pushChanges>false</pushChanges>
+ <providerImplementations>
+ <git>jgit</git>
+ </providerImplementations>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-jgit</artifactId>
+ <version>1.11.3-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ </profiles>
+
+<properties /></project>
diff --git a/compiler-build-tools/releasesteps.xml b/compiler-build-tools/releasesteps.xml
new file mode 100644
index 0000000..d32352c
--- /dev/null
+++ b/compiler-build-tools/releasesteps.xml
@@ -0,0 +1,433 @@
+<?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="CreateCompilerBuildToolsReleaseCandidate" default="main" basedir=".">
+
+ <!-- use -Dtag=<tag or commit hash> to build from other than the head -->
+
+ <!-- Required for OSX 10.6 / Snow Leopard Performance. -->
+ <!-- Java 7 on Mac requires OSX 10.7.3 or higher and is 64-bit only -->
+ <!-- local.d32 is set/used in build.properties so this needs to be done first. -->
+ <condition property="local.d32" value="-d32">
+ <and>
+ <os family="windows"/>
+ <equals arg1="${sun.arch.data.model}" arg2="64"/>
+ <equals arg1="${os.arch}" arg2="x86_64"/>
+ <equals arg1="${ant.java.version}" arg2="1.6"/>
+ </and>
+ </condition>
+
+ <condition property="isMac" value="mac">
+ <os family="mac" />
+ </condition>
+ <condition property="isWindows" value="windows">
+ <os family="windows" />
+ </condition>
+ <condition property="isLinux" value="linux">
+ <and>
+ <os family="unix" />
+ <not>
+ <isset property="isMac" />
+ </not>
+ </and>
+ </condition>
+
+ <property name="rat.report" value="${basedir}/rat-report.txt"/>
+ <property name="apache.rat.jar" value="apache-rat-0.11.jar" />
+ <property name="apache.rat.tasks.jar" value="apache-rat-tasks-0.11.jar" />
+ <property name="apache.rat.url" value="https://search.maven.org/remotecontent?filepath=org/apache/rat/apache-rat/0.11" />
+ <property name="apache.rat.tasks.url" value="https://search.maven.org/remotecontent?filepath=org/apache/rat/apache-rat-tasks/0.11" />
+
+ <property file="${basedir}/../local.properties" />
+ <property file="${basedir}/../build.properties" />
+
+ <property environment="env"/>
+
+ <condition property="do.copy.downloads" >
+ <isset property="download.cache.dir" />
+ </condition>
+
+ <condition property="CRLF" value="%0D%0A">
+ <isset property="isWindows" />
+ </condition>
+ <property name="CRLF" value="%0A" />
+
+ <condition property="mvn" value="mvn.cmd">
+ <isset property="isWindows" />
+ </condition>
+ <property name="mvn" value="mvn" />
+
+ <available file="${env.ANT_HOME}/lib/${apache.rat.jar}"
+ type="file"
+ property="apache.rat.found"/>
+ <available file="${env.ANT_HOME}/lib/${apache.rat.tasks.jar}"
+ type="file"
+ property="apache.rat.tasks.found"/>
+
+ <fail message="The release version number is not set. Specify -Drelease.version=<release version (e.g. 0.9.0, 1.0.0, etc)>"
+ unless="release.version"/>
+
+ <target name="install-rat" depends="install-rat.jar,install-rat.tasks.jar" />
+ <target name="install-rat.jar" unless="apache.rat.found">
+ <get src="${apache.rat.url}/${apache.rat.jar}" dest="${env.ANT_HOME}/lib/${apache.rat.jar}" />
+ </target>
+ <target name="install-rat.tasks.jar" unless="apache.rat.tasks.found">
+ <get src="${apache.rat.url}/${apache.rat.tasks.jar}" dest="${env.ANT_HOME}/lib/${apache.rat.tasks.jar}" />
+ </target>
+
+ <target name="rat-taskdef" description="Rat taskdef">
+ <typedef resource="org/apache/rat/anttasks/antlib.xml"
+ uri="antlib:org.apache.rat.anttasks"
+ classpathref="anttask.classpath"/>
+ </target>
+
+ <target name="checkout_tag" if="tag" >
+ <exec executable="${git}" dir="${basedir}" failonerror="true" >
+ <arg value="checkout" />
+ <arg value="${tag}" />
+ </exec>
+ </target>
+
+ <target name="Royale_Compiler_Build_Tools_Release_Step_002" depends="get-temp-folder,download-artifacts,unzip-artifacts,build-source,validate-bits">
+ </target>
+ <target name="get-temp-folder">
+ <input
+ message="Enter a temporary folder to store the downloaded artifacts:"
+ addproperty="artifactfolder"/>
+ <mkdir dir="${artifactfolder}" />
+ <available file="${artifactfolder}"
+ type="dir"
+ property="artifact.folder.found"/>
+ <fail message="Could not create artifact folder"
+ unless="artifact.folder.found"/>
+ </target>
+
+ <target name="download-artifacts" if="artifactfolder">
+ <get src="http://apacheroyaleci2.westus2.cloudapp.azure.com:8080/job/Royale_Compiler_Build_Tools_Release_Step_002/lastSuccessfulBuild/artifact/*zip*/archive.zip" dest="${artifactfolder}/archive.zip" />
+ </target>
+
+ <target name="unzip-artifacts" if="artifactfolder">
+ <mkdir dir="${artifactfolder}/artifacts" />
+ <unzip src="${artifactfolder}/archive.zip" dest="${artifactfolder}/artifacts"/>
+ </target>
+
+ <target name="build-source" >
+ <mkdir dir="${artifactfolder}/sources" />
+ <unzip src="${artifactfolder}/artifacts/archive/compiler-build-tools/target/local-release-dir/org/apache/royale/compiler/compiler-build-tools/${release.version}/compiler-build-tools-${release.version}-source-release.zip" dest="${artifactfolder}/sources" >
+ <cutdirsmapper dirs="1" />
+ </unzip>
+
+ <!-- build the main project -->
+ <exec executable="${mvn}" dir="${artifactfolder}/sources" failonerror="true" >
+ <arg value="clean" />
+ <arg value="install" />
+ <arg value="-Proyale-release" />
+ </exec>
+ </target>
+
+ <target name="get-artifact-folder" unless="artifactfolder">
+ <input
+ message="Enter the temporary folder to store the downloaded artifacts:"
+ addproperty="artifactfolder"/>
+ <available file="${artifactfolder}"
+ type="dir"
+ property="artifact.folder.found"/>
+ <fail message="Could not find artifact folder"
+ unless="artifact.folder.found"/>
+ </target>
+
+ <target name="validate-bits" depends="get-artifact-folder,compare-jars">
+ </target>
+
+ <target name="write-out-maven-jars-list">
+ <delete file="${artifactfolder}/jars.txt" />
+ <!-- this is a comma-delimited, no spaces, no-line-breaks list used to decide which jars
+ to skip in the rat-check of the binaries and which jars to examine before approval -->
+ <property name="jars-list" value="compiler-build-tools"/>
+ <echo file="${artifactfolder}/jars.txt" message="${jars-list}"/>
+ </target>
+
+ <target name="compare-jars" depends="write-out-maven-jars-list">
+ <!-- comma delimited list, no spaces, not one file per line -->
+ <copy file="${artifactfolder}/jars.txt" tofile="${artifactfolder}/loop.txt" />
+ <ant antfile="releasesteps.xml" target="loopOnce" inheritAll="false" >
+ <property name="artifactfolder" value="${artifactfolder}" />
+ <property name="release.version" value="${release.version}" />
+ </ant>
+ </target>
+
+ <target name="get-jar-version" >
+ <property name="jar.version" value="${release.version}" />
+ </target>
+
+ <target name="loopOnce" >
+ <!-- make a copy of the list so we can munge it to
+ get the first item in the list -->
+ <delete file="${artifactfolder}/loop1.txt" />
+ <copy file="${artifactfolder}/loop.txt" tofile="${artifactfolder}/loop1.txt" />
+ <loadfile srcFile="${artifactfolder}/loop.txt" property="checkiflast" />
+ <condition property="islast" value="true">
+ <not>
+ <contains string="${checkiflast}" substring="," />
+ </not>
+ </condition>
+ <antcall target="notlast" />
+ <antcall target="lastone" />
+ </target>
+ <target name="notlast" unless="islast">
+ <loadfile srcFile="${artifactfolder}/loop1.txt" property="echoFile" />
+ <replaceregexp file="${artifactfolder}/loop1.txt" match="^(.*),(.*)" replace="\2" />
+ <loadfile srcFile="${artifactfolder}/loop1.txt" property="thisFile" />
+ <antcall target="compare_files" />
+ <replaceregexp file="${artifactfolder}/loop.txt" match="^(.*),(.*)" replace="\1" />
+ <ant antfile="releasesteps.xml" target="loopOnce" inheritAll="false">
+ <property name="artifactfolder" value="${artifactfolder}" />
+ <property name="release.version" value="${release.version}" />
+ </ant>
+ </target>
+ <target name="lastone" if="islast">
+ <loadfile srcFile="${artifactfolder}/loop1.txt" property="thisFile" />
+ <antcall target="compare_files" />
+ <delete file="${artifactfolder}/loop.txt" />
+ <delete file="${artifactfolder}/loop1.txt" />
+ </target>
+
+ <target name="compare_files" depends="get-jar-version">
+ <echo>comparing ${thisFile}-${jar.version}</echo>
+ <fail message="${artifactfolder}/artifacts/archive/compiler-build-tools/target/local-release-dir/org/apache/royale/compiler/${thisFile}/${jar.version}/${thisFile}-${jar.version}.jar does not exist" >
+ <condition>
+ <not>
+ <resourceexists><file file="${artifactfolder}/artifacts/archive/compiler-build-tools/target/local-release-dir/org/apache/royale/compiler/${thisFile}/${jar.version}/${thisFile}-${jar.version}.jar"/></resourceexists>
+ </not>
+ </condition>
+ </fail>
+ <fail message="${artifactfolder}/sources/target/${thisFile}-${jar.version}.jar does not exist" >
+ <condition>
+ <not>
+ <resourceexists><file file="${artifactfolder}/sources/target/${thisFile}-${jar.version}.jar"/></resourceexists>
+ </not>
+ </condition>
+ </fail>
+ <condition property="filesmatch" value="true">
+ <filesmatch file1="${artifactfolder}/artifacts/archive/compiler-build-tools/target/local-release-dir/org/apache/royale/compiler/${thisFile}/${jar.version}/${thisFile}-${jar.version}.jar"
+ file2="${artifactfolder}/sources/target/${thisFile}-${jar.version}.jar" />
+ </condition>
+ <fail message="${thisFile}-${jar.version}.jar does not match" unless="filesmatch" />
+ </target>
+
+ <target name="Royale_Compiler_Build_Tools_Release_Step_002_Sign" depends="get-artifact-folder">
+ <fail message="release.version not specified"
+ unless="release.version"/>
+ <antcall target="sign-file" >
+ <param name="file" value="${artifactfolder}/artifacts/archive/compiler-build-tools/target/local-release-dir/org/apache/royale/compiler/compiler-build-tools/${release.version}/compiler-build-tools-${release.version}-source-release.zip" />
+ </antcall>
+ <antcall target="sign-jar-artifacts" >
+ <param name="jarname" value="compiler-build-tools" />
+ </antcall>
+ </target>
+
+ <target name="sign-jar-artifacts">
+ <antcall target="sign-file" >
+ <param name="file" value="${artifactfolder}/artifacts/archive/compiler-build-tools/target/local-release-dir/org/apache/royale/compiler/${jarname}/${release.version}/${jarname}-${release.version}.pom" />
+ </antcall>
+ <antcall target="sign-file" >
+ <param name="file" value="${artifactfolder}/artifacts/archive/compiler-build-tools/target/local-release-dir/org/apache/royale/compiler/${jarname}/${release.version}/${jarname}-${release.version}-javadoc.jar" />
+ </antcall>
+ <antcall target="sign-file" >
+ <param name="file" value="${artifactfolder}/artifacts/archive/compiler-build-tools/target/local-release-dir/org/apache/royale/compiler/${jarname}/${release.version}/${jarname}-${release.version}-sources.jar" />
+ </antcall>
+ <antcall target="sign-file" >
+ <param name="file" value="${artifactfolder}/artifacts/archive/compiler-build-tools/target/local-release-dir/org/apache/royale/compiler/${jarname}/${release.version}/${jarname}-${release.version}.jar" />
+ </antcall>
+ </target>
+
+
+
+ <target name="sign-file">
+ <exec executable="gpg">
+ <arg value="--armor" />
+ <arg value="--output" />
+ <arg value="${file}.asc" />
+ <arg value="--detach-sig" />
+ <arg value="${file}" />
+ </exec>
+ </target>
+
+ <target name="Royale_Compiler_Build_Tools_Release_Step_002_Upload" depends="get-artifact-folder">
+ <fail message="release.version not specified"
+ unless="release.version"/>
+ <exec executable="${mvn}" failonerror="true" >
+ <arg value="wagon:upload" />
+ <arg value="-X" />
+ <arg value="-Dwagon.fromDir=${artifactfolder}/artifacts/archive/compiler-build-tools/target/local-release-dir" />
+ <arg value="-Dwagon.url=https://repository.apache.org/service/local/staging/deploy/maven2" />
+ <arg value="-Dwagon.serverId=apache.releases.https" />
+ <arg value="-Dwagon.includes=**" />
+ </exec>
+ <!--<antcall target="check-new-version" />-->
+ <!--<antcall target="post-on-dist" />-->
+ </target>
+
+ <!--
+ <target name="Release_Step_004_Post_Artifacts_To_Dist" depends="credentials" description="Perform required release approval steps">-->
+ <target name="Release_Step_004_Post_Artifacts_To_Dist" description="Perform required release approval steps">
+ <antcall target="check-new-version" />
+ <mkdir dir="${dist.dev}/royale/compiler-build-tools/${release.version}/rc${rc}/binaries" />
+ <get url="https://repository.apache.org/content/repositories/orgapacheroyale-${maven.folder.number}/compiler-build-tools/{release.version}/compiler-build-tools-${release.version}-source-release.zip"
+ todir="${dist.dev}/royale/compiler-build-tools/${release.version}/rc${rc}" >
+ </get>
+ <get url="https://repository.apache.org/content/repositories/orgapacheroyale-${maven.folder.number}/compiler-build-tools/{release.version}/compiler-build-tools-${release.version}-source-release.zip.asc"
+ todir="${dist.dev}/royale/compiler-build-tools/${release.version}/rc${rc}" >
+ </get>
+ <checksum />
+ <get url="https://repository.apache.org/content/repositories/orgapacheroyale-${maven.folder.number}/compiler-build-tools/{release.version}/compiler-build-tools-${release.version}.jar" todir="${dist.dev}/royale/compiler-build-tools/${release.version}/rc${rc}/binaries" >
+ </get>
+ <get url="https://repository.apache.org/content/repositories/orgapacheroyale-${maven.folder.number}/compiler-build-tools/{release.version}/compiler-build-tools-${release.version}.jar.asc" todir="${dist.dev}/royale/compiler-build-tools/${release.version}/rc${rc}/binaries" >
+ </get>
+ <checksum />
+<!--
+ <copy file="${basedir}/README" tofile="${dist.dev}/royale/compiler/${release.version}/rc${rc}/READme" />
+ -->
+ <copy file="${basedir}/ApproveCompilerBuildTools.xml" tofile="${dist.dev}/royale/compiler-build-tools/${release.version}/rc${rc}/ApproveCompilerBuildTools.xml" />
+ <exec executable="${svn}" dir="${dist.dev}/royale/compiler-build-tools" failonerror="true" >
+ <arg value="update" />
+ </exec>
+ <exec executable="${svn}" dir="${dist.dev}/royale/compiler-build-tools" failonerror="true" >
+ <arg value="add" />
+ <arg value="${dist.dev}/royale/compiler-build-tools/${release.version}/rc${rc}" />
+ </exec>
+ </target>
+
+ <target name="tag_release" unless="tag" >
+ <exec executable="${git}" dir="${basedir}" failonerror="true" >
+ <arg value="tag" />
+ <arg value="-a" />
+ <arg value="apache-royale-compiler-${release.version}-rc${rc}" />
+ <arg value="-m" />
+ <arg value=""rc${rc} of apache-royale-compiler-${release.version}"" />
+ </exec>
+ <exec executable="${git}" dir="${basedir}" failonerror="true" >
+ <arg value="push" />
+ <arg value="--tags" />
+ </exec>
+ </target>
+
+ <target name="credentials" depends="get-username,get-password">
+ <echo>${apache.username}</echo>
+ <echo>${apache.password}</echo>
+ </target>
+ <target name="get-username" unless="apache.username" >
+ <input
+ message="Enter Apache account username:"
+ addproperty="apache.username"/>
+ <condition property="have.username">
+ <not>
+ <equals trim="true" arg1="" arg2="${apache.username}"/>
+ </not>
+ </condition>
+ <fail message="The apache.username property is not set. It should be the username for Apache SVN and Git."
+ unless="have.username"/>
+ </target>
+ <target name="get-password" unless="apache.password" >
+ <input
+ message="Enter Apache account password:"
+ addproperty="apache.password"/>
+ <condition property="have.password">
+ <not>
+ <equals trim="true" arg1="" arg2="${apache.password}"/>
+ </not>
+ </condition>
+ <fail message="The apache.password property is not set. It should be the password for Apache SVN and Git."
+ unless="have.password"/>
+ </target>
+
+
+ <target name="check-new-version" description="check if svn folder needs to be added" >
+ <condition property="version.folder" value="${dist.dev}/royale/compiler/${release.version}" >
+ <not>
+ <available file="${dist.dev}/royale/compiler/${release.version}" />
+ </not>
+ </condition>
+ <antcall target="add-version-folder" />
+ </target>
+
+ <target name="add-version-folder" description="adds svn folder if needed" if="version.folder" >
+ <mkdir dir="${version.folder}" />
+ <exec executable="${svn}" dir="${dist.dev}/royale/compiler" failonerror="true" >
+ <arg value="add" />
+ <arg value="${version.folder}" />
+ </exec>
+ </target>
+
+ <target name="release" depends="credentials" >
+ <available file="${svn.dist.release}"
+ type="dir"
+ property="dist.release" value="${svn.dist.release}" />
+
+ <fail message="The svn.dist.release property is not set to the working copy for https://dist.apache.org/repos/dist/release."
+ unless="dist.release"/>
+
+ <exec executable="${svn}" dir="${dist.release}/royale" failonerror="true" >
+ <arg value="update" />
+ </exec>
+ <exec executable="${svn}" dir="${dist.release}/royale/compiler" failonerror="true" >
+ <arg value="mv" />
+ <arg value="${dist.dev}/royale/compiler/${release.version}/rc${rc}" />
+ <arg value="${dist.release}/royale/compiler/${release.version}" />
+ </exec>
+ <exec executable="${svn}" dir="${dist.release}/.." failonerror="true" >
+ <arg value="commit" />
+ <arg value="--username" />
+ <arg value="${apache.username}" />
+ <arg value="--password" />
+ <arg value="${apache.password}" />
+ <arg value="-m" />
+ <arg value="Apache Royale Compiler ${release.version}" />
+ </exec>
+ <antcall target="release.tag" />
+ <exec executable="${git}" dir="${basedir}" failonerror="true" >
+ <arg value="push" />
+ <arg value="--tags" />
+ </exec>
+ <echo>Wait at least 24 hours before running update-installer-config-release target</echo>
+ </target>
+
+ <target name="release.tag" >
+ <condition property="tag" value="apache-royale-compiler-${release.version}-rc${rc}">
+ <not>
+ <isset property="tag" />
+ </not>
+ </condition>
+ <exec executable="${git}" dir="${basedir}" failonerror="true" output="${basedir}/taghash.txt">
+ <arg value="show" />
+ <arg value="${tag}" />
+ </exec>
+ <replaceregexp file="${basedir}/taghash.txt" match="(.*).commit (.*).Author(.*)" replace="\2" byline="false" flags="s" />
+ <loadfile srcFile="${basedir}/taghash.txt" property="releasehash" />
+ <exec executable="${git}" dir="${basedir}" failonerror="true" >
+ <arg value="tag" />
+ <arg value="-a" />
+ <arg value="apache-royale-compiler-${release.version}" />
+ <arg value="${releasehash}" />
+ <arg value="-m" />
+ <arg value=""Official release of apache-royale-compiler-${release.version}"" />
+ </exec>
+ </target>
+</project>
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
index a0ed8eb..eab8c53 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
@@ -192,19 +192,35 @@
MemberAccessExpressionNode xmlNode = (MemberAccessExpressionNode)leftSide;
if (node.getNodeID() == ASTNodeID.Op_AssignId)
{
+ boolean wrapQuotes = true;
getWalker().walk(xmlNode.getLeftOperandNode());
IExpressionNode rightSide = xmlNode.getRightOperandNode();
if (rightSide instanceof UnaryOperatorAtNode)
{
write(".setAttribute('");
- getWalker().walk(((UnaryOperatorAtNode)rightSide).getChild(0));
+ getWalker().walk(rightSide.getChild(0));
}
+ else if (rightSide instanceof IDynamicAccessNode && ((IDynamicAccessNode) rightSide).getLeftOperandNode().getNodeID() == ASTNodeID.Op_AtID) {
+ write(".setAttribute(");
+ wrapQuotes = false;
+ getWalker().walk(((IDynamicAccessNode)rightSide).getRightOperandNode());
+ }
+ else if (rightSide instanceof INamespaceAccessExpressionNode) {
+ write(".setChild(");
+ write("new QName(");
+ getWalker().walk(((INamespaceAccessExpressionNode) rightSide).getLeftOperandNode());
+ write(",'");
+ getWalker().walk(((INamespaceAccessExpressionNode) rightSide).getRightOperandNode());
+ write("')");
+ wrapQuotes = false;
+ }
else
{
write(".setChild('");
getWalker().walk(rightSide);
}
- write("', ");
+ if (wrapQuotes) write("'");
+ write(", ");
getWalker().walk(node.getRightOperandNode());
write(ASEmitterTokens.PAREN_CLOSE);
return;
@@ -240,7 +256,7 @@
return;
}
}
- else if (isDynamicAccess && ((JSRoyaleEmitter)getEmitter()).isXML((IExpressionNode)lnode))
+ else if (isDynamicAccess && ((JSRoyaleEmitter)getEmitter()).isXMLish((IExpressionNode)lnode))
{
DynamicAccessNode dyn = (DynamicAccessNode)rnode;
ITypeDefinition type = dyn.getRightOperandNode().resolveType(getProject());
@@ -368,7 +384,7 @@
DynamicAccessNode dyn = (DynamicAccessNode)leftSide;
IExpressionNode dynLeft = dyn.getLeftOperandNode();
ITypeDefinition type = dyn.getRightOperandNode().resolveType(getProject());
- if (((JSRoyaleEmitter)getEmitter()).isXML(dynLeft) && type.isInstanceOf("String", getProject()))
+ if (((JSRoyaleEmitter)getEmitter()).isXMLish(dynLeft)/* && !SemanticUtils.isNumericType(type, getProject())*/) //type.isInstanceOf("String", getProject())
{
String field;
if (node.getNodeID() == ASTNodeID.Op_AssignId)
@@ -377,17 +393,19 @@
IExpressionNode rightSide = dyn.getRightOperandNode();
if (rightSide instanceof UnaryOperatorAtNode)
{
- write(".setAttribute('");
- field = fjs.stringifyNode(((UnaryOperatorAtNode)rightSide).getChild(0));
- field = field.replace("\"", ""); // remove wrapping double-quotes
+ write(".setAttribute(");
+ field = fjs.stringifyNode((rightSide).getChild(0));
}
else
{
- write(".setChild('");
+ write(".setChild(");
field = fjs.stringifyNode(rightSide);
- field = field.replace("\"", ""); // remove wrapping double-quotes
}
- write(field + "', ");
+ if (field.startsWith("\"") && field.endsWith("\"")) {
+ // remove wrapping double-quotes and swap to single quotes
+ field = "'" + field.substring(1, field.length() - 1) + "'";
+ }
+ write(field + ", ");
getWalker().walk(node.getRightOperandNode());
write(ASEmitterTokens.PAREN_CLOSE);
return;
@@ -576,7 +594,7 @@
getWalker().walk(node.getRightOperandNode());
if (node.getNodeID() == ASTNodeID.Op_InID &&
- ((JSRoyaleEmitter)getEmitter()).isXML(node.getRightOperandNode()))
+ ((JSRoyaleEmitter)getEmitter()).isXMLish(node.getRightOperandNode()))
{
write(".elementNames()");
}
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
index bdcb9c6..878b69a 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
@@ -72,7 +72,7 @@
if (leftOperandNode instanceof MemberAccessExpressionNode)
isXML = fjs.isLeftNodeXMLish((MemberAccessExpressionNode)leftOperandNode);
else if (leftOperandNode instanceof IExpressionNode)
- isXML = fjs.isXML((IExpressionNode)leftOperandNode);
+ isXML = fjs.isXMLish((IExpressionNode)leftOperandNode);
if (leftOperandNode instanceof MemberAccessExpressionNode)
isProxy = fjs.isProxy((MemberAccessExpressionNode)leftOperandNode);
else if (leftOperandNode instanceof IExpressionNode)
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FieldEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FieldEmitter.java
index ca635e3..7e81916 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FieldEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FieldEmitter.java
@@ -232,6 +232,18 @@
write(ASEmitterTokens.BLOCK_CLOSE);
writeNewline(ASEmitterTokens.SEMICOLON);
}
+ //Fix for references to the target : the following empty declaration is required for @lends to work in Object.defineProperties below
+ //otherwise references elsewhere in code to the target can be renamed (and therefore do not work)
+ if (getEmitter().getDocEmitter() instanceof IJSGoogDocEmitter)
+ {
+ ((IJSGoogDocEmitter) getEmitter().getDocEmitter()).emitFieldDoc(node, def, getProject());
+ }
+ write(className);
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ writeFieldName(node, fjs);
+ write(ASEmitterTokens.SEMICOLON);
+ writeNewline();
+ writeNewline();
write(IASLanguageConstants.Object);
write(ASEmitterTokens.MEMBER_ACCESS);
write(JSEmitterTokens.DEFINE_PROPERTIES);
@@ -303,7 +315,7 @@
}
if (vnode != null && !isComplexInitializedStatic)
{
- getModel().inStaticInitializer = ndef.isStatic();
+ getModel().inStaticInitializer = ndef.isStatic() || isPackageOrFileMember;
String vnodeString = getEmitter().stringifyNode(vnode);
if (ndef.isStatic() && vnode instanceof FunctionCallNode)
{
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/ForEachEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/ForEachEmitter.java
index 2994707..4920604 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/ForEachEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/ForEachEmitter.java
@@ -104,7 +104,7 @@
boolean isProxy = false;
if (obj.getNodeID() == ASTNodeID.IdentifierID)
{
- if (((JSRoyaleEmitter)getEmitter()).isXML((IdentifierNode)obj))
+ if (((JSRoyaleEmitter)getEmitter()).isXMLish((IdentifierNode)obj))
{
write(".elementNames()");
isXML = true;
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/MemberAccessEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
index 51d45b5..274cd4f 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
@@ -108,7 +108,7 @@
if (leftNode instanceof MemberAccessExpressionNode)
isXML = fjs.isLeftNodeXMLish(leftNode);
else if (leftNode != null)
- isXML = fjs.isXML(leftNode);
+ isXML = fjs.isXMLish(leftNode);
if (!isXML) {
if (leftNode instanceof MemberAccessExpressionNode)
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleEmitter.java
index 0a05318..0626e79 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleEmitter.java
@@ -709,7 +709,7 @@
{
if (getModel().inStaticInitializer)
if (!staticUsedNames.contains(name) && !NativeUtils.isJSNative(name)
- && isGoogProvided(name) && !getModel().getCurrentClass().getQualifiedName().equals(name)
+ && isGoogProvided(name) && (getModel().getCurrentClass() == null || !getModel().getCurrentClass().getQualifiedName().equals(name))
&& (getModel().primaryDefinitionQName == null
|| !getModel().primaryDefinitionQName.equals(name)))
staticUsedNames.add(name);
@@ -1245,7 +1245,7 @@
}
else if (node.getChild(0).getChild(0).getNodeID() == ASTNodeID.IdentifierID)
{
- if (isXML((IdentifierNode)(node.getChild(0).getChild(0))))
+ if (isXMLish((IdentifierNode)(node.getChild(0).getChild(0))))
{
if (ASNodeUtils.hasParenOpen(node))
write(ASEmitterTokens.PAREN_OPEN);
@@ -1288,13 +1288,15 @@
IExpressionNode rightNode = obj.getRightOperandNode();
String s = stringifyNode(obj.getLeftOperandNode());
- boolean needsQuotes = rightNode.getNodeID() != ASTNodeID.Op_AtID;
+ boolean avoidMethodAccess = (rightNode instanceof IDynamicAccessNode && ((IDynamicAccessNode) rightNode).getLeftOperandNode().getNodeID() == ASTNodeID.Op_AtID);
+ boolean needsQuotes = rightNode.getNodeID() != ASTNodeID.Op_AtID
+ && !avoidMethodAccess;
write(s);
write(".removeChild(");
if (needsQuotes)
write("'");
else
- write(s + ".");
+ if (!avoidMethodAccess) write(s + ".");
s = stringifyNode(rightNode);
write(s);
if (needsQuotes)
@@ -1353,6 +1355,15 @@
DynamicAccessNode parentNode = (DynamicAccessNode)node.getParent();
if (EmitterUtils.writeE4xFilterNode(getWalker().getProject(), getModel(), node))
write("node.");
+ if (node.getParent().getParent() != null
+ && node.getParent().getParent().getParent() != null
+ && node.getParent().getParent().getParent().getNodeID() == ASTNodeID.Op_DeleteID) {
+ write ("'@' + ");
+ //example : delete myXML.@[MyConst];
+ //output myXML.removeChild('@' + MyConst) <-- variant is handled in emulation class
+ getWalker().walk(parentNode.getRightOperandNode());
+ return;
+ }
write("attribute(");
getWalker().walk(parentNode.getRightOperandNode());
write(")");
@@ -1474,9 +1485,9 @@
* @param obj
* @return
*/
- public boolean isXML(IExpressionNode obj)
+ public boolean isXMLish(IExpressionNode obj)
{
- return EmitterUtils.isXML(obj, getWalker().getProject());
+ return EmitterUtils.isXMLish(obj, getWalker().getProject());
}
public MemberAccessExpressionNode getLastMAEInChain(MemberAccessExpressionNode node)
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java
index 2e03bf2..0be6c74 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/EmitterUtils.java
@@ -751,16 +751,16 @@
* @param obj
* @return
*/
- public static boolean isXML(IExpressionNode obj, ICompilerProject project )
+ public static boolean isXMLish(IExpressionNode obj, ICompilerProject project )
{
// See if the left side is XML or XMLList
IDefinition leftDef = obj.resolveType(project);
if (leftDef == null && obj.getNodeID() == ASTNodeID.MemberAccessExpressionID)
{
- return isXML(((MemberAccessExpressionNode)obj).getLeftOperandNode(), project);
+ return isXMLish(((MemberAccessExpressionNode)obj).getLeftOperandNode(), project);
}
else if (leftDef != null && leftDef.getBaseName().equals("*") && obj instanceof DynamicAccessNode) {
- return isXML(((DynamicAccessNode)obj).getLeftOperandNode(), project);
+ return isXMLish(((DynamicAccessNode)obj).getLeftOperandNode(), project);
}
return SemanticUtils.isXMLish(leftDef, project);
}
@@ -785,7 +785,7 @@
IExpressionNode leftNode = obj.getLeftOperandNode();
IExpressionNode rightNode = obj.getRightOperandNode();
ASTNodeID rightID = rightNode.getNodeID();
- if (rightID == ASTNodeID.IdentifierID)
+ if (rightID == ASTNodeID.IdentifierID || (rightID == ASTNodeID.NamespaceAccessExpressionID && rightNode.getChild(1).getNodeID() == ASTNodeID.IdentifierID))
{
IDefinition rightDef = rightNode.resolveType(project);
if (rightDef != null)
@@ -800,6 +800,8 @@
}
else if (rightID == ASTNodeID.Op_AtID)
return true;
+ else if (rightNode instanceof IDynamicAccessNode && ((IDynamicAccessNode) rightNode).getLeftOperandNode().getNodeID() == ASTNodeID.Op_AtID)
+ return true;
return false;
}
@@ -904,7 +906,7 @@
boolean isXML = leftNode instanceof MemberAccessExpressionNode
&& isLeftNodeXMLish((MemberAccessExpressionNode) leftNode, project);
if (!isXML) {
- isXML = leftNode instanceof IExpressionNode && isXML((IExpressionNode)leftNode, project);
+ isXML = leftNode instanceof IExpressionNode && isXMLish((IExpressionNode)leftNode, project);
}
if (isXML) {
//check argumentsNode
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/MXMLEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/MXMLEmitter.java
index cdef6e0..9e550fa 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/MXMLEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/MXMLEmitter.java
@@ -27,36 +27,7 @@
import org.apache.royale.compiler.internal.codegen.as.ASEmitterTokens;
import org.apache.royale.compiler.projects.ICompilerProject;
import org.apache.royale.compiler.tree.as.IASNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLArrayNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLBooleanNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLClassDefinitionNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLClassNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLComponentNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLDataBindingNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLDeclarationsNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLDocumentNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLEmbedNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLEventSpecifierNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLFactoryNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLFileNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLImplementsNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLInstanceNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLIntNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLLiteralNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLMetadataNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLNumberNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLObjectNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLPropertySpecifierNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLRemoteObjectMethodNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLRemoteObjectNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLScriptNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLStringNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLStyleSpecifierNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLUintNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLVectorNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLWebServiceNode;
-import org.apache.royale.compiler.tree.mxml.IMXMLWebServiceOperationNode;
+import org.apache.royale.compiler.tree.mxml.*;
import org.apache.royale.compiler.visitor.IBlockWalker;
import org.apache.royale.compiler.visitor.mxml.IMXMLBlockWalker;
@@ -294,6 +265,9 @@
@Override
public void emitBoolean(IMXMLBooleanNode node)
{
+ if (node.getChildCount()>0 && (node.getChild(0) instanceof IMXMLSingleDataBindingNode)) {
+ return; //@todo more investigation needed
+ }
emitAttributeValue(node);
}
diff --git a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleGlobalClasses.java b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleGlobalClasses.java
index d090658..bae6cd4 100644
--- a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleGlobalClasses.java
+++ b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleGlobalClasses.java
@@ -1098,7 +1098,7 @@
{
IBinaryOperatorNode node = (IBinaryOperatorNode)getNode("var a:XMLList = new XMLList();a[a.length()] = <foo/>;a[a.length()] = <baz/>;", IBinaryOperatorNode.class);
asBlockWalker.visitBinaryOperator(node);
- assertOut("a[a.length()] = new XML( '<foo/>')");
+ assertOut("a.setChild(a.length(), new XML( '<foo/>'))");
}
@Test
diff --git a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/mxml/royale/TestRoyaleMXMLScript.java b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/mxml/royale/TestRoyaleMXMLScript.java
index eb5713b..7767429 100644
--- a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/mxml/royale/TestRoyaleMXMLScript.java
+++ b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/mxml/royale/TestRoyaleMXMLScript.java
@@ -348,48 +348,48 @@
mxmlBlockWalker.visitDocument(dnode);
String appName = dnode.getQualifiedName();
String outTemplate = "/**\n" +
- " * AppName\n" +
- " *\n" +
- " * @fileoverview\n" +
- " *\n" +
- " * @suppress {checkTypes|accessControls}\n" +
- " */\n" +
- "\n" +
- "goog.provide('AppName');\n" +
- "\n" +
- "goog.require('org.apache.royale.core.Application');\n" +
- "goog.require('org.apache.royale.events.CloseEvent');\n" +
- "\n" +
- "\n" +
- "\n" +
- "/**\n" +
- " * @constructor\n" +
- " * @extends {org.apache.royale.core.Application}\n" +
- " */\n" +
- "AppName = function() {\n" +
- " AppName.base(this, 'constructor');\n" +
- " \n" +
- " /**\n" +
- " * @private\n" +
- " * @type {Array}\n" +
- " */\n" +
- " this.mxmldd;\n" +
- " \n" +
- " /**\n" +
- " * @private\n" +
- " * @type {Array}\n" +
- " */\n" +
- " this.mxmldp;\n" +
- "};\n" +
- "goog.inherits(AppName, org.apache.royale.core.Application);\n" +
- "\n" +
- "\n" +
- "/**\n" +
- " * Prevent renaming of class. Needed for reflection.\n" +
- " */\n" +
- "goog.exportSymbol('AppName', AppName);\n" +
- "\n" +
- "\n" +
+ " * AppName\n" +
+ " *\n" +
+ " * @fileoverview\n" +
+ " *\n" +
+ " * @suppress {checkTypes|accessControls}\n" +
+ " */\n" +
+ "\n" +
+ "goog.provide('AppName');\n" +
+ "\n" +
+ "goog.require('org.apache.royale.core.Application');\n" +
+ "goog.require('org.apache.royale.events.CloseEvent');\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "/**\n" +
+ " * @constructor\n" +
+ " * @extends {org.apache.royale.core.Application}\n" +
+ " */\n" +
+ "AppName = function() {\n" +
+ " AppName.base(this, 'constructor');\n" +
+ " \n" +
+ " /**\n" +
+ " * @private\n" +
+ " * @type {Array}\n" +
+ " */\n" +
+ " this.mxmldd;\n" +
+ " \n" +
+ " /**\n" +
+ " * @private\n" +
+ " * @type {Array}\n" +
+ " */\n" +
+ " this.mxmldp;\n" +
+ "};\n" +
+ "goog.inherits(AppName, org.apache.royale.core.Application);\n" +
+ "\n" +
+ "\n" +
+ "/**\n" +
+ " * Prevent renaming of class. Needed for reflection.\n" +
+ " */\n" +
+ "goog.exportSymbol('AppName', AppName);\n" +
+ "\n" +
+ "\n" +
"\n" +
"AppName.get__foo = function() {\n" +
" var value = org.apache.royale.events.CloseEvent.CLOSE;\n" +
@@ -399,6 +399,12 @@
"AppName.set__foo = function(value) {\n" +
" Object.defineProperty(AppName, 'foo', { value: value, writable: true });\n" +
"};\n" +
+ "/**\n" +
+ " * @export\n" +
+ " * @type {string}\n" +
+ " */\n" +
+ "AppName.foo;\n" +
+ "\n" +
"Object.defineProperties(AppName, /** @lends {AppName} */ {\n" +
"/**\n" +
" * @export\n" +
@@ -410,27 +416,27 @@
" configurable: true}});\n" +
"\n" +
"\n" +
- "/**\n" +
- " * Metadata\n" +
- " *\n" +
- " * @type {Object.<string, Array.<Object>>}\n" +
- " */\n" +
- "AppName.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'AppName', qName: 'AppName', kind: 'class' }] };\n" +
- "\n" +
- "\n" +
- "\n" +
- "/**\n" +
- " * Reflection\n" +
- " *\n" +
- " * @return {Object.<string, Function>}\n" +
- " */\n" +
- "AppName.prototype.ROYALE_REFLECTION_INFO = function () {\n" +
+ "/**\n" +
+ " * Metadata\n" +
+ " *\n" +
+ " * @type {Object.<string, Array.<Object>>}\n" +
+ " */\n" +
+ "AppName.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'AppName', qName: 'AppName', kind: 'class' }] };\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "/**\n" +
+ " * Reflection\n" +
+ " *\n" +
+ " * @return {Object.<string, Function>}\n" +
+ " */\n" +
+ "AppName.prototype.ROYALE_REFLECTION_INFO = function () {\n" +
" return {\n" +
- " variables: function () {\n" +
- " return {\n" +
- " '|foo': { type: 'String', get_set: function (/** * */ v) {return v !== undefined ? AppName.foo = v : AppName.foo;}}\n" +
- " };\n" +
- " },\n" +
+ " variables: function () {\n" +
+ " return {\n" +
+ " '|foo': { type: 'String', get_set: function (/** * */ v) {return v !== undefined ? AppName.foo = v : AppName.foo;}}\n" +
+ " };\n" +
+ " },\n" +
" methods: function () {\n" +
" return {\n" +
" 'AppName': { type: '', declaredBy: 'AppName'}\n" +
@@ -438,8 +444,8 @@
" }\n" +
" };\n" +
"};\n" +
- "\n" +
- "\n" ;
+ "\n" +
+ "\n" ;
assertOutWithMetadata(outTemplate.replaceAll("AppName", appName));
}
@@ -659,54 +665,61 @@
mxmlBlockWalker.visitDocument(dnode);
String appName = dnode.getQualifiedName();
String outTemplate = "/**\n" +
- " * AppName\n" +
- " *\n" +
- " * @fileoverview\n" +
- " *\n" +
- " * @suppress {checkTypes|accessControls}\n" +
- " */\n" +
- "\n" +
- "goog.provide('AppName');\n" +
- "\n" +
- "goog.require('org.apache.royale.core.Application');\n" +
- "goog.require('org.apache.royale.events.CloseEvent');\n" +
- "\n" +
- "\n" +
- "\n" +
- "/**\n" +
- " * @constructor\n" +
- " * @extends {org.apache.royale.core.Application}\n" +
- " */\n" +
- "AppName = function() {\n" +
- " AppName.base(this, 'constructor');\n" +
- " \n" +
- " /**\n" +
- " * @private\n" +
- " * @type {Array}\n" +
- " */\n" +
- " this.mxmldd;\n" +
- " \n" +
- " /**\n" +
- " * @private\n" +
- " * @type {Array}\n" +
- " */\n" +
- " this.mxmldp;\n" +
- "};\n" +
- "goog.inherits(AppName, org.apache.royale.core.Application);\n" +
- "\n" +
- "\n" +
- "/**\n" +
- " * Prevent renaming of class. Needed for reflection.\n" +
- " */\n" +
- "goog.exportSymbol('AppName', AppName);\n" +
- "\n" +
- "\n" +
+ " * AppName\n" +
+ " *\n" +
+ " * @fileoverview\n" +
+ " *\n" +
+ " * @suppress {checkTypes|accessControls}\n" +
+ " */\n" +
+ "\n" +
+ "goog.provide('AppName');\n" +
+ "\n" +
+ "goog.require('org.apache.royale.core.Application');\n" +
+ "goog.require('org.apache.royale.events.CloseEvent');\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "/**\n" +
+ " * @constructor\n" +
+ " * @extends {org.apache.royale.core.Application}\n" +
+ " */\n" +
+ "AppName = function() {\n" +
+ " AppName.base(this, 'constructor');\n" +
+ " \n" +
+ " /**\n" +
+ " * @private\n" +
+ " * @type {Array}\n" +
+ " */\n" +
+ " this.mxmldd;\n" +
+ " \n" +
+ " /**\n" +
+ " * @private\n" +
+ " * @type {Array}\n" +
+ " */\n" +
+ " this.mxmldp;\n" +
+ "};\n" +
+ "goog.inherits(AppName, org.apache.royale.core.Application);\n" +
+ "\n" +
+ "\n" +
+ "/**\n" +
+ " * Prevent renaming of class. Needed for reflection.\n" +
+ " */\n" +
+ "goog.exportSymbol('AppName', AppName);\n" +
+ "\n" +
+ "\n" +
"\n" +
"AppName.get__foo = function() {\n" +
" var value = org.apache.royale.events.CloseEvent.CLOSE;\n" +
" Object.defineProperty(AppName, 'foo', { value: value, writable: false });\n" +
" return value;\n" +
"};\n" +
+ "/**\n" +
+ " * @export\n" +
+ " * @const\n" +
+ " * @type {string}\n" +
+ " */\n" +
+ "AppName.foo;\n" +
+ "\n" +
"Object.defineProperties(AppName, /** @lends {AppName} */ {\n" +
"/**\n" +
" * @export\n" +
@@ -718,21 +731,21 @@
" configurable: true}});\n" +
"\n" +
"\n" +
- "/**\n" +
- " * Metadata\n" +
- " *\n" +
- " * @type {Object.<string, Array.<Object>>}\n" +
- " */\n" +
- "AppName.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'AppName', qName: 'AppName', kind: 'class' }] };\n" +
- "\n" +
- "\n" +
- "\n" +
- "/**\n" +
- " * Reflection\n" +
- " *\n" +
- " * @return {Object.<string, Function>}\n" +
- " */\n" +
- "AppName.prototype.ROYALE_REFLECTION_INFO = function () {\n" +
+ "/**\n" +
+ " * Metadata\n" +
+ " *\n" +
+ " * @type {Object.<string, Array.<Object>>}\n" +
+ " */\n" +
+ "AppName.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'AppName', qName: 'AppName', kind: 'class' }] };\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "/**\n" +
+ " * Reflection\n" +
+ " *\n" +
+ " * @return {Object.<string, Function>}\n" +
+ " */\n" +
+ "AppName.prototype.ROYALE_REFLECTION_INFO = function () {\n" +
" return {\n" +
" methods: function () {\n" +
" return {\n" +
@@ -741,8 +754,8 @@
" }\n" +
" };\n" +
"};\n" +
- "\n" +
- "\n" ;
+ "\n" +
+ "\n" ;
assertOutWithMetadata(outTemplate.replaceAll("AppName", appName));
}
diff --git a/pom.xml b/pom.xml
index d8ce643..ec35d03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -688,7 +688,17 @@
<artifactId>maven-release-plugin</artifactId>
<configuration>
<pushChanges>false</pushChanges>
+ <providerImplementations>
+ <git>jgit</git>
+ </providerImplementations>
</configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-jgit</artifactId>
+ <version>1.11.3-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
</plugin>
</plugins>
</pluginManagement>
diff --git a/royale-maven-plugin/src/main/java/org/apache/royale/maven/BaseMojo.java b/royale-maven-plugin/src/main/java/org/apache/royale/maven/BaseMojo.java
index 98ea54a..a72a0fb 100644
--- a/royale-maven-plugin/src/main/java/org/apache/royale/maven/BaseMojo.java
+++ b/royale-maven-plugin/src/main/java/org/apache/royale/maven/BaseMojo.java
@@ -281,9 +281,13 @@
List<String> args = new LinkedList<String>();
args.add("-load-config=" + configFile.getPath());
if(additionalCompilerOptions != null) {
- if (additionalCompilerOptions.contains("\n")) {
- additionalCompilerOptions = additionalCompilerOptions.replace("\n", "");
- }
+ //remove whitespace after any '=' or '+='
+ additionalCompilerOptions = additionalCompilerOptions.replaceAll("=\\s+", "=");
+ //remove whitespace before or after any ',' (this assumes that ',' is never part of a value assignment itself and is only used to separate list values in config settings)
+ additionalCompilerOptions = additionalCompilerOptions.replaceAll("\\s*,\\s*", ",");
+
+ //any explicit line separators can be resolved to a single separator (';') multiple sequential separators will be ignored if there are explicit ';' separators included below
+ additionalCompilerOptions = additionalCompilerOptions.replaceAll("(\\r\\n?|\\n)+", ";");
if (additionalCompilerOptions.contains(";"))
{
String[] options = additionalCompilerOptions.split(";");