diff Makefile @ 438:d29cce60f393

migrate from Eclipse to Android Studio
author Carl Byington <carl@five-ten-sg.com>
date Thu, 03 Dec 2015 11:23:55 -0800
parents 47de9ffed872
children ced663d2e957
line wrap: on
line diff
--- a/Makefile	Fri Jun 19 13:41:57 2015 -0700
+++ b/Makefile	Thu Dec 03 11:23:55 2015 -0800
@@ -1,13 +1,22 @@
 #mc40 is "On Device Storage"
 #tc55 is "Internal Storage"
 
-style=release
-dest=/run/user/1000/gvfs/mtp*/*torage/Download
-apk='bin/510Connectbot-$(style).apk'
+style:=release
+dest:=/run/user/1000/gvfs/mtp*/*torage/Download
+apk:='app/build/outputs/apk/510Connectbot-$(style).apk'
+ver:=$(shell grep versionName app/src/main/AndroidManifest.xml | cut -d'"' -f2)
+id:=$(shell hg id --id)
+da:=$(shell date +%Y-%m-%d)
+version:=\
+<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\
+<resources>\n\
+	<string name=\"msg_version\" translatable=\"false\">510Connectbot $(ver) ($(id) $(da))</string>\n\
+</resources>\n
+
 ifeq ($(style),release)
-    debuggable=false
+    task=assembleRelease
 else
-	debuggable=true
+	task=assembleDebug
 endif
 
 
@@ -16,11 +25,12 @@
 	make builder
 
 builder: prep
-	sed -i -e 's/android:debuggable=".*"/android:debuggable="$(debuggable)"/g' AndroidManifest.xml
-	rm -rf gen bin
-	ndk-build clean; V=1 ndk-build
-	android update project -p . -t android-16
-	ant $(style)
+	rm -rf app/build/*
+	echo -e "$(version)" >app/src/main/res/values/version.xml
+	cat app/src/main/res/values/version.xml
+	./gradlew $(task)
+	mv app/build/outputs/apk/app-arm-$(style).apk $(apk)
+	ls -al app/build/outputs/apk
 
 prep:
 	(cd help; make)
@@ -38,19 +48,19 @@
 
 buildicon:
 	convert base.510.icon.png -background white -resize 500x500 -extent 1024x500 google.play.store/feature.510.icon.png
-	cp -a   base.510.icon.png                 res/drawable-xxxhdpi/icon.png
-	convert base.510.icon.png -resize 144x144 res/drawable-xxhdpi/icon.png
-	convert base.510.icon.png -resize 96x96   res/drawable-xhdpi/icon.png
-	convert base.510.icon.png -resize 72x72   res/drawable-hdpi/icon.png
-	convert base.510.icon.png -resize 48x48   res/drawable-mdpi/icon.png
-	convert base.510.icon.png -resize 36x36   res/drawable-ldpi/icon.png
+	cp -a   base.510.icon.png                 app/src/main/res/drawable-xxxhdpi/icon.png
+	convert base.510.icon.png -resize 144x144 app/src/main/res/drawable-xxhdpi/icon.png
+	convert base.510.icon.png -resize 96x96   app/src/main/res/drawable-xhdpi/icon.png
+	convert base.510.icon.png -resize 72x72   app/src/main/res/drawable-hdpi/icon.png
+	convert base.510.icon.png -resize 48x48   app/src/main/res/drawable-mdpi/icon.png
+	convert base.510.icon.png -resize 36x36   app/src/main/res/drawable-ldpi/icon.png
 
-	convert res/drawable-xxxhdpi/icon.png -resize 50% -colorspace Gray res/drawable-xxxhdpi/notification_icon.png
-	convert res/drawable-xxhdpi/icon.png  -resize 50% -colorspace Gray res/drawable-xxhdpi/notification_icon.png
-	convert res/drawable-xhdpi/icon.png   -resize 50% -colorspace Gray res/drawable-xhdpi/notification_icon.png
-	convert res/drawable-hdpi/icon.png    -resize 50% -colorspace Gray res/drawable-hdpi/notification_icon.png
-	convert res/drawable-mdpi/icon.png    -resize 50% -colorspace Gray res/drawable-mdpi/notification_icon.png
-	convert res/drawable-ldpi/icon.png    -resize 50% -colorspace Gray res/drawable-ldpi/notification_icon.png
+	convert app/src/main/res/drawable-xxxhdpi/icon.png -resize 50% -colorspace Gray app/src/main/res/drawable-xxxhdpi/notification_icon.png
+	convert app/src/main/res/drawable-xxhdpi/icon.png  -resize 50% -colorspace Gray app/src/main/res/drawable-xxhdpi/notification_icon.png
+	convert app/src/main/res/drawable-xhdpi/icon.png   -resize 50% -colorspace Gray app/src/main/res/drawable-xhdpi/notification_icon.png
+	convert app/src/main/res/drawable-hdpi/icon.png    -resize 50% -colorspace Gray app/src/main/res/drawable-hdpi/notification_icon.png
+	convert app/src/main/res/drawable-mdpi/icon.png    -resize 50% -colorspace Gray app/src/main/res/drawable-mdpi/notification_icon.png
+	convert app/src/main/res/drawable-ldpi/icon.png    -resize 50% -colorspace Gray app/src/main/res/drawable-ldpi/notification_icon.png
 
 indentc:
 	indent --line-length100 \