From 795fba09a3ca273cd2daeeb7d9fed6bae6fa6a86 Mon Sep 17 00:00:00 2001 From: Mike Beattie Date: Thu, 7 Mar 2013 19:23:39 +1300 Subject: [PATCH] altosdroid: Adjust build system for GMaps & Tabs support * Use SupportV4 library for Tab support * Use Google Services Lib for Google Maps * revert to a standard Android target, not Google API's * Add permissions required for Google Maps to manifest, and API key Signed-off-by: Mike Beattie --- altosdroid/.classpath | 4 +++- altosdroid/.gitignore | 1 + altosdroid/AndroidManifest.xml | 17 ++++++++++++++++ altosdroid/Makefile.am | 37 +++++++++++++++++++++++++--------- altosdroid/project.properties | 3 ++- 5 files changed, 50 insertions(+), 12 deletions(-) diff --git a/altosdroid/.classpath b/altosdroid/.classpath index 0ca188f9..fce248e6 100644 --- a/altosdroid/.classpath +++ b/altosdroid/.classpath @@ -1,8 +1,10 @@ + - + + diff --git a/altosdroid/.gitignore b/altosdroid/.gitignore index 0d2ee6e0..56d0776d 100644 --- a/altosdroid/.gitignore +++ b/altosdroid/.gitignore @@ -2,4 +2,5 @@ local.properties bin gen libs +google-play-services_lib src/org/altusmetrum/AltosDroid/BuildInfo.java diff --git a/altosdroid/AndroidManifest.xml b/altosdroid/AndroidManifest.xml index adcfe94f..237c6dcf 100644 --- a/altosdroid/AndroidManifest.xml +++ b/altosdroid/AndroidManifest.xml @@ -20,9 +20,24 @@ android:versionCode="1" android:versionName="1.1.9.3"> + + + + + + + + + + + + + + + diff --git a/altosdroid/Makefile.am b/altosdroid/Makefile.am index 9ca24531..daa64963 100644 --- a/altosdroid/Makefile.am +++ b/altosdroid/Makefile.am @@ -1,12 +1,11 @@ if ANDROID -all_target=bin/AltosDroid-debug.apk bin/AltosDroid-release.apk -clean_command=ant clean +all_target=bin/AltosDroid-debug.apk bin/AltosDroid-release-unsigned.apk else all_target= -clean_command=echo done endif SDK=$(ANDROID_SDK) +SDK_TARGET=$(shell sed -ne 's/^target=//p' project.properties) DX=$(SDK)/platform-tools/dx ADB=$(SDK)/platform-tools/adb @@ -21,6 +20,14 @@ ALTOSLIB_JAR=altoslib_$(ALTOSLIB_VERSION).jar ALTOSLIB=$(EXT_LIBDIR)/$(ALTOSLIB_JAR) +SUPPORT_V4_SRCDIR=$(SDK)/extras/android/support/v4 +SUPPORT_V4_JAR=android-support-v4.jar + +SUPPORT_V4=$(EXT_LIBDIR)/$(SUPPORT_V4_JAR) + +GOOGLE_PLAY_SERVICES_LIB_SRCDIR=$(SDK)/extras/google/google_play_services/libproject +GOOGLE_PLAY_SERVICES_LIB=google-play-services_lib + SRC=$(SRC_DIR)/*.java all: $(all_target) @@ -31,6 +38,13 @@ $(EXT_LIBDIR): $(ALTOSLIB): $(EXT_LIBDIR) $(ALTOSLIB_SRCDIR)/$(ALTOSLIB_JAR) cd $(EXT_LIBDIR) && ln -sf $(shell echo $(EXT_LIBDIR) | sed 's|[^/]\+|..|g')/$(ALTOSLIB_SRCDIR)/$(ALTOSLIB_JAR) . +$(SUPPORT_V4): $(EXT_LIBDIR) $(SUPPORT_V4_SRCDIR)/$(SUPPORT_V4_JAR) + cd $(EXT_LIBDIR) && ln -sf $(SUPPORT_V4_SRCDIR)/$(SUPPORT_V4_JAR) . + +$(GOOGLE_PLAY_SERVICES_LIB): $(GOOGLE_PLAY_SERVICES_LIB_SRCDIR)/$(GOOGLE_PLAY_SERVICES_LIB) + cp -a $(GOOGLE_PLAY_SERVICES_LIB_SRCDIR)/$(GOOGLE_PLAY_SERVICES_LIB) . + cd $(GOOGLE_PLAY_SERVICES_LIB) && $(SDK)/tools/android update project --target $(SDK_TARGET) --path . + $(SRC_DIR)/BuildInfo.java: $(SRC) ./buildinfo.sh @@ -41,10 +55,10 @@ install-release: bin/AltosDroid-release.apk install-debug: bin/AltosDroid-debug.apk $(ADB) install -r bin/AltosDroid-debug.apk -bin/AltosDroid-debug.apk: $(SRC) $(ALTOSLIB) +bin/AltosDroid-debug.apk: $(SRC) $(ALTOSLIB) $(SUPPORT_V4) $(GOOGLE_PLAY_SERVICES_LIB) ant debug -bin/AltosDroid-release.apk: $(SRC) $(ALTOSLIB) +bin/AltosDroid-release-unsigned.apk: $(SRC) $(ALTOSLIB) $(SUPPORT_V4) $(GOOGLE_PLAY_SERVICES_LIB) ant release sign: @@ -55,11 +69,14 @@ sign: bin/AltosDroid-release-signed.apk \ bin/AltosDroid-release.apk -endif +clean: $(GOOGLE_PLAY_SERVICES_LIB) + ant clean + rm -rf $(EXT_LIBDIR) + rm -rf $(GOOGLE_PLAY_SERVICES_LIB) -clean: clean-local - $(clean_command) +else -clean-local: - rm -rf $(EXT_LIBDIR) +clean: + +endif diff --git a/altosdroid/project.properties b/altosdroid/project.properties index 0a80e644..96b9551c 100644 --- a/altosdroid/project.properties +++ b/altosdroid/project.properties @@ -8,4 +8,5 @@ # project structure. # Project target. -target=Google Inc.:Google APIs:10 +target=android-10 +android.library.reference.1=google-play-services_lib/ -- 2.30.2