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 ------------------- android/experimental/DocumentLoader/Makefile | 26 +----------- android/experimental/LibreOffice4Android/Makefile | 5 +- android/qa/desktop/Makefile | 4 + 8 files changed, 127 insertions(+), 66 deletions(-)
New commits: commit aaaf5126c6a465b2758c111f41bb4f55d39b3fe0 Author: Michael Meeks <michael.me...@suse.com> Date: Sat Nov 24 16:34:33 2012 +0000 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 diff --git a/android/Bootstrap/.gitignore b/android/Bootstrap/.gitignore new file mode 100644 index 0000000..9f3d7af --- /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 e0bd143..75beab6 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 0000000..d6fb925 --- /dev/null +++ b/android/Bootstrap/no-resource-compress-20.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="clobber_android_rules" default="debug"> + + <import file="${sdk.dir}/tools/ant/build.xml" /> + +<!-- + This is copy/pasted from ${sdk.dir}/tools/ant/build.xml + and tweaked - it needs to match the same SDK version as + your build +--> + +<!-- + This file is auto-generated by Bootstrap/Makefile.shared from + a versioned .xml file - please edit me there +--> + + <target name="-package-resources" depends="-crunch"> + <!-- only package resources if *not* a library project --> + <do-only-if-not-library elseText="Library project: do not package resources..." > + <aapt executable="${aapt}" + command="package" + versioncode="${version.code}" + versionname="${version.name}" + debug="${build.is.packaging.debug}" + manifest="${out.manifest.abs.file}" + assets="${asset.absolute.dir}" + androidjar="${project.target.android.jar}" + apkfolder="${out.absolute.dir}" + nocrunch="${build.packaging.nocrunch}" + resourcefilename="${resource.package.file.name}" + resourcefilter="${aapt.resource.filter}" + libraryResFolderPathRefid="project.library.res.folder.path" + libraryPackagesRefid="project.library.packages" + previousBuildType="${build.last.target}" + buildType="${build.target}" + ignoreAssets="${aapt.ignore.assets}"> + <res path="${out.res.absolute.dir}" /> + <res path="${resource.absolute.dir}" /> + <nocompress/> <!-- forces no compression on any files in assets or res/raw --> + <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw --> + </aapt> + </do-only-if-not-library> + </target> +</project> diff --git a/android/Bootstrap/no-resource-compress-21.xml b/android/Bootstrap/no-resource-compress-21.xml new file mode 100644 index 0000000..2b29782 --- /dev/null +++ b/android/Bootstrap/no-resource-compress-21.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="clobber_android_rules" default="debug"> + + <import file="${sdk.dir}/tools/ant/build.xml" /> + +<!-- + This is copy/pasted from ${sdk.dir}/tools/ant/build.xml + and tweaked - it needs to match the same SDK version as + your build +--> + +<!-- + This file is auto-generated by Bootstrap/Makefile.shared from + a versioned .xml file - please edit me there +--> + + <target name="-package-resources" depends="-crunch"> + <!-- only package resources if *not* a library project --> + <do-only-if-not-library elseText="Library project: do not package resources..." > + <aapt executable="${aapt}" + command="package" + versioncode="${version.code}" + versionname="${version.name}" + debug="${build.is.packaging.debug}" + manifest="${out.manifest.abs.file}" + assets="${asset.absolute.dir}" + androidjar="${project.target.android.jar}" + apkfolder="${out.absolute.dir}" + nocrunch="${build.packaging.nocrunch}" + resourcefilename="${resource.package.file.name}" + resourcefilter="${aapt.resource.filter}" + libraryResFolderPathRefid="project.library.res.folder.path" + libraryPackagesRefid="project.library.packages" + libraryRFileRefid="project.library.bin.r.file.path" + previousBuildType="${build.last.target}" + buildType="${build.target}" + ignoreAssets="${aapt.ignore.assets}"> + <res path="${out.res.absolute.dir}" /> + <res path="${resource.absolute.dir}" /> + <nocompress/> <!-- forces no compression on any files in assets or res/raw --> + <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw --> + </aapt> + </do-only-if-not-library> + </target> +</project> diff --git a/android/Bootstrap/no-resource-compress.xml b/android/Bootstrap/no-resource-compress.xml deleted file mode 100644 index 314f6d5..0000000 --- a/android/Bootstrap/no-resource-compress.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="clobber_android_rules" default="debug"> - - <import file="${sdk.dir}/tools/ant/build.xml" /> - -<!-- - This is copy/pasted from ${sdk.dir}/tools/ant/build.xml - and tweaked - it needs to match the same SDK version as - your build ---> - - <target name="-package-resources" depends="-crunch"> - <!-- only package resources if *not* a library project --> - <do-only-if-not-library elseText="Library project: do not package resources..." > - <aapt executable="${aapt}" - command="package" - versioncode="${version.code}" - versionname="${version.name}" - debug="${build.is.packaging.debug}" - manifest="${out.manifest.abs.file}" - assets="${asset.absolute.dir}" - androidjar="${project.target.android.jar}" - apkfolder="${out.absolute.dir}" - nocrunch="${build.packaging.nocrunch}" - resourcefilename="${resource.package.file.name}" - resourcefilter="${aapt.resource.filter}" - libraryResFolderPathRefid="project.library.res.folder.path" - libraryPackagesRefid="project.library.packages" - libraryRFileRefid="project.library.bin.r.file.path" - previousBuildType="${build.last.target}" - buildType="${build.target}" - ignoreAssets="${aapt.ignore.assets}"> - <res path="${out.res.absolute.dir}" /> - <res path="${resource.absolute.dir}" /> - <nocompress/> <!-- forces no compression on any files in assets or res/raw --> - <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw --> - </aapt> - </do-only-if-not-library> - </target> -</project> diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile index 1551822..880a032 100644 --- a/android/experimental/DocumentLoader/Makefile +++ b/android/experimental/DocumentLoader/Makefile @@ -1,5 +1,8 @@ include ../../../config_host.mk +BOOTSTRAPDIR=../../Bootstrap +include $(BOOTSTRAPDIR)/Makefile.shared + # The package of this app APP_PACKAGE=org.libreoffice.android.examples @@ -39,13 +42,6 @@ WHOLELIBS = \ all: build-ant -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 - link-so: # Build the single .so for this app mkdir -p $(OBJLOCAL) @@ -156,7 +152,7 @@ copy-stuff: cp $(ANDROID_NDK_GDBSERVER) $(SODEST) echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup -build-ant: copy-stuff link-so properties +build-ant: android_version_setup copy-stuff link-so properties # # Copy jar files we need # @@ -173,19 +169,5 @@ build-ant: copy-stuff link-so properties # unset JAVA_HOME && $(ANT) debug -install: build-ant - unset JAVA_HOME && $(ANT) debug install - @echo - @echo 'Run it with "make run"' - @echo - -uninstall: - $(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(APP_PACKAGE) - run: adb shell am start -n org.libreoffice.android.examples/.DocumentLoader -e input /assets/test1.odt - - -clean: properties - $(ANT) clean - rm -rf assets libs $(SODEST) $(OBJLOCAL) diff --git a/android/experimental/LibreOffice4Android/Makefile b/android/experimental/LibreOffice4Android/Makefile index a33bd5a..20627fd 100644 --- a/android/experimental/LibreOffice4Android/Makefile +++ b/android/experimental/LibreOffice4Android/Makefile @@ -16,7 +16,8 @@ WHOLELIBS = \ all: build-ant -include ../../Bootstrap/Makefile.shared +BOOTSTRAPDIR=../../Bootstrap +include $(BOOTSTRAPDIR)/Makefile.shared # The package of this app APP_PACKAGE=org.libreoffice @@ -128,7 +129,7 @@ copy-stuff: cp $(ANDROID_NDK_GDBSERVER) $(SODEST) echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup -build-ant: copy-stuff link-so properties +build-ant: android_version_setup copy-stuff link-so properties echo sdk.dir=$(ANDROID_SDK_HOME) >../../abs-lib/local.properties # ActionBarSherlock uses the v4 support library, apparently one needs to copy # it like this for it to be found diff --git a/android/qa/desktop/Makefile b/android/qa/desktop/Makefile index 3adc9ee..bb96eef 100644 --- a/android/qa/desktop/Makefile +++ b/android/qa/desktop/Makefile @@ -2,7 +2,9 @@ # 'lo_main' from include ../../../config_host.mk -include ../../Bootstrap/Makefile.shared + +BOOTSTRAPDIR=../../Bootstrap +include $(BOOTSTRAPDIR)/Makefile.shared # The package of this app APP_PACKAGE=org.libreoffice.android.libo _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits