forked from iBurnApp/iBurn-2010
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
77 lines (66 loc) · 2.45 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0" ?>
<project name="iBurn" default="dist" basedir=".">
<!-- properties -->
<property name="app.name" value="iBurn" />
<property name="build.dir" value="bin" />
<property name="dist.dir" value="${build.dir}/dist" />
<property name="dist.apk" value="${app.name}-dist.apk" />
<property name="keystore" value="${basedir}/keystore/gaiagps.keystore" />
<property name="keystore.password" value="gaiagps2010" />
<property name="keystore.alias" value="gaiagps" />
<property name="unsigned.apk" value="${app.name}-unsigned.apk" />
<property name="nonzipaligned.apk" value="${app.name}-nonzipaligned.apk" />
<!-- delete everything in dist dir -->
<target name="clean">
<delete includeemptydirs="true" failonerror="false" verbose="false">
<fileset dir="${build.dir}">
<include name="**/*" />
</fileset>
</delete>
</target>
<!-- copy proj to dist dir -->
<target name="copy-source">
<copy todir="${build.dir}" overwrite="true" verbose="false">
<fileset dir="proj">
<exclude name="**/bin/**" />
<exclude name="**/gen/**" />
</fileset>
</copy>
</target>
<!-- fix packages in source java files and manifest.xml -->
<target name="update-source">
<!-- update manifest file -->
<replace file="${build.dir}/AndroidManifest.xml" token="android:debuggable="true"" value="android:debuggable="false"" summary="true" />
</target>
<!-- build apk -->
<target name="build" depends="clean, copy-source, update-source">
<ant dir="${build.dir}" />
<ant dir="${build.dir}" target="release" />
<exec executable="jarsigner" dir="${build.dir}/bin">
<arg value="-keystore" />
<arg value="${keystore}" />
<arg value="-storepass" />
<arg value="${keystore.password}" />
<arg value="-signedjar" />
<arg value="${nonzipaligned.apk}" />
<arg value="${unsigned.apk}" />
<arg value="${keystore.alias}" />
</exec>
<exec executable="zipalign" dir="${build.dir}/bin">
<arg value="-f" />
<arg value="-v" />
<arg value="4" />
<arg value="${nonzipaligned.apk}" />
<arg value="${dist.apk}" />
</exec>
</target>
<!-- build and create final dist apk -->
<target name="dist">
<!-- build -->
<antcall target="build" />
<!-- ceate dist dir -->
<mkdir dir="${dist.dir}" />
<!-- move dist apk from build dir to dist dir -->
<move file="${build.dir}/bin/${dist.apk}" todir="${dist.dir}" />
</target>
</project>