0
|
1 <?xml version="1.0" encoding="UTF-8"?>
|
|
2 <project name="510Connectbot" default="help">
|
|
3
|
|
4 <!-- The local.properties file is created and updated by the 'android' tool.
|
|
5 It contains the path to the SDK. It should *NOT* be checked into
|
|
6 Version Control Systems. -->
|
|
7 <loadproperties srcFile="local.properties" />
|
|
8
|
|
9 <!-- The ant.properties file can be created by you. It is only edited by the
|
|
10 'android' tool to add properties to it.
|
|
11 This is the place to change some Ant specific build properties.
|
|
12 Here are some properties you may want to change/update:
|
|
13
|
|
14 source.dir
|
|
15 The name of the source directory. Default is 'src'.
|
|
16 out.dir
|
|
17 The name of the output directory. Default is 'bin'.
|
|
18
|
|
19 For other overridable properties, look at the beginning of the rules
|
|
20 files in the SDK, at tools/ant/build.xml
|
|
21
|
|
22 Properties related to the SDK location or the project target should
|
|
23 be updated using the 'android' tool with the 'update' action.
|
|
24
|
|
25 This file is an integral part of the build system for your
|
|
26 application and should be checked into Version Control Systems.
|
|
27
|
|
28 -->
|
|
29 <property file="ant.properties" />
|
|
30
|
|
31 <!-- The project.properties file is created and updated by the 'android'
|
|
32 tool, as well as ADT.
|
|
33 This file is an integral part of the build system for your
|
|
34 application and should be checked into Version Control Systems. -->
|
|
35 <loadproperties srcFile="project.properties" />
|
|
36
|
|
37 <!-- quick check on sdk.dir -->
|
|
38 <fail
|
|
39 message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
|
|
40 unless="sdk.dir"
|
|
41 />
|
|
42
|
|
43
|
|
44 <!-- extension targets. Uncomment the ones where you want to do custom work
|
|
45 in between standard targets -->
|
|
46 <!--
|
|
47 <target name="-pre-build">
|
|
48 </target>
|
|
49 <target name="-pre-compile">
|
|
50 </target>
|
|
51
|
|
52 /* This is typically used for code obfuscation.
|
|
53 Compiled code location: ${out.classes.absolute.dir}
|
|
54 If this is not done in place, override ${out.dex.input.absolute.dir} */
|
|
55 <target name="-post-compile">
|
|
56 </target>
|
|
57 -->
|
|
58
|
|
59 <!-- Import the actual build file.
|
|
60
|
|
61 To customize existing targets, there are two options:
|
|
62 - Customize only one target:
|
|
63 - copy/paste the target into this file, *before* the
|
|
64 <import> task.
|
|
65 - customize it to your needs.
|
|
66 - Customize the whole content of build.xml
|
|
67 - copy/paste the content of the rules files (minus the top node)
|
|
68 into this file, replacing the <import> task.
|
|
69 - customize to your needs.
|
|
70
|
|
71 ***********************
|
|
72 ****** IMPORTANT ******
|
|
73 ***********************
|
|
74 In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
|
75 in order to avoid having your file be overridden by tools such as "android update project"
|
|
76 -->
|
|
77 <!-- version-tag: custom -->
|
|
78 <import file="${sdk.dir}/tools/ant/build.xml" />
|
|
79
|
|
80 <!-- Begin custom ConnectBot stuff -->
|
|
81
|
|
82 <!-- Output directory for .po files. -->
|
|
83 <property name="locale.dir" value="locale" />
|
|
84
|
|
85 <!-- Default args to pass to a2po for .po generation. -->
|
|
86 <property name="a2po.args" value="--groups strings --template fortune/fortune.pot --layout 'fortune/fortune-%(locale)s.po'"/>
|
|
87
|
|
88 <!-- File names for launchpad translations. -->
|
|
89 <property name="launchpad.export.file" value="launchpad-export.tar.gz"/>
|
|
90 <property name="launchpad.import.file" value="launchpad-import.tar.gz"/>
|
|
91
|
|
92 <target name="-pre-build" depends="update-version"/>
|
|
93
|
|
94 <target name="help">
|
|
95 <!-- displays starts at col 13
|
|
96 |13 80| -->
|
|
97 <echo>Android Ant Build. Available targets:</echo>
|
|
98 <echo> help: Displays this help.</echo>
|
|
99 <echo> clean: Removes output files created by other targets.</echo>
|
|
100 <echo> compile: Compiles project's .java files into .class files.</echo>
|
|
101 <echo> debug: Builds the application and signs it with a debug key.</echo>
|
|
102 <echo> release: Builds the application. The generated apk file must be</echo>
|
|
103 <echo> signed before it is published.</echo>
|
|
104 <echo> install: Installs/reinstalls the debug package onto a running</echo>
|
|
105 <echo> emulator or device.</echo>
|
|
106 <echo> If the application was previously installed, the</echo>
|
|
107 <echo> signatures must match.</echo>
|
|
108 <echo> uninstall: Uninstalls the application from a running emulator or</echo>
|
|
109 <echo> device.</echo>
|
|
110 <echo> translations-import: Import translations from a Launchpad-style</echo>
|
|
111 <echo> Rosetta translation.</echo>
|
|
112 <echo> translations-export: Export translations to a Launchpad-style</echo>
|
|
113 <echo> Rosetta translation.</echo>
|
|
114
|
|
115 </target>
|
|
116
|
|
117 <target name="update-version" description="Updates the Version.java file with current Mercurial revision">
|
|
118 <echo>Updating resources with Mercurial revision and build date...</echo>
|
|
119
|
|
120 <tstamp>
|
|
121 <format property="build.date" pattern="yyyy-MM-dd" />
|
|
122 </tstamp>
|
|
123
|
|
124 <!-- Get the version name from the android manifest, will en up in property ${manifest.android:versionName} -->
|
|
125 <xpath input="AndroidManifest.xml" expression="/manifest/@android:versionName"
|
|
126 output="manifest.version.name" />
|
|
127
|
|
128 <!-- find global id of the current mercurial commit -->
|
|
129 <exec executable="hg" outputproperty="hg.revision">
|
|
130 <arg line="id --id"/>
|
|
131 </exec>
|
|
132
|
|
133 <!-- write out to res/values/version.xml -->
|
|
134 <echo file="${resource.absolute.dir}/values/version.xml" encoding="utf8"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
135 <resources>
|
|
136 <string name="msg_version" translatable="false">${ant.project.name} ${manifest.version.name} (${hg.revision} ${build.date})</string>
|
|
137 </resources>
|
|
138 ]]></echo>
|
|
139
|
|
140 <echo>Updated "msg_version" to: ${ant.project.name} ${manifest.version.name} (${hg.revision} ${build.date})</echo>
|
|
141 </target>
|
|
142
|
|
143 <!-- Translations come from launchpad.net and are placed in the
|
|
144 locale/ subdirectory. -->
|
|
145 <target name="translations-import">
|
|
146 <untar src="${launchpad.export.file}" dest="${locale.dir}" compression="gzip"/>
|
|
147 <exec executable="a2po" failonerror="true">
|
|
148 <arg value="import"/>
|
|
149 <arg line="${a2po.args}"/>
|
|
150 </exec>
|
|
151 </target>
|
|
152
|
|
153 <!-- Translations are to be uploaded to launchpad.net as a tar ball
|
|
154 created from the locale/ subdirectory. -->
|
|
155 <target name="translations-export">
|
|
156 <exec executable="a2po" failonerror="true">
|
|
157 <arg value="export"/>
|
|
158 <arg line="${a2po.args}"/>
|
|
159 </exec>
|
|
160 <tar destfile="${launchpad.import.file}"
|
|
161 compression="gzip"
|
|
162 basedir="${locale.dir}"
|
|
163 includes="**/*.pot **/*.po" />
|
|
164 </target>
|
|
165
|
|
166 <target name="-check-ndk">
|
|
167 <fail
|
|
168 message="ndk.dir is missing. Make sure to put it in local.properties"
|
|
169 unless="ndk.dir"
|
|
170 />
|
|
171 </target>
|
|
172
|
|
173 <target name="native-build" depends="-check-ndk">
|
|
174 <exec executable="${ndk.dir}/ndk-build" failonerror="true" />
|
|
175 </target>
|
|
176
|
|
177 <target name="native-clean" depends="-check-ndk">
|
|
178 <exec executable="${ndk.dir}/ndk-build" failonerror="true">
|
|
179 <arg value="clean" />
|
|
180 </exec>
|
|
181 </target>
|
|
182
|
|
183 <property name="lint" location="${android.tools.dir}/lint${bat}" />
|
|
184
|
|
185 <target name="lint-xml">
|
|
186 <exec executable="${lint}">
|
|
187 <arg value="--xml" />
|
|
188 <arg value="lint-results.xml" />
|
|
189 <arg path="${basedir}" />
|
|
190 </exec>
|
|
191 </target>
|
|
192
|
|
193 <target name="lint-html">
|
|
194 <exec executable="${lint}">
|
|
195 <arg value="--html" />
|
|
196 <arg value="lint-results.html" />
|
|
197 <arg path="${basedir}" />
|
|
198 </exec>
|
|
199 </target>
|
|
200
|
|
201 <!-- End custom ConnectBot stuff -->
|
|
202
|
|
203 </project>
|