comparison Makefile @ 442:ced663d2e957

migrate from Eclipse to Android Studio
author Carl Byington <carl@five-ten-sg.com>
date Thu, 03 Dec 2015 12:29:29 -0800
parents d29cce60f393
children 07deaa851e7d
comparison
equal deleted inserted replaced
441:592f0ef08d94 442:ced663d2e957
2 #tc55 is "Internal Storage" 2 #tc55 is "Internal Storage"
3 3
4 style:=release 4 style:=release
5 dest:=/run/user/1000/gvfs/mtp*/*torage/Download 5 dest:=/run/user/1000/gvfs/mtp*/*torage/Download
6 apk:='app/build/outputs/apk/510Connectbot-$(style).apk' 6 apk:='app/build/outputs/apk/510Connectbot-$(style).apk'
7 ver:=$(shell grep versionName app/src/main/AndroidManifest.xml | cut -d'"' -f2)
8 id:=$(shell hg id --id)
9 da:=$(shell date +%Y-%m-%d)
10 version:=\ 7 version:=\
11 <?xml version=\"1.0\" encoding=\"utf-8\"?>\n\ 8 <?xml version=\"1.0\" encoding=\"utf-8\"?>\n\
12 <resources>\n\ 9 <resources>\n\
13 <string name=\"msg_version\" translatable=\"false\">510Connectbot $(ver) ($(id) $(da))</string>\n\ 10 <string name=\"msg_version\" translatable=\"false\">510Connectbot $(ver) ($(id) $(da))</string>\n\
14 </resources>\n 11 </resources>\n
15 12
16 ifeq ($(style),release) 13 ifeq ($(style),release)
17 task=assembleRelease 14 task:=assembleRelease
18 else 15 else
19 task=assembleDebug 16 task:=assembleDebug
20 endif 17 endif
21 18
22 19
23 all: 20 all:
24 hg pull; hg update 21 hg pull; hg update
25 make builder 22 make builder
26 23
27 builder: prep 24 builder: prep
28 rm -rf app/build/* 25 rm -rf app/build/*
26 ver:=$(shell grep versionName app/src/main/AndroidManifest.xml | cut -d'"' -f2)
27 id:=$(shell hg id --id)
28 da:=$(shell date +%Y-%m-%d)
29 echo -e "$(version)" >app/src/main/res/values/version.xml 29 echo -e "$(version)" >app/src/main/res/values/version.xml
30 cat app/src/main/res/values/version.xml 30 cat app/src/main/res/values/version.xml
31 ./gradlew $(task) 31 ./gradlew $(task)
32 mv app/build/outputs/apk/app-arm-$(style).apk $(apk) 32 mv app/build/outputs/apk/app-arm-$(style).apk $(apk)
33 ls -al app/build/outputs/apk 33 ls -al app/build/outputs/apk