@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
** See the file "LICENSE" for the full license governing this code.
-->
<project name= "astrid" default= "help" >
@ -59,10 +59,10 @@
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<target name= "-set-mode-check" depends= "" >
<fail if= "build.is.mode.set"
message="Cannot run two different modes at the same time. If you are running more than one debug/release/instrument type targets, call them from different Ant calls." />
</target>
<target name= "-set-mode-check" depends= "" >
<fail if= "build.is.mode.set"
message="Cannot run two different modes at the same time. If you are running more than one debug/release/instrument type targets, call them from different Ant calls." />
</target>
<target name= "-pre-build" depends= "get-version, copy-sources, setup-lite, updatekeys, updatekeys-release, update-market-strategy" >
<mkdir dir= "gen" />
@ -71,7 +71,7 @@
</target>
<target name= "-post-astrid-build" depends= "teardown-lite" />
<target name= "copy-sources" >
<delete dir= "${source.dir}" />
<mkdir dir= "${source.dir}" />
@ -96,7 +96,7 @@
select="\1" />
<echo message= "Astrid: version ${manifest.version.code}, named ${manifest.version.name}" />
</target>
<target name= "warnings" >
<echo > ====== context classes without setContext =====</echo>
<exec executable= "sh" >
@ -123,7 +123,7 @@
<replaceregexp file= "${source.dir}/com/todoroo/astrid/actfm/sync/ActFmInvoker.java"
match="APP_SECRET = .*"
replace="APP_SECRET = " ${apikey.actfm.secret}" ;" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/taskrabbit/TaskRabbitActivity.java"
match="TASK_RABBIT_CLIENT_ID = .*"
replace="TASK_RABBIT_CLIENT_ID = " ${apikey.taskrabbit.clientid}" ;" />
@ -133,31 +133,31 @@
<replaceregexp file= "${source.dir}/com/todoroo/astrid/taskrabbit/TaskRabbitActivity.java"
match="TASK_RABBIT_URL = .*"
replace="TASK_RABBIT_URL = " ${apikey.taskrabbit.url}" ;" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/taskrabbit/TaskRabbitMapActivity.java"
match="MAPS_API_KEY = .*"
replace="MAPS_API_KEY = " ${apikey.maps}" ;" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/gtasks/api/GtasksInvoker.java"
match="API_KEY = .*"
replace="API_KEY = " ${apikey.gtasks}" ;" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/utility/Constants.java"
match="AWS_SECRET_KEY_ID = .*"
replace="AWS_SECRET_KEY_ID = " ${apikey.amazon.secret}" ;" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/service/abtesting/ABTestInvoker.java"
match="API_KEY = .*"
replace="API_KEY = " ${apikey.analytics.id}" ;" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/service/abtesting/ABTestInvoker.java"
match="API_SECRET = .*"
replace="API_SECRET = " ${apikey.analytics.secret}" ;" />
<antcall target= "updatekeys-lite" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/billing/BillingConstants.java"
match="PUB_KEY_REPLACE_CHAR = .*"
replace="PUB_KEY_REPLACE_CHAR = ' ${apikey.googleplay.replacechar}' ;" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/billing/BillingConstants.java"
match="PUB_KEY_OBFUSCATED = .*"
replace="PUB_KEY_OBFUSCATED = " ${apikey.googleplay.pubkey}" ;" />
@ -172,11 +172,11 @@
replace="API_SECRET = " ${apikey.analytics.lite.secret}" ;" />
</target>
<target name= "updatekeys-pre" if= "pre.astrid" description= "use pre.astrid .com">
<target name= "updatekeys-pre" if= "pre.astrid" description= "use pre.astrid -dev .com">
<property file= "${apikey.keyfile}" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/actfm/sync/ActFmInvoker.java"
match="URL = .*"
replace="URL = " //pre.astrid.com/api/" ;" />
replace="URL = " //pre.astrid-dev .com/api/" ;" />
</target>
<!-- update api keys that require release signing -->
@ -185,9 +185,9 @@
<property file= "${apikey.keyfile}" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/actfm/ActFmLoginActivity.java"
match="APP_ID = .*"
replace="APP_ID = " ${apikey.facebook.id}" ;" />
replace="APP_ID = " ${apikey.facebook.id}" ;" />
</target>
<target name= "-release-prompt-for-password" description= "override to set signature" >
<property file= "${signjar.passfile}" /> <echo message= "${signjar.passfile}" />
@ -201,14 +201,14 @@
<target name= "update-market-strategy" if= "custom.market.strategy" >
<echo message= "Changing market strategy to ${custom.market.strategy}" />
<replace token= "market://" value= "disabled://"
<replace token= "market://" value= "disabled://"
dir="${source.dir}" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/utility/Constants.java"
match="AndroidMarketStrategy"
replace="${custom.market.strategy}" />
</target>
<target name= "obfuscate" depends= "-set-debug-files, - s e t - d e b u g - m o d e , n o d e p s , - b u i l d - s e t u p ,
<target name= "obfuscate" depends= "-set-debug-files, - s e t - d e b u g - m o d e , n o d e p s , - b u i l d - s e t u p ,
-set-release-mode, -release-obfuscation-check, -obfuscate" />
<target name= "dex" depends= "obfuscate, -dex" />
@ -234,14 +234,14 @@
<!-- build lite release package with updated version name -->
<target name= "release-lite" depends= "clean, set-lite-property, release" />
<target name= "debug-lite" depends= "clean, set-lite-property, debug" />
<target name= "set-lite-property" >
<property name= "lite.enabled" value= "true" />
<subant target= "setup-lite" >
<fileset file= "../api/build.xml" />
</subant>
</target>
<target name= "setup-lite" if= "lite.enabled" >
<copy file= "AndroidManifest.xml" tofile= "AndroidManifest_old.xml" />
<replaceregexp file= "${source.dir}/com/todoroo/astrid/utility/Constants.java"
@ -300,14 +300,14 @@
replace="ASTRID_DIR = " /astridlite" ;"
/>
<move file= "${source.dir}/com/timsu/astrid" tofile= "${source.dir}/com/todoroo/astridlite" />
<copy todir= "res_old" >
<fileset dir= "res" />
</copy>
<replace dir= "res" token= "com.timsu.astrid" value= "com.todoroo.astridlite" />
<replace dir= "${source.dir}" token= "com.timsu.astrid" value= "com.todoroo.astridlite" />
<replaceregexp match= ">(.*\s)task(.*)"
replace="> \1to-do\2"
flags="g">
@ -333,7 +333,7 @@
flags="g"
/>
</target>
<target name= "teardown-lite" if= "lite.enabled" >
<delete dir= "res" />
<move file= "res_old" tofile= "res" />
@ -342,7 +342,7 @@
<fileset file= "../api/build.xml" />
</subant>
</target>
<!-- build custom unsigned package with updated version name -->
<target name= "unsigned-custom" depends= "clean" >
<fail message= "need to set custom.version.name" >
@ -458,7 +458,7 @@
location="../release/${ant.project.name}-${manifest.version.code}-${manifest.version.name}-release.apk" />
</else>
</if>
<zipalign-helper in.package= "${out.unaligned.file}"
out.package="${out.final.file}" />
<copy file= "${out.final.file}" tofile= "${out.release.file}" />