You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cf...@apache.org on 2012/07/20 20:28:57 UTC

svn commit: r1363889 - in /incubator/flex/utilities/InstallApacheFlex: build.number build.properties build.xml src/InstallApacheFlex-app.xml

Author: cframpton
Date: Fri Jul 20 18:28:57 2012
New Revision: 1363889

URL: http://svn.apache.org/viewvc?rev=1363889&view=rev
Log:
Add update-version target which should be executed, once, and only once, when you change the app.  This will allow the app to be updated by the AIR installer.  If you execute the target more than once, the published build numbers will not be consecutive.  Add the Apache copyright to the InstallAppFlex-app.xml file.

Added:
    incubator/flex/utilities/InstallApacheFlex/build.number
Modified:
    incubator/flex/utilities/InstallApacheFlex/build.properties
    incubator/flex/utilities/InstallApacheFlex/build.xml
    incubator/flex/utilities/InstallApacheFlex/src/InstallApacheFlex-app.xml

Added: incubator/flex/utilities/InstallApacheFlex/build.number
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/InstallApacheFlex/build.number?rev=1363889&view=auto
==============================================================================
--- incubator/flex/utilities/InstallApacheFlex/build.number (added)
+++ incubator/flex/utilities/InstallApacheFlex/build.number Fri Jul 20 18:28:57 2012
@@ -0,0 +1,3 @@
+#Build Number for ANT. Do not edit!
+#Fri Jul 20 13:51:42 EDT 2012
+build.number=2

Modified: incubator/flex/utilities/InstallApacheFlex/build.properties
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/InstallApacheFlex/build.properties?rev=1363889&r1=1363888&r2=1363889&view=diff
==============================================================================
--- incubator/flex/utilities/InstallApacheFlex/build.properties (original)
+++ incubator/flex/utilities/InstallApacheFlex/build.properties Fri Jul 20 18:28:57 2012
@@ -18,6 +18,9 @@
 
 -->
 
+# nano version number is added by build script
+release.version=0.7
+
 #Flex Locations
 //FLEX_HOME=../ApacheFlex
 FLEX_HOME_WIN=C:/Program Files (x86)/Adobe/Adobe Flash Builder 4.6/sdks/4.6.0

Modified: incubator/flex/utilities/InstallApacheFlex/build.xml
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/InstallApacheFlex/build.xml?rev=1363889&r1=1363888&r2=1363889&view=diff
==============================================================================
--- incubator/flex/utilities/InstallApacheFlex/build.xml (original)
+++ incubator/flex/utilities/InstallApacheFlex/build.xml Fri Jul 20 18:28:57 2012
@@ -50,34 +50,64 @@
     </path>
     <taskdef resource="flexTasks.tasks" classpathref="flexTasks.path"/>
 
-    <target name="build" depends="init,packagenative,abortBuild,cleanup" description="compiles application"/>
+    <condition property="unsupportedOS">
+        <and>   
+            <os family="unix" />
+            <not>
+                <os family="mac" />
+            </not>
+       </and>
+    </condition>
     
-    <target name="init" depends="determineOS,clean,createDirs" description="Creates the deploy folders and sets app extension"/>
+    <!-- AIR package extension -->
+    <condition property="extension" value="exe">
+        <os family="windows" />
+    </condition>
+    <property name="extension" value="dmg"/>
+
+    <target name="build" depends="init,compile,packagenative,cleanup" description="Compiles and packages application"/>
+        
+    <target name="init" depends="clean,createDirs" description="Creates the deploy folders and sets app extension"/>
         
