1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-12 04:25:08 -05:00

Make release builds include the version number from the manifest

This commit is contained in:
Jesse Vincent 2009-11-24 17:51:56 +00:00
parent d035a0eee9
commit 8ef734c1bd

View File

@ -122,12 +122,22 @@
<os family="windows"/> <os family="windows"/>
</condition> </condition>
<!-- A bloody hack, but a useful and quick one -->
<target name="get-version">
<exec executable="perl" failonerror="true" outputproperty="version-code" errorproperty="version-error">
<!-- yes, ant needs &quot; for " in doublequoted strings. -->
<arg line="-ne'/android:versionCode.*?=.*?&quot;(\d+)&quot;/ ? print $1 : undef ' AndroidManifest.xml" />
</exec>
<echo>Building version number ${version-code}</echo>
</target>
<!-- The final package file to generate --> <!-- The final package file to generate -->
<target name="filenames" depends="get-version">
<property name="out-debug-package" value="${out-folder}/${ant.project.name}-debug.apk"/> <property name="out-debug-package" value="${out-folder}/${ant.project.name}-debug.apk"/>
<property name="out-unsigned-package" value="${out-folder}/${ant.project.name}-unsigned.apk"/> <property name="out-unsigned-package" value="${out-folder}/${ant.project.name}-unsigned.apk"/>
<property name="out-signed-package" value="${out-folder}/${ant.project.name}-signed.apk"/> <property name="out-signed-package" value="${out-folder}/${ant.project.name}-signed.apk"/>
<property name="out-zipaligned-package" value="${out-folder}/${ant.project.name}-signed-zipaligned.apk"/> <property name="out-zipaligned-package" value="${out-folder}/${ant.project.name}-signed-zipaligned-${version-code}.apk"/>
</target>
<!-- Tools --> <!-- Tools -->
<condition property="exe" value=".exe" else=""><os family="windows"/></condition> <condition property="exe" value=".exe" else=""><os family="windows"/></condition>
@ -136,7 +146,7 @@
<!-- rules --> <!-- rules -->
<!-- Create the output directories if they don't exist yet. --> <!-- Create the output directories if they don't exist yet. -->
<target name="dirs"> <target name="dirs" depends="filenames">
<echo>Creating output directories if needed...</echo> <echo>Creating output directories if needed...</echo>
<mkdir dir="${resource-folder}" /> <mkdir dir="${resource-folder}" />
<mkdir dir="${external-libs-folder}" /> <mkdir dir="${external-libs-folder}" />