Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Market disable logic for amazon market.

  • Loading branch information...
commit 9c1262c8fd13900dd840bda8118f6a9fdd5ceeab 1 parent 30db35f
@timsu timsu authored
View
12 astrid/build.xml
@@ -34,7 +34,6 @@
should be checked in in Version Control Systems. -->
<property file="default.properties" />
-
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="antlib/ant-contrib-1.0b3.jar"/>
@@ -111,7 +110,7 @@
</target>
<!-- post build: rename apk -->
- <target name="release" depends="clean, get-version, warnings, android_rules.release">
+ <target name="release" depends="clean, get-version, warnings, disable-market, android_rules.release">
<mkdir dir="../release" />
<property name="out.final.package"
location="../release/${ant.project.name}-${manifest.version.code}-${manifest.version.name}-release.apk" />
@@ -140,6 +139,15 @@
</exec>
</target>
+ <target name="disable-market" if="custom.market.disabled">
+ <echo message="Disabling android market links" />
+ <replace token="market://" value="disabled://"
+ dir="${source.dir}" />
+ <replaceregexp file="${source.dir}/com/todoroo/astrid/utility/Constants.java"
+ match="(MARKET_DISABLED.*=).*"
+ replace="\1 true;" />
+ </target>
+
<!-- build custom release package with updated version name -->
<target name="release-custom">
<fail message="need to set custom.version.name">
View
3  astrid/src/com/todoroo/astrid/activity/TaskEditActivity.java
@@ -92,6 +92,7 @@
import com.todoroo.astrid.ui.CalendarDialog;
import com.todoroo.astrid.ui.DeadlineTimePickerDialog;
import com.todoroo.astrid.ui.DeadlineTimePickerDialog.OnDeadlineTimeSetListener;
+import com.todoroo.astrid.utility.Constants;
import com.todoroo.astrid.voice.VoiceInputAssistant;
/**
@@ -300,7 +301,7 @@ public void run() {
controls.add(new TimerControlSet(TaskEditActivity.this, addonsAddons));
controls.add(new AlarmControlSet(TaskEditActivity.this, addonsAddons));
- if(!addOnService.hasPowerPack()) {
+ if(!Constants.MARKET_DISABLED && !addOnService.hasPowerPack()) {
// show add-on help if necessary
View addonsEmpty = findViewById(R.id.addons_empty);
addonsEmpty.setVisibility(View.VISIBLE);
View
8 astrid/src/com/todoroo/astrid/activity/TaskListActivity.java
@@ -250,9 +250,11 @@ public boolean onPrepareOptionsMenu(Menu menu) {
MenuItem item;
- item = menu.add(Menu.NONE, MENU_ADDONS_ID, Menu.NONE,
- R.string.TLA_menu_addons);
- item.setIcon(android.R.drawable.ic_menu_set_as);
+ if(!Constants.MARKET_DISABLED) {
+ item = menu.add(Menu.NONE, MENU_ADDONS_ID, Menu.NONE,
+ R.string.TLA_menu_addons);
+ item.setIcon(android.R.drawable.ic_menu_set_as);
+ }
item = menu.add(Menu.NONE, MENU_SETTINGS_ID, Menu.NONE,
R.string.TLA_menu_settings);
View
5 astrid/src/com/todoroo/astrid/utility/Constants.java
@@ -21,6 +21,11 @@
public static final boolean OEM = false;
/**
+ * Whether this is an Android Market-disabled build
+ */
+ public static final boolean MARKET_DISABLED = false;
+
+ /**
* Interval to update the widget (in order to detect hidden tasks
* becoming visible)
*/
View
2  astrid/src/com/todoroo/astrid/voice/VoiceInputAssistant.java
@@ -217,7 +217,7 @@ public void showVoiceInputMarketSearch(DialogInterface.OnClickListener onFail) {
else
packageName = "com.google.android.voicesearch";
- // User wants to install voice search, take him to the market
+ // User wants to install voice search, take them to the market
Intent marketIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("market://search?q=pname:" + packageName)); //$NON-NLS-1$
try {
View
9 build.xml
@@ -31,7 +31,7 @@
<target name="release-all" depends="clean,get-version,release">
<!-- custom builds -->
- <for list="-getjar,.1000,-verizon,-sprint,-orange,-vodafone,-other" param="name">
+ <for list="-getjar,-verizon,-sprint,-orange,-vodafone,-other" param="name">
<sequential>
<subant target="release-custom">
<fileset file="astrid/build.xml" />
@@ -39,6 +39,13 @@
</subant>
</sequential>
</for>
+ <!-- amazon -->
+ <subant>
+ <fileset file="astrid/build.xml" />
+ <property name="custom.version.name" value=".1000" />
+ <property name="custom.market.disabled" value="true" />
+ <target name="release-custom" />
+ </subant>
</target>
</project>
Please sign in to comment.
Something went wrong with that request. Please try again.