-    <target name="createDirs" unless="unsupportedOS">
+    <target name="clean" description="Cleans up old files.">
+        <delete dir="${BUILD_DIR}" failOnError="false" includeEmptyDirs="true" />
+        <delete dir="${RELEASE_DIR}" failOnError="false" includeEmptyDirs="true" />
+    </target>
+
+    <target name="cleanup" description="Cleans up old files.">
+        <delete dir="${BUILD_DIR}" failOnError="false" includeEmptyDirs="true" />
+    </target>
+
+    <target name="createDirs">
+        <echo message="************************************************************************************
+                ${line.separator}Execute the update-version target once, and only once, when you modifiy this app.
+                ${line.separatorThis will increment the version number to allow the app to be updated by the AIR installer.
+                ${line.separator}************************************************************************************"/>
         <mkdir dir="${BUILD_DIR}"/>
         <mkdir dir="${RELEASE_DIR}"/>
+        <echo message="FLEX_HOME is ${FLEX_HOME}"/>
     </target>
 
-    <target name="determineOS" description="Determine OS on which build is running so that we can create the correct native installer">
-        <condition property="unsupportedOS">
-            <and>   
-                <os family="unix" />
-                <not>
-                    <os family="mac" />
-                </not>
-           </and>
-        </condition>
-        <condition property="extension" value="exe">
-            <os family="windows" />
-        </condition>
-        <condition property="extension" value="dmg">
-            <os family="mac" />
-        </condition>
+    <!-- 
+        Run this target once, when you make a change to this app so that the AIR 
+        Installer will allow the app to be updated. The build.number property in the 
+        file build.property will be read and then incremented and the nano version number 
+        in the <version> tag in InstallApacheFlex-app.xml will be updated.
+    -->
+    <target name="update-version" description="Update the app version number so it will be updated.">
+        <buildnumber/>
+        <replaceregexp byline="true">
+            <regexp pattern="&lt;versionNumber&gt;([0-9\.]+)&lt;/versionNumber&gt;"/>
+            <substitution expression="&lt;versionNumber&gt;${release.version}.${build.number}&lt;/versionNumber&gt;"/>
+            <fileset dir="${SOURCE_DIR}">
+                <include name="${APP_NAME}-app.xml"/>
+            </fileset>
+        </replaceregexp>
     </target>
     
-    <target name="packagenative" depends="compile,certificate,packageair" unless="unsupportedOS"
+    <target name="packagenative" depends="certificate,packageair"
        description="Packages the AIR file from the build directory to create a native installer (exe/dmg) file">
+
        <java jar="${ADT}" fork="true"
            failonerror="true"
            maxmemory="512m">
@@ -90,14 +120,15 @@
    </target>
     
     <target name="abortBuild" if="unsupportedOS">
-        <echo>Unable to create a .exe or a .dmg file on this operating system.</echo>
-        <echo>You must use ADT on the same operating system as that of the native installer file you want to generate. 
-                So, to create an EXE file for Windows, run this build on Windows. To create a DMG file for Mac OS, run this 
-                build on Mac OS. 
-        </echo>
+        <fail>
+            Unable to create a .exe or a .dmg file on this operating system.
+            You must use ADT on the same operating system as that of the native installer file you want to generate. 
+            So, to create an EXE file for Windows, run this build on Windows. To create a DMG file for Mac OS, run this 
+            build on Mac OS.
+        </fail>
     </target>
 
-    <target name="compile" unless="unsupportedOS"
+    <target name="compile"
         description="Compiles the AIR application to a SWF file and places SWF in a temp directory to be packaged.">
         <mxmlc file="${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}"
             output="${BUILD_DIR}/${APP_NAME}.swf"
@@ -115,12 +146,12 @@
     </target>
 
     <!-- Make sure to use the same certificate each time so we can update the app. -->
-    <target name="certificate" unless="unsupportedOS">
+    <target name="certificate">
         <available file="${KEYSTORE}" property="certificate.exists"/>
         <antcall target="generate-certificate"/>
     </target>
 
-    <target name="generate-certificate" unless="certificate.exists">
+    <target name="generate-certificate" depends="abortBuild" unless="certificate.exists">
         <java jar="${ADT}" fork="true"
             failonerror="true">
             <arg value="-certificate"/>
@@ -138,7 +169,7 @@
         </java>
     </target>
 
-    <target name="packageair" unless="unsupportedOS"
+    <target name="packageair" depends="abortBuild"
         description="Packages the build SWF file from a temp directory to create an AIR file">
         <java jar="${ADT}" fork="true"
             failonerror="true"
@@ -161,14 +192,4 @@
             <arg value="${ASSETS_DIR}"/>
         </java>
     </target>
-    
-    <target name="clean" unless="unsupportedOS" description="Cleans up old files.">
-        <delete dir="${BUILD_DIR}" failOnError="false" includeEmptyDirs="true" />
-        <delete dir="${RELEASE_DIR}" failOnError="false" includeEmptyDirs="true" />
-    </target>
-
-    <target name="cleanup" description="Cleans up old files.">
-        <delete dir="${BUILD_DIR}" failOnError="false" includeEmptyDirs="true" />
-    </target>
-
 </project>
\ No newline at end of file

Modified: incubator/flex/utilities/InstallApacheFlex/src/InstallApacheFlex-app.xml
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/InstallApacheFlex/src/InstallApacheFlex-app.xml?rev=1363889&r1=1363888&r2=1363889&view=diff
==============================================================================
--- incubator/flex/utilities/InstallApacheFlex/src/InstallApacheFlex-app.xml (original)
+++ incubator/flex/utilities/InstallApacheFlex/src/InstallApacheFlex-app.xml Fri Jul 20 18:28:57 2012
@@ -55,7 +55,7 @@
 	<!-- <description></description> -->
 
 	<!-- Copyright information. Optional -->
-	<!-- <copyright></copyright> -->
+	<copyright>Copyright 2012 The Apache Software Foundation.</copyright>
 
 	<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
 	<!-- <publisherID></publisherID> -->