A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

android: Update build system for recent SDK versions and target ice cream sandwich.

As a result, the java parts can now be build using ant (in the android dir).
Just issue "ant debug" after "make libs". Building the java parts from eclipse
also still works.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31543 a1c6a512-1295-4272-9138-f99709370657

+161 -24
+1 -1
android/.classpath
··· 3 3 <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> 4 4 <classpathentry kind="src" path="src"/> 5 5 <classpathentry kind="src" path="gen"/> 6 - <classpathentry kind="output" path="bin"/> 6 + <classpathentry kind="output" path="bin/classes"/> 7 7 </classpath>
+19 -19
android/android.make
··· 27 27 .SECONDEXPANSION: # $$(OBJ) is not populated until after this 28 28 .PHONY: apk classes clean dex dirs libs jar 29 29 30 - 31 - java2class = $(addsuffix .class,$(basename $(subst $(ANDROID_DIR),$(BUILDDIR),$(1)))) 32 - 33 30 # API version 34 31 ANDROID_PLATFORM_VERSION=11 35 32 ANDROID_PLATFORM=$(ANDROID_SDK_PATH)/platforms/android-$(ANDROID_PLATFORM_VERSION) ··· 41 38 ZIPALIGN=$(ANDROID_SDK_PATH)/tools/zipalign 42 39 KEYSTORE=$(HOME)/.android/debug.keystore 43 40 ADB=$(ANDROID_SDK_PATH)/platform-tools/adb 41 + 42 + CLASSPATH := $(BUILDDIR)/bin/classes 44 43 45 44 MANIFEST := $(BUILDDIR)/bin/AndroidManifest.xml 46 45 MANIFEST_SRC := $(ANDROID_DIR)/AndroidManifest.xml 47 46 48 47 R_JAVA := $(BUILDDIR)/gen/$(PACKAGE_PATH)/R.java 49 - R_OBJ := $(BUILDDIR)/bin/$(PACKAGE_PATH)/R.class 48 + R_OBJ := $(CLASSPATH)/$(PACKAGE_PATH)/R.class 50 49 51 50 JAVA_SRC := $(wildcard $(ANDROID_DIR)/src/$(PACKAGE_PATH)/*.java) 52 51 JAVA_SRC += $(wildcard $(ANDROID_DIR)/src/$(PACKAGE_PATH)/Helper/*.java) 53 52 JAVA_SRC += $(wildcard $(ANDROID_DIR)/src/$(PACKAGE_PATH)/widgets/*.java) 54 53 JAVA_SRC += $(wildcard $(ANDROID_DIR)/src/$(PACKAGE_PATH)/monitors/*.java) 55 - JAVA_OBJ := $(call java2class,$(subst $(ANDROID)/src/$(PACKAGE_PATH),$(ANDROID)/bin/$(PACKAGE_PATH),$(JAVA_SRC))) 54 + 55 + java2class = $(addsuffix .class,$(basename $(subst $(ANDROID_DIR)/src,$(CLASSPATH),$(1)))) 56 + 57 + JAVA_OBJ := $(call java2class,$(JAVA_SRC)) 56 58 57 59 58 60 LIBS := $(BINLIB_DIR)/$(BINARY) $(BINLIB_DIR)/libmisc.so 59 61 LIBS += $(addprefix $(BINLIB_DIR)/lib,$(patsubst %.codec,%.so,$(notdir $(CODECS)))) 62 + 60 63 TEMP_APK := $(BUILDDIR)/bin/_rockbox.apk 61 64 TEMP_APK2 := $(BUILDDIR)/bin/__rockbox.apk 62 65 DEX := $(BUILDDIR)/bin/classes.dex ··· 65 68 APK := $(BUILDDIR)/rockbox.apk 66 69 67 70 _DIRS := $(BUILDDIR)/___/$(PACKAGE_PATH) 68 - DIRS := $(subst ___,bin,$(_DIRS)) 69 71 DIRS += $(subst ___,gen,$(_DIRS)) 70 72 DIRS += $(subst ___,data,$(_DIRS)) 71 73 DIRS += $(BUILDDIR)/libs/armeabi 72 74 DIRS += $(CPUFEAT_BUILD) 75 + DIRS += $(CLASSPATH) 73 76 74 77 RES := $(wildcard $(ANDROID_DIR)/res/*/*) 75 78 76 79 CLEANOBJS += bin gen libs data 77 80 78 - JAVAC_OPTS += -implicit:none -classpath $(ANDROID_PLATFORM)/android.jar:$(BUILDDIR)/bin 81 + JAVAC_OPTS += -implicit:none -classpath $(ANDROID_PLATFORM)/android.jar:$(CLASSPATH) 79 82 80 83 .PHONY: 81 84 $(MANIFEST): $(MANIFEST_SRC) $(DIRS) ··· 86 89 -J $(BUILDDIR)/gen -M $(MANIFEST) -S $(ANDROID_DIR)/res \ 87 90 -I $(ANDROID_PLATFORM)/android.jar -F $(AP_) 88 91 89 - $(BUILDDIR)/bin/$(PACKAGE_PATH)/R.class: $(R_JAVA) 92 + $(CLASSPATH)/$(PACKAGE_PATH)/R.class: $(R_JAVA) 90 93 $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$<))javac -d $(BUILDDIR)/bin \ 91 - $(JAVAC_OPTS) \ 92 - -sourcepath $(ANDROID_DIR)/gen $< 94 + $(JAVAC_OPTS) -sourcepath $(ANDROID_DIR)/gen $< 93 95 94 - $(BUILDDIR)/bin/$(PACKAGE_PATH)/%.class: $(ANDROID_DIR)/src/$(PACKAGE_PATH)/%.java $(BUILDDIR)/bin/$(PACKAGE_PATH)/R.class 95 - $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$<))javac -d $(BUILDDIR)/bin \ 96 - $(JAVAC_OPTS) \ 97 - -sourcepath $(ANDROID_DIR)/src $< 96 + $(CLASSPATH)/$(PACKAGE_PATH)/%.class: $(ANDROID_DIR)/src/$(PACKAGE_PATH)/%.java $(CLASSPATH)/$(PACKAGE_PATH)/R.class 97 + $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$<))javac -d $(CLASSPATH) \ 98 + $(JAVAC_OPTS) -sourcepath $(ANDROID_DIR)/src $< 98 99 99 100 $(JAR): $(JAVA_SRC) $(R_JAVA) 100 - $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$?))javac -d $(BUILDDIR)/bin \ 101 - $(JAVAC_OPTS) \ 102 - -sourcepath $(ANDROID_DIR)/src:$(ANDROID_DIR)/gen $? 103 - $(call PRINTS,JAR $(subst $(BUILDDIR)/,,$@))jar cf $(JAR) -C $(BUILDDIR)/bin org 101 + $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$?))javac -d $(CLASSPATH) \ 102 + $(JAVAC_OPTS) -sourcepath $(ANDROID_DIR)/src:$(ANDROID_DIR)/gen $? 103 + $(call PRINTS,JAR $(subst $(BUILDDIR)/,,$@))jar cf $(JAR) -C $(CLASSPATH) org 104 104 105 105 jar: $(JAR) 106 106 ··· 127 127 $(BINLIB_DIR)/lib%.so: $(BUILDDIR)/apps/codecs/%.codec 128 128 $(call PRINTS,CP $(@F))cp $^ $@ 129 129 130 - libs: $(LIBS) 130 + libs: $(DIRS) $(LIBS) 131 131 132 132 $(TEMP_APK): $(AP_) $(LIBS) $(DEX) | $(DIRS) 133 133 $(call PRINTS,APK $(subst $(BUILDDIR)/,,$@))$(APKBUILDER) $@ \
+12
android/ant.properties
··· 1 + # Override some props according to android.make 2 + # see $ANDROID_SDK_PATH/tools/ant/build.xml for what's overridable 3 + # Once we can build signed *release* builds, we should have a different 4 + # names for the debug builds 5 + 6 + 7 + # the signed, unzipaligned file is bin/__rockbox.apk 8 + out.packaged.file=bin/__${ant.project.name}.apk 9 + 10 + # the final file is rockbox.apk, in the build dir 11 + out.packaged.file=${ant.project.name}.apk 12 +
+85
android/build.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <project name="rockbox" default="help"> 3 + 4 + <!-- The local.properties file is created and updated by the 'android' tool. 5 + It contains the path to the SDK. It should *NOT* be checked into 6 + Version Control Systems. --> 7 + <property file="local.properties" /> 8 + 9 + <!-- The ant.properties file can be created by you. It is only edited by the 10 + 'android' tool to add properties to it. 11 + This is the place to change some Ant specific build properties. 12 + Here are some properties you may want to change/update: 13 + 14 + source.dir 15 + The name of the source directory. Default is 'src'. 16 + out.dir 17 + The name of the output directory. Default is 'bin'. 18 + 19 + For other overridable properties, look at the beginning of the rules 20 + files in the SDK, at tools/ant/build.xml 21 + 22 + Properties related to the SDK location or the project target should 23 + be updated using the 'android' tool with the 'update' action. 24 + 25 + This file is an integral part of the build system for your 26 + application and should be checked into Version Control Systems. 27 + 28 + --> 29 + <property file="ant.properties" /> 30 + 31 + <!-- The project.properties file is created and updated by the 'android' 32 + tool, as well as ADT. 33 + 34 + This contains project specific properties such as project target, and library 35 + dependencies. Lower level build properties are stored in ant.properties 36 + (or in .classpath for Eclipse projects). 37 + 38 + This file is an integral part of the build system for your 39 + application and should be checked into Version Control Systems. --> 40 + <loadproperties srcFile="project.properties" /> 41 + 42 + <!-- quick check on sdk.dir --> 43 + <fail 44 + message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var" 45 + unless="sdk.dir" 46 + /> 47 + 48 + 49 + <!-- extension targets. Uncomment the ones where you want to do custom work 50 + in between standard targets --> 51 + <!-- 52 + <target name="-pre-build"> 53 + </target> 54 + <target name="-pre-compile"> 55 + </target> 56 + 57 + /* This is typically used for code obfuscation. 58 + Compiled code location: ${out.classes.absolute.dir} 59 + If this is not done in place, override ${out.dex.input.absolute.dir} */ 60 + <target name="-post-compile"> 61 + </target> 62 + --> 63 + 64 + <!-- Import the actual build file. 65 + 66 + To customize existing targets, there are two options: 67 + - Customize only one target: 68 + - copy/paste the target into this file, *before* the 69 + <import> task. 70 + - customize it to your needs. 71 + - Customize the whole content of build.xml 72 + - copy/paste the content of the rules files (minus the top node) 73 + into this file, replacing the <import> task. 74 + - customize to your needs. 75 + 76 + *********************** 77 + ****** IMPORTANT ****** 78 + *********************** 79 + In all cases you must update the value of version-tag below to read 'custom' instead of an integer, 80 + in order to avoid having your file be overridden by tools such as "android update project" 81 + --> 82 + <!-- version-tag: 1 --> 83 + <import file="${sdk.dir}/tools/ant/build.xml" /> 84 + 85 + </project>
+4 -4
android/default.properties android/project.properties
··· 1 1 # This file is automatically generated by Android Tools. 2 2 # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 - # 3 + # 4 4 # This file must be checked in Version Control Systems. 5 - # 5 + # 6 6 # To customize properties used by the Ant build system use, 7 - # "build.properties", and override values to adapt the script to your 7 + # "ant.properties", and override values to adapt the script to your 8 8 # project structure. 9 9 10 10 # Project target. 11 - target=android-11 11 + target=android-15
+40
android/proguard.cfg
··· 1 + -optimizationpasses 5 2 + -dontusemixedcaseclassnames 3 + -dontskipnonpubliclibraryclasses 4 + -dontpreverify 5 + -verbose 6 + -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 + 8 + -keep public class * extends android.app.Activity 9 + -keep public class * extends android.app.Application 10 + -keep public class * extends android.app.Service 11 + -keep public class * extends android.content.BroadcastReceiver 12 + -keep public class * extends android.content.ContentProvider 13 + -keep public class * extends android.app.backup.BackupAgentHelper 14 + -keep public class * extends android.preference.Preference 15 + -keep public class com.android.vending.licensing.ILicensingService 16 + 17 + -keepclasseswithmembernames class * { 18 + native <methods>; 19 + } 20 + 21 + -keepclasseswithmembers class * { 22 + public <init>(android.content.Context, android.util.AttributeSet); 23 + } 24 + 25 + -keepclasseswithmembers class * { 26 + public <init>(android.content.Context, android.util.AttributeSet, int); 27 + } 28 + 29 + -keepclassmembers class * extends android.app.Activity { 30 + public void *(android.view.View); 31 + } 32 + 33 + -keepclassmembers enum * { 34 + public static **[] values(); 35 + public static ** valueOf(java.lang.String); 36 + } 37 + 38 + -keep class * implements android.os.Parcelable { 39 + public static final android.os.Parcelable$Creator *; 40 + }