From aaaf5126c6a465b2758c111f41bb4f55d39b3fe0 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Sat, 24 Nov 2012 16:34:33 +0000 Subject: android: adapt the ant clobbering to a given SDK version. Another volunteer fell over this, and (I hope) it's easy enough. Change-Id: I7149d16fd8b7749afeeccef2ebc8f493200f1900 --- android/Bootstrap/.gitignore | 1 + android/Bootstrap/Makefile.shared | 28 ++++++++++++++++- android/Bootstrap/no-resource-compress-20.xml | 44 ++++++++++++++++++++++++++ android/Bootstrap/no-resource-compress-21.xml | 45 +++++++++++++++++++++++++++ android/Bootstrap/no-resource-compress.xml | 40 ------------------------ 5 files changed, 117 insertions(+), 41 deletions(-) create mode 100644 android/Bootstrap/.gitignore create mode 100644 android/Bootstrap/no-resource-compress-20.xml create mode 100644 android/Bootstrap/no-resource-compress-21.xml delete mode 100644 android/Bootstrap/no-resource-compress.xml (limited to 'android/Bootstrap') diff --git a/android/Bootstrap/.gitignore b/android/Bootstrap/.gitignore new file mode 100644 index 000000000000..9f3d7afcc69e --- /dev/null +++ b/android/Bootstrap/.gitignore @@ -0,0 +1 @@ +no-resource-compress.xml \ No newline at end of file diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared index e0bd143eb81c..75beab60135d 100644 --- a/android/Bootstrap/Makefile.shared +++ b/android/Bootstrap/Makefile.shared @@ -2,6 +2,10 @@ # Common Makefile pieces for building Java / Android apps. # +# +# BOOTSTRAPDIR needs to be set to this directory before starting this +# + # Probably would be best to just stop fooling around with the possibilities to # set various stuff with the -env command line parameters (and environment # variables?) and in a plethora of rc files, and hardcode construction of @@ -26,9 +30,31 @@ endef # Helpful rules ... # +# +# The Android SDK recommends you copy/paste some big -package-resources +# rule in order to not pack certain kinds of resources. Unfortunately this +# rule interacts with the rest of the ant code in horrible ways such that +# upgrading your SDK auto-breaks everything. +# +# Horrors below: +# +$(BOOTSTRAPDIR)/no-resource-compress.xml : + ( \ + android_sdk_ver=`grep 'Pkg.Revision' /opt/libreoffice/android-sdk-linux/tools/source.properties | sed 's/^.*=//' | sed 's/\..*//'` ; \ + echo "Android SDK version is: $$android_sdk_ver"; \ + cp -a $(BOOTSTRAPDIR)/no-resource-compress-$$android_sdk_ver.xml $(BOOTSTRAPDIR)/no-resource-compress.xml ; \ + if ! test -f $(BOOTSTRAPDIR)/no-resource-compress.xml; then \ + echo "Unknown Android SDK version: $$android_sdk_ver - failing hard" \ + exit 1; \ + fi \ + ) || exit 1 + +android_version_setup : $(BOOTSTRAPDIR)/no-resource-compress.xml + properties: echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties echo sdk.dir=$(ANDROID_SDK_HOME) >../../Bootstrap/local.properties + echo "# File needed by ndk-gdb" >jni/Application.mk echo "APP_ABI := $(ANDROID_APP_ABI)" > jni/Application.mk echo "APP_PLATFORM := android-14" >> jni/Application.mk @@ -43,7 +69,7 @@ uninstall: clean: properties $(ANT) clean - rm -rf assets $(SODEST) $(OBJLOCAL) + rm -rf assets libs $(SODEST) $(OBJLOCAL) $(BOOTSTRAPDIR)/no-resource-compress.xml # If you reinstall an app several times *on the simulator*, even if you # uninstall it between, disk space seems to leak that won't get recycled until diff --git a/android/Bootstrap/no-resource-compress-20.xml b/android/Bootstrap/no-resource-compress-20.xml new file mode 100644 index 000000000000..d6fb92582d27 --- /dev/null +++ b/android/Bootstrap/no-resource-compress-20.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/android/Bootstrap/no-resource-compress-21.xml b/android/Bootstrap/no-resource-compress-21.xml new file mode 100644 index 000000000000..2b297826f0c8 --- /dev/null +++ b/android/Bootstrap/no-resource-compress-21.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/android/Bootstrap/no-resource-compress.xml b/android/Bootstrap/no-resource-compress.xml deleted file mode 100644 index 314f6d5e3c5e..000000000000 --- a/android/Bootstrap/no-resource-compress.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - -- cgit