Context-detection API for Android developed as a university project
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

build-impl.xml 35KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. *** GENERATED FROM project.xml - DO NOT EDIT ***
  4. *** EDIT ../build.xml INSTEAD ***
  5. For the purpose of easier reading the script
  6. is divided into following sections:
  7. - initialization
  8. - compilation
  9. - jar
  10. - execution
  11. - debugging
  12. - javadoc
  13. - junit compilation
  14. - junit execution
  15. - junit debugging
  16. - cleanup
  17. -->
  18. <project xmlns:androidproject1="http://www.netbeans.org/ns/android-project/1" basedir=".." default="default" name="ContextAnalyser-impl">
  19. <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
  20. <!--
  21. ======================
  22. INITIALIZATION SECTION
  23. ======================
  24. -->
  25. <target name="-pre-init">
  26. <!-- Empty placeholder for easier customization. -->
  27. <!-- You can override this target in the ../build.xml file. -->
  28. </target>
  29. <target depends="-pre-init" name="-init-private">
  30. <property file="nbproject/private/config.properties"/>
  31. <property file="nbproject/private/configs/${config}.properties"/>
  32. <property file="nbproject/private/private.properties"/>
  33. </target>
  34. <target depends="-pre-init,-init-private" name="-init-user">
  35. <property file="${user.properties.file}"/>
  36. <!-- The two properties below are usually overridden -->
  37. <!-- by the active platform. Just a fallback. -->
  38. <property name="default.javac.source" value="1.4"/>
  39. <property name="default.javac.target" value="1.4"/>
  40. </target>
  41. <target depends="-pre-init,-init-private,-init-user" name="-init-project">
  42. <property file="nbproject/configs/${config}.properties"/>
  43. <property file="nbproject/project.properties"/>
  44. </target>
  45. <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
  46. <androidproject1:property name="platform.home" value="platforms.${platform.active}.home"/>
  47. <androidproject1:property name="platform.bootcp" value="platforms.${platform.active}.bootclasspath"/>
  48. <androidproject1:property name="platform.bootcp0" value="platforms.${platform.active}.bootclasspath0"/>
  49. <androidproject1:property name="platform.bootcp1" value="platforms.${platform.active}.bootclasspath1"/>
  50. <androidproject1:property name="aapt" value="platforms.${platform.active}.aapt"/>
  51. <androidproject1:property name="adb" value="platforms.${platform.active}.adb"/>
  52. <androidproject1:property name="dx" value="platforms.${platform.active}.dx"/>
  53. <androidproject1:property name="emulator" value="platforms.${platform.active}.emulator"/>
  54. <androidproject1:property name="apkbuilder" value="platforms.${platform.active}.apkbuilder"/>
  55. <condition property="bootclasspath1.available">
  56. <and>
  57. <isset property="platforms.${platform.active}.bootclasspath1"/>
  58. <not>
  59. <equals arg1="${platform.bootcp1}" arg2="" trim="true"/>
  60. </not>
  61. </and>
  62. </condition>
  63. <condition property="no.bootclasspath1.available">
  64. <not>
  65. <isset property="bootclasspath1.available"/>
  66. </not>
  67. </condition>
  68. <condition property="assets.available">
  69. <and>
  70. <isset property="${assets.dir}"/>
  71. <not>
  72. <equals arg1="${assets.dir}" arg2="" trim="true"/>
  73. </not>
  74. <available file="${assets.dir}" property="assets.available"/>
  75. </and>
  76. </condition>
  77. <available file="${manifest.file}" property="manifest.available"/>
  78. <condition property="have.tests">
  79. <or>
  80. <available file="${test.src.dir}"/>
  81. </or>
  82. </condition>
  83. <condition property="have.sources">
  84. <or>
  85. <available file="${src.dir}"/>
  86. </or>
  87. </condition>
  88. <condition property="netbeans.home+have.tests">
  89. <and>
  90. <isset property="netbeans.home"/>
  91. <isset property="have.tests"/>
  92. </and>
  93. </condition>
  94. <condition property="no.javadoc.preview">
  95. <and>
  96. <isset property="javadoc.preview"/>
  97. <isfalse value="${javadoc.preview}"/>
  98. </and>
  99. </condition>
  100. <property name="run.jvmargs" value=""/>
  101. <property name="javac.compilerargs" value=""/>
  102. <property name="work.dir" value="${basedir}"/>
  103. <condition property="no.deps">
  104. <and>
  105. <istrue value="${no.dependencies}"/>
  106. </and>
  107. </condition>
  108. <property name="javac.debug" value="true"/>
  109. <property name="javadoc.preview" value="true"/>
  110. <property name="application.args" value=""/>
  111. <property name="source.encoding" value="${file.encoding}"/>
  112. <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
  113. <and>
  114. <isset property="javadoc.encoding"/>
  115. <not>
  116. <equals arg1="${javadoc.encoding}" arg2=""/>
  117. </not>
  118. </and>
  119. </condition>
  120. <property name="javadoc.encoding.used" value="${source.encoding}"/>
  121. <property name="includes" value="**"/>
  122. <property name="excludes" value=""/>
  123. <property name="do.depend" value="false"/>
  124. <condition property="do.depend.true">
  125. <istrue value="${do.depend}"/>
  126. </condition>
  127. <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
  128. <and>
  129. <isset property="jaxws.endorsed.dir"/>
  130. <available file="nbproject/jaxws-build.xml"/>
  131. </and>
  132. </condition>
  133. <property name="screen.skin" value="HVGA"/>
  134. <property name="emulator.options" value=""/>
  135. <property name="android.target.device" value=""/>
  136. <condition property="do.start.app.false">
  137. <and>
  138. <isset property="do.start.app"/>
  139. <isfalse value="${do.start.app}"/>
  140. </and>
  141. </condition>
  142. </target>
  143. <target name="-post-init">
  144. <!-- Empty placeholder for easier customization. -->
  145. <!-- You can override this target in the ../build.xml file. -->
  146. </target>
  147. <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
  148. <fail unless="src.dir">Must set src.dir</fail>
  149. <fail unless="test.src.dir">Must set test.src.dir</fail>
  150. <fail unless="build.dir">Must set build.dir</fail>
  151. <fail unless="dist.dir">Must set dist.dir</fail>
  152. <fail unless="build.classes.dir">Must set build.classes.dir</fail>
  153. <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
  154. <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
  155. <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
  156. <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
  157. <fail unless="dist.apk">Must set dist.apk</fail>
  158. </target>
  159. <target name="-init-macrodef-property">
  160. <macrodef name="property" uri="http://www.netbeans.org/ns/android-project/1">
  161. <attribute name="name"/>
  162. <attribute name="value"/>
  163. <sequential>
  164. <property name="@{name}" value="${@{value}}"/>
  165. </sequential>
  166. </macrodef>
  167. </target>
  168. <target name="-init-macrodef-javac">
  169. <macrodef name="javac" uri="http://www.netbeans.org/ns/android-project/1">
  170. <attribute default="${src.dir}" name="srcdir"/>
  171. <attribute default="${build.classes.dir}" name="destdir"/>
  172. <attribute default="${javac.classpath}" name="classpath"/>
  173. <attribute default="${includes}" name="includes"/>
  174. <attribute default="${excludes}" name="excludes"/>
  175. <attribute default="${javac.debug}" name="debug"/>
  176. <attribute default="" name="sourcepath"/>
  177. <element name="customize" optional="true"/>
  178. <sequential>
  179. <javac bootclasspath="${platform.bootcp}" debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
  180. <classpath>
  181. <path path="@{classpath}"/>
  182. </classpath>
  183. <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
  184. <customize/>
  185. </javac>
  186. </sequential>
  187. </macrodef>
  188. <macrodef name="depend" uri="http://www.netbeans.org/ns/android-project/1">
  189. <attribute default="${src.dir}" name="srcdir"/>
  190. <attribute default="${build.classes.dir}" name="destdir"/>
  191. <attribute default="${javac.classpath}" name="classpath"/>
  192. <sequential>
  193. <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
  194. <classpath>
  195. <path path="@{classpath}"/>
  196. </classpath>
  197. </depend>
  198. </sequential>
  199. </macrodef>
  200. <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/android-project/1">
  201. <attribute default="${build.classes.dir}" name="destdir"/>
  202. <sequential>
  203. <fail unless="javac.includes">Must set javac.includes</fail>
  204. <pathconvert pathsep="," property="javac.includes.binary">
  205. <path>
  206. <filelist dir="@{destdir}" files="${javac.includes}"/>
  207. </path>
  208. <globmapper from="*.java" to="*.class"/>
  209. </pathconvert>
  210. <delete>
  211. <files includes="${javac.includes.binary}"/>
  212. </delete>
  213. </sequential>
  214. </macrodef>
  215. </target>
  216. <target name="-init-macrodef-junit">
  217. <macrodef name="junit" uri="http://www.netbeans.org/ns/android-project/1">
  218. <attribute default="${includes}" name="includes"/>
  219. <attribute default="${excludes}" name="excludes"/>
  220. <attribute default="**" name="testincludes"/>
  221. <sequential>
  222. <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
  223. <batchtest todir="${build.test.results.dir}">
  224. <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  225. <filename name="@{testincludes}"/>
  226. </fileset>
  227. </batchtest>
  228. <classpath>
  229. <path path="${run.test.classpath}"/>
  230. </classpath>
  231. <syspropertyset>
  232. <propertyref prefix="test-sys-prop."/>
  233. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  234. </syspropertyset>
  235. <formatter type="brief" usefile="false"/>
  236. <formatter type="xml"/>
  237. <jvmarg line="${run.jvmargs}"/>
  238. </junit>
  239. </sequential>
  240. </macrodef>
  241. </target>
  242. <target name="-init-macrodef-nbjpda">
  243. <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/android-project/1">
  244. <attribute default="${main.activity}" name="name"/>
  245. <attribute default="${debug.classpath}" name="classpath"/>
  246. <attribute default="" name="stopclassname"/>
  247. <sequential>
  248. <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
  249. <classpath>
  250. <path path="@{classpath}"/>
  251. </classpath>
  252. <bootclasspath>
  253. <path path="${platform.bootcp}"/>
  254. </bootclasspath>
  255. </nbjpdastart>
  256. </sequential>
  257. </macrodef>
  258. <macrodef name="nbjpdaconnect" uri="http://www.netbeans.org/ns/android-project/1">
  259. <attribute default="${main.activity}" name="name"/>
  260. <attribute default="${debug.classpath}" name="classpath"/>
  261. <sequential>
  262. <nbjpdaconnect address="${local.debug.port}" name="@{name}" transport="dt_socket">
  263. <classpath>
  264. <path path="@{classpath}"/>
  265. </classpath>
  266. <bootclasspath>
  267. <path path="${platform.bootcp}"/>
  268. </bootclasspath>
  269. </nbjpdaconnect>
  270. </sequential>
  271. </macrodef>
  272. <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/android-project/1">
  273. <attribute default="${build.classes.dir}" name="dir"/>
  274. <sequential>
  275. <nbjpdareload>
  276. <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
  277. </nbjpdareload>
  278. </sequential>
  279. </macrodef>
  280. </target>
  281. <target name="-init-debug-args">
  282. <property name="version-output" value="java version &quot;${ant.java.version}"/>
  283. <condition property="have-jdk-older-than-1.4">
  284. <or>
  285. <contains string="${version-output}" substring="java version &quot;1.0"/>
  286. <contains string="${version-output}" substring="java version &quot;1.1"/>
  287. <contains string="${version-output}" substring="java version &quot;1.2"/>
  288. <contains string="${version-output}" substring="java version &quot;1.3"/>
  289. </or>
  290. </condition>
  291. <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
  292. <istrue value="${have-jdk-older-than-1.4}"/>
  293. </condition>
  294. </target>
  295. <target depends="-init-debug-args" name="-init-macrodef-debug">
  296. <macrodef name="debug" uri="http://www.netbeans.org/ns/android-project/1">
  297. <attribute default="${main.activity}" name="classname"/>
  298. <attribute default="${debug.classpath}" name="classpath"/>
  299. <element name="customize" optional="true"/>
  300. <sequential>
  301. <java classname="@{classname}" dir="${work.dir}" fork="true">
  302. <jvmarg line="${debug-args-line}"/>
  303. <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
  304. <jvmarg line="${run.jvmargs}"/>
  305. <classpath>
  306. <path path="@{classpath}"/>
  307. </classpath>
  308. <syspropertyset>
  309. <propertyref prefix="run-sys-prop."/>
  310. <mapper from="run-sys-prop.*" to="*" type="glob"/>
  311. </syspropertyset>
  312. <customize/>
  313. </java>
  314. </sequential>
  315. </macrodef>
  316. </target>
  317. <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug" name="init"/>
  318. <!--
  319. ===================
  320. COMPILATION SECTION
  321. ===================
  322. -->
  323. <target depends="init" name="deps-jar" unless="no.deps"/>
  324. <target depends="init,deps-jar" name="-pre-pre-compile">
  325. <mkdir dir="${build.classes.dir}"/>
  326. </target>
  327. <target name="-pre-compile">
  328. <!-- Empty placeholder for easier customization. -->
  329. <!-- You can override this target in the ../build.xml file. -->
  330. </target>
  331. <target if="do.depend.true" name="-compile-depend">
  332. <androidproject1:depend/>
  333. </target>
  334. <target depends="init,-pre-pre-compile,-pre-compile" name="-res-compile" unless="bootclasspath1.available">
  335. <exec executable="${aapt}" failonerror="true">
  336. <arg value="package"/>
  337. <arg value="-m"/>
  338. <arg value="-J"/>
  339. <arg value="${src.dir}"/>
  340. <arg value="-M"/>
  341. <arg value="AndroidManifest.xml"/>
  342. <arg value="-S"/>
  343. <arg value="${resource.dir}"/>
  344. <arg value="-I"/>
  345. <arg value="${platform.bootcp}"/>
  346. </exec>
  347. </target>
  348. <target depends="init,-pre-pre-compile,-pre-compile" if="bootclasspath1.available" name="-res-compile1">
  349. <exec executable="${aapt}" failonerror="true">
  350. <arg value="package"/>
  351. <arg value="-m"/>
  352. <arg value="-J"/>
  353. <arg value="${src.dir}"/>
  354. <arg value="-M"/>
  355. <arg value="AndroidManifest.xml"/>
  356. <arg value="-S"/>
  357. <arg value="${resource.dir}"/>
  358. <arg value="-I"/>
  359. <arg value="${platform.bootcp0}"/>
  360. <arg value="-I"/>
  361. <arg value="${platform.bootcp1}"/>
  362. </exec>
  363. </target>
  364. <target depends="init,deps-jar,-pre-pre-compile,-pre-compile" name="-idl-compile"/>
  365. <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
  366. <androidproject1:javac/>
  367. <copy todir="${build.classes.dir}">
  368. <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  369. </copy>
  370. </target>
  371. <target name="-post-compile">
  372. <!-- Empty placeholder for easier customization. -->
  373. <!-- You can override this target in the ../build.xml file. -->
  374. </target>
  375. <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-res-compile,-res-compile1,-idl-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  376. <target name="-pre-compile-single">
  377. <!-- Empty placeholder for easier customization. -->
  378. <!-- You can override this target in the ../build.xml file. -->
  379. </target>
  380. <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
  381. <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  382. <androidproject1:force-recompile/>
  383. <androidproject1:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
  384. </target>
  385. <target name="-post-compile-single">
  386. <!-- Empty placeholder for easier customization. -->
  387. <!-- You can override this target in the ../build.xml file. -->
  388. </target>
  389. <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  390. <!--
  391. ====================
  392. JAR BUILDING SECTION
  393. ====================
  394. -->
  395. <target depends="init" name="-pre-pre-jar">
  396. <dirname file="${dist.apk}" property="dist.apk.dir"/>
  397. <mkdir dir="${dist.apk.dir}"/>
  398. </target>
  399. <target name="-pre-jar">
  400. <!-- Empty placeholder for easier customization. -->
  401. <!-- You can override this target in the ../build.xml file. -->
  402. </target>
  403. <target name="-post-jar">
  404. <!-- Empty placeholder for easier customization. -->
  405. <!-- You can override this target in the ../build.xml file. -->
  406. </target>
  407. <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-dex">
  408. <exec executable="${dx}" failonerror="true">
  409. <arg value="--dex"/>
  410. <arg value="--output=${basedir}/${intermediate.dex}"/>
  411. <arg value="--positions=lines"/>
  412. <arg path="${build.classes.dir}"/>
  413. </exec>
  414. </target>
  415. <target depends="init,compile,-pre-pre-jar,-pre-jar" if="assets.available" name="-package-res-and-assets" unless="bootclasspath1.available">
  416. <exec executable="${aapt}" failonerror="true">
  417. <arg value="package"/>
  418. <arg value="-f"/>
  419. <arg value="-M"/>
  420. <arg value="AndroidManifest.xml"/>
  421. <arg value="-S"/>
  422. <arg value="${resource.dir}"/>
  423. <arg value="-A"/>
  424. <arg value="${asset.dir}"/>
  425. <arg value="-I"/>
  426. <arg value="${platform.bootcp}"/>
  427. <arg value="-F"/>
  428. <arg value="${dist.apk}_"/>
  429. </exec>
  430. </target>
  431. <target depends="init,compile,-pre-pre-jar,-pre-jar" if="assets.available" name="-package-res-and-assets1" unless="no.bootclasspath1.available">
  432. <exec executable="${aapt}" failonerror="true">
  433. <arg value="package"/>
  434. <arg value="-f"/>
  435. <arg value="-M"/>
  436. <arg value="AndroidManifest.xml"/>
  437. <arg value="-S"/>
  438. <arg value="${resource.dir}"/>
  439. <arg value="-A"/>
  440. <arg value="${asset.dir}"/>
  441. <arg value="-I"/>
  442. <arg value="${platform.bootcp0}"/>
  443. <arg value="-I"/>
  444. <arg value="${platform.bootcp1}"/>
  445. <arg value="-F"/>
  446. <arg value="${dist.apk}_"/>
  447. </exec>
  448. </target>
  449. <target depends="init,compile,-pre-pre-jar,-pre-jar" if="no.bootclasspath1.available" name="-package-res-no-assets" unless="assets.available">
  450. <exec executable="${aapt}" failonerror="true">
  451. <arg value="package"/>
  452. <arg value="-f"/>
  453. <arg value="-M"/>
  454. <arg value="AndroidManifest.xml"/>
  455. <arg value="-S"/>
  456. <arg value="${resource.dir}"/>
  457. <arg value="-I"/>
  458. <arg value="${platform.bootcp}"/>
  459. <arg value="-F"/>
  460. <arg value="${dist.apk}_"/>
  461. </exec>
  462. </target>
  463. <target depends="init,compile,-pre-pre-jar,-pre-jar" if="bootclasspath1.available" name="-package-res-no-assets1" unless="assets.available">
  464. <exec executable="${aapt}" failonerror="true">
  465. <arg value="package"/>
  466. <arg value="-f"/>
  467. <arg value="-M"/>
  468. <arg value="AndroidManifest.xml"/>
  469. <arg value="-S"/>
  470. <arg value="${resource.dir}"/>
  471. <arg value="-I"/>
  472. <arg value="${platform.bootcp0}"/>
  473. <arg value="-I"/>
  474. <arg value="${platform.bootcp1}"/>
  475. <arg value="-F"/>
  476. <arg value="${dist.apk}_"/>
  477. </exec>
  478. </target>
  479. <target depends="init,compile,-pre-pre-jar,-pre-jar,-dex,-package-res-and-assets,-package-res-no-assets,-package-res-and-assets1,-package-res-no-assets1" name="-package-dex">
  480. <dirname file="${intermediate.dex}" property="package-dex.dex.folder"/>
  481. <basename file="${intermediate.dex}" property="package-dex.dex.file"/>
  482. <zip destfile="${dist.apk}_" update="true">
  483. <fileset dir="${package-dex.dex.folder}" includes="${package-dex.dex.file}"/>
  484. </zip>
  485. </target>
  486. <target depends="init,-package-res-and-assets,-package-res-no-assets,-package-dex" name="-sign">
  487. <exec executable="${apkbuilder}" failonerror="true">
  488. <arg value="${basedir}/${dist.apk}"/>
  489. <arg value="-z"/>
  490. <arg value="${basedir}/${dist.apk}_"/>
  491. </exec>
  492. <delete file="${dist.apk}_"/>
  493. </target>
  494. <target depends="init,compile,-pre-jar,-dex,-package-res-and-assets,-package-res-no-assets,-package-dex,-sign,-post-jar" description="Build JAR." name="jar"/>
  495. <!--
  496. =================
  497. EXECUTION SECTION
  498. =================
  499. -->
  500. <target depends="init,compile,jar,-start-emulator,-wait-for-emulator,-install-app,-run-app" description="Run a main activity." name="run"/>
  501. <target depends="init,compile,jar,-start-emulator,-wait-for-emulator,-install-app" name="-run-app" unless="do.start.app.false">
  502. <taskdef classname="org.netbeans.modules.android.ant.AndroidManifestParse" classpath="${libs.AndroidAntTasks.classpath}" name="android-manifest-parse"/>
  503. <android-manifest-parse mainActivityProperty="main.activity" manifestFile="AndroidManifest.xml"/>
  504. <echo message="About to start ${main.component}/${main.activity}"/>
  505. <exec executable="${adb}">
  506. <arg line="${android.target.device}"/>
  507. <arg value="shell"/>
  508. <arg value="am start -n ${main.component}/${main.activity}"/>
  509. </exec>
  510. </target>
  511. <target depends="init,compile,jar" name="-emulator-running">
  512. <exec executable="${adb}" outputproperty="emulator-running.out" resultproperty="is.emulator.running.tmp">
  513. <arg line="${android.target.device}"/>
  514. <arg value="shell"/>
  515. <arg value="date"/>
  516. </exec>
  517. <condition property="is.emulator.running">
  518. <not>
  519. <isfailure code="${is.emulator.running.tmp}"/>
  520. </not>
  521. </condition>
  522. </target>
  523. <target depends="init,compile,jar,-emulator-running" name="-start-emulator" unless="is.emulator.running">
  524. <exec executable="${adb}">
  525. <arg value="kill-server"/>
  526. </exec>
  527. <fail unless="android.target.avd">Must set android.target.avd</fail>
  528. <exec executable="${emulator}" spawn="true">
  529. <arg value="-skin"/>
  530. <arg value="${screen.skin}"/>
  531. <arg value="-avd"/>
  532. <arg value="${android.target.avd}"/>
  533. <arg line="${emulator.options}"/>
  534. </exec>
  535. </target>
  536. <target depends="init,compile,jar,-start-emulator" name="-wait-for-emulator">
  537. <taskdef classname="org.netbeans.modules.android.ant.AdbPackageManagerWait" classpath="${libs.AndroidAntTasks.classpath}" name="adb-pm-wait"/>
  538. <adb-pm-wait adb="${adb}" deviceArgs="${android.target.device}"/>
  539. </target>
  540. <target depends="init,compile,jar,-start-emulator,-wait-for-emulator" name="-install-app">
  541. <exec executable="${adb}">
  542. <arg line="${android.target.device}"/>
  543. <arg value="install"/>
  544. <arg value="-r"/>
  545. <arg value="${dist.apk}"/>
  546. </exec>
  547. </target>
  548. <target name="-do-not-recompile">
  549. <property name="javac.includes.binary" value=""/>
  550. </target>
  551. <!--
  552. =================
  553. DEBUGGING SECTION
  554. =================
  555. -->
  556. <target depends="init,-debug-start-debuggee" if="netbeans.home" name="-debug-start-debugger">
  557. <androidproject1:nbjpdaconnect/>
  558. </target>
  559. <target depends="init,compile,-start-emulator,-wait-for-emulator,-install-app" name="-debug-start-debuggee">
  560. <taskdef classname="org.netbeans.modules.android.ant.AndroidManifestParse" classpath="${libs.AndroidAntTasks.classpath}" name="android-manifest-parse"/>
  561. <android-manifest-parse mainActivityProperty="main.activity" manifestFile="AndroidManifest.xml"/>
  562. <echo message="About to start ${main.component}/${main.activity}"/>
  563. <exec executable="${adb}">
  564. <arg line="${android.target.device}"/>
  565. <arg value="shell"/>
  566. <arg value="am start -D -n ${main.component}/${main.activity}"/>
  567. </exec>
  568. <getdebuggerport addressProperty="local.debug.port" app="${main.component}"/>
  569. </target>
  570. <target depends="init,compile,-debug-start-debuggee,-debug-start-debugger" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  571. <!--
  572. ===============
  573. JAVADOC SECTION
  574. ===============
  575. -->
  576. <target depends="init" name="-javadoc-build">
  577. <mkdir dir="${dist.javadoc.dir}"/>
  578. <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  579. <classpath>
  580. <path path="${javac.classpath}"/>
  581. </classpath>
  582. <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  583. <filename name="**/*.java"/>
  584. </fileset>
  585. </javadoc>
  586. </target>
  587. <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  588. <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  589. </target>
  590. <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  591. <!--
  592. =========================
  593. JUNIT COMPILATION SECTION
  594. =========================
  595. -->
  596. <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  597. <mkdir dir="${build.test.classes.dir}"/>
  598. </target>
  599. <target name="-pre-compile-test">
  600. <!-- Empty placeholder for easier customization. -->
  601. <!-- You can override this target in the ../build.xml file. -->
  602. </target>
  603. <target if="do.depend.true" name="-compile-test-depend">
  604. <androidproject1:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  605. </target>
  606. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  607. <androidproject1:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  608. <copy todir="${build.test.classes.dir}">
  609. <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  610. </copy>
  611. </target>
  612. <target name="-post-compile-test">
  613. <!-- Empty placeholder for easier customization. -->
  614. <!-- You can override this target in the ../build.xml file. -->
  615. </target>
  616. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
  617. <target name="-pre-compile-test-single">
  618. <!-- Empty placeholder for easier customization. -->
  619. <!-- You can override this target in the ../build.xml file. -->
  620. </target>
  621. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  622. <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  623. <androidproject1:force-recompile destdir="${build.test.classes.dir}"/>
  624. <androidproject1:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
  625. <copy todir="${build.test.classes.dir}">
  626. <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  627. </copy>
  628. </target>
  629. <target name="-post-compile-test-single">
  630. <!-- Empty placeholder for easier customization. -->
  631. <!-- You can override this target in the ../build.xml file. -->
  632. </target>
  633. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  634. <!--
  635. =======================
  636. JUNIT EXECUTION SECTION
  637. =======================
  638. -->
  639. <target depends="init" if="have.tests" name="-pre-test-run">
  640. <mkdir dir="${build.test.results.dir}"/>
  641. </target>
  642. <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  643. <androidproject1:junit testincludes="**/*Test.java"/>
  644. </target>
  645. <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  646. <fail if="tests.failed">Some tests failed; see details above.</fail>
  647. </target>
  648. <target depends="init" if="have.tests" name="test-report"/>
  649. <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  650. <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
  651. <target depends="init" if="have.tests" name="-pre-test-run-single">
  652. <mkdir dir="${build.test.results.dir}"/>
  653. </target>
  654. <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  655. <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  656. <androidproject1:junit excludes="" includes="${test.includes}"/>
  657. </target>
  658. <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  659. <fail if="tests.failed">Some tests failed; see details above.</fail>
  660. </target>
  661. <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  662. <!--
  663. =======================
  664. JUNIT DEBUGGING SECTION
  665. =======================
  666. -->
  667. <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  668. <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  669. <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  670. <delete file="${test.report.file}"/>
  671. <mkdir dir="${build.test.results.dir}"/>
  672. <androidproject1:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
  673. <customize>
  674. <syspropertyset>
  675. <propertyref prefix="test-sys-prop."/>
  676. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  677. </syspropertyset>
  678. <arg value="${test.class}"/>
  679. <arg value="showoutput=true"/>
  680. <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
  681. <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
  682. </customize>
  683. </androidproject1:debug>
  684. </target>
  685. <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  686. <androidproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  687. </target>
  688. <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  689. <!--
  690. ===============
  691. CLEANUP SECTION
  692. ===============
  693. -->
  694. <target depends="init" name="deps-clean" unless="no.deps"/>
  695. <target depends="init" name="-do-clean">
  696. <delete dir="${build.dir}"/>
  697. <delete dir="${dist.dir}"/>
  698. </target>
  699. <target name="-post-clean">
  700. <!-- Empty placeholder for easier customization. -->
  701. <!-- You can override this target in the ../build.xml file. -->
  702. </target>
  703. <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
  704. </project>