From 64bd4c93e760b6b82ce21f8101fe57242a302a00 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 1 Jan 2012 11:21:49 -0800 Subject: Use ant for now apkbuilder isn't supported any longer, so it doesn't appear possible to build with make until some replacement shell tool is created. Signed-off-by: Keith Packard --- Makefile | 56 +++++++++++++------------------------------------------- ant.properties | 4 ++++ build.xml | 2 +- 3 files changed, 18 insertions(+), 44 deletions(-) diff --git a/Makefile b/Makefile index 5468095..f8f86ef 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ -SDK=/home/keithp/src/android/android-sdk-linux -PWD=/home/keithp/src/android/AltosDroid +SDK=../android-sdk-linux DX=$(SDK)/platform-tools/dx ADB=$(SDK)/platform-tools/adb @@ -7,55 +6,26 @@ AAPT=$(SDK)/platform-tools/aapt APKBUILDER=$(SDK)/tools/apkbuilder ZIPALIGN=$(SDK)/tools/zipalign -PLATFORM=$(SDK)/platforms/android-10 -PLATFORM_JAR=$(PLATFORM)/android.jar -ADDONS=$(SDK)/add-ons/addon-google_apis-google_inc_-10/libs -TOOLS_LIB=$(SDK)/tools/lib -CLASSPATH=".:$(PLATFORM)/*:$(TOOLS_LIB)/*" -CLASSES=bin/classes SRC_DIR=src/org/altusmetrum/AltosDroid -GEN_DIR=gen/org/altusmetrum/AltosDroid -JAVAC=javac -BOOTCLASSPATH=$(PLATFORM_JAR):$(ADDONS)/usb.jar:$(ADDONS)/maps.jar - -JAVACFLAGS=\ - -d $(CLASSES) \ - -classpath $(CLASSES):. \ - -sourcepath src:gen \ - -target 1.5 \ - -bootclasspath $(BOOTCLASSPATH) \ - -encoding UTF-8 \ - -g \ - -source 1.5 SRC=\ $(SRC_DIR)/AltosDroid.java \ $(SRC_DIR)/BluetoothChatService.java \ - $(SRC_DIR)/DeviceListActivity.java \ - $(GEN_DIR)/R.java + $(SRC_DIR)/DeviceListActivity.java -all: align.stamp +all: bin/AltosDroid-debug.apk bin/AltosDroid-release.apk -install: AltosDroid.apk - $(ADB) -e install -r AltosDroid.apk +install-release: bin/AltosDroid-release.apk + $(ADB) install -r bin/AltosDroid-release.apk -$(GEN_DIR)/R.java: resources.stamp +install-debug: bin/AltosDroid-debug.apk + $(ADB) install -r bin/AltosDroid-debug.apk -resources.stamp: Makefile - mkdir -p res libs bin bin/res bin/classes gen assets - $(AAPT) package -f -m -M $(PWD)/AndroidManifest.xml -S $(PWD)/bin/res -S $(PWD)/res -I $(PLATFORM_JAR) -J $(PWD)/gen --generate-dependencies && touch $@ +bin/AltosDroid-debug.apk: $(SRC) + ant debug -class.stamp: $(SRC) - $(JAVAC) $(JAVACFLAGS) $(SRC) && touch $@ +bin/AltosDroid-release.apk: $(SRC) + ant release -dex.stamp: Makefile class.stamp - $(DX) --dex --output bin/classes.dex bin/classes && touch $@ - -crunch.stamp: Makefile dex.stamp - $(AAPT) crunch -v -S res -C bin/res - -package.stamp: Makefile crunch.stamp - $(AAPT) package --no-crunch -f --debug-mode -M $(PWD)/AndroidManifest.xml -S $(PWD)/bin/res -S $(PWD)/res -A $(PWD)/assets -I $(PLATFORM_JAR) -F $(PWD)/bin/activity.ap_ --generate-dependencies && touch $@ - -align.stamp: Makefile package.stamp - $(ZIPALIGN) -f 4 bin/activity-debug-unaligned.apk bin/activity-debug.apk && touch $@ \ No newline at end of file +clean: + ant clean \ No newline at end of file diff --git a/ant.properties b/ant.properties index ee52d86..5c19441 100644 --- a/ant.properties +++ b/ant.properties @@ -15,3 +15,7 @@ # 'key.alias' for the name of the key to use. # The password will be asked during the build when you use the 'release' target. +key.store=keystore +key.alias=bob +key.store.password=altusmetrum +key.alias.password=altusmetrum diff --git a/build.xml b/build.xml index cc4f61a..6a89edb 100644 --- a/build.xml +++ b/build.xml @@ -1,5 +1,5 @@ - +