You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/12/03 07:19:14 UTC

[royale-asjs] 02/08: fail if SWF compile fails

This is an automated email from the ASF dual-hosted git repository.

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

commit 20afdb4fe92db7f5d7d1ff563954cea8baf3fcfa
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sun Dec 2 21:59:26 2018 -0800

    fail if SWF compile fails
---
 frameworks/projects/Basic/build.xml | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Basic/build.xml b/frameworks/projects/Basic/build.xml
index 5d50633..d8ab079 100644
--- a/frameworks/projects/Basic/build.xml
+++ b/frameworks/projects/Basic/build.xml
@@ -80,12 +80,19 @@
     </target>
     
     <target name="compile" description="Compiles .as files into .swc" if="env.AIR_HOME">
+        <!-- use antcall so that resultproperty can be used in other projects and
+         they don't collide when being run one after the other -->
+        <antcall target="compile-swf" />
+    </target>
+    
+    <target name="compile-swf">
         <echo message="Compiling libs/${ant.project.name}.swc"/>
         <echo message="ROYALE_HOME: ${ROYALE_HOME}"/>
         <echo message="ROYALE_SWF_COMPILER_HOME: ${ROYALE_SWF_COMPILER_HOME}"/>
         <echo message="ROYALE_COMPILER_HOME: ${ROYALE_COMPILER_HOME}"/>
         
-        <java jar="${ROYALE_COMPILER_HOME}/lib/compc.jar" fork="true" >
+        <java jar="${ROYALE_COMPILER_HOME}/lib/compc.jar" fork="true"
+            resultproperty="compcoutput">
             <jvmarg value="-Xmx384m" />
             <jvmarg value="-Dsun.io.useCanonCaches=false" />
             <jvmarg value="-Droyalelib=${ROYALE_HOME}/frameworks" />
@@ -99,6 +106,16 @@
             <arg value="-js-load-config=${ROYALE_HOME}/frameworks/js-config.xml" />
             <arg value="-js-load-config+=${basedir}/../../js/projects/${ant.project.name}JS/src/main/config/compile-js-config.xml" />
         </java>
+        <fail>
+            <condition>
+                <not>
+                    <or>
+                        <equals arg1="${compcoutput}" arg2="0" />
+                        <equals arg1="${compcoutput}" arg2="2" />
+                    </or>
+                </not>
+            </condition>
+        </fail>
     </target>
     
     <target name="check-compiler" depends="check-compiler-home,check-transpiler-home">