comparison 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
comparison
equal deleted inserted replaced
437:208b31032318 438:d29cce60f393
1 #mc40 is "On Device Storage" 1 #mc40 is "On Device Storage"
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='bin/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:=\
11 <?xml version=\"1.0\" encoding=\"utf-8\"?>\n\
12 <resources>\n\
13 <string name=\"msg_version\" translatable=\"false\">510Connectbot $(ver) ($(id) $(da))</string>\n\
14 </resources>\n
15
7 ifeq ($(style),release) 16 ifeq ($(style),release)
8 debuggable=false 17 task=assembleRelease
9 else 18 else
10 debuggable=true 19 task=assembleDebug
11 endif 20 endif
12 21
13 22
14 all: 23 all:
15 hg pull; hg update 24 hg pull; hg update
16 make builder 25 make builder
17 26
18 builder: prep 27 builder: prep
19 sed -i -e 's/android:debuggable=".*"/android:debuggable="$(debuggable)"/g' AndroidManifest.xml 28 rm -rf app/build/*
20 rm -rf gen bin 29 echo -e "$(version)" >app/src/main/res/values/version.xml
21 ndk-build clean; V=1 ndk-build 30 cat app/src/main/res/values/version.xml
22 android update project -p . -t android-16 31 ./gradlew $(task)
23 ant $(style) 32 mv app/build/outputs/apk/app-arm-$(style).apk $(apk)
33 ls -al app/build/outputs/apk
24 34
25 prep: 35 prep:
26 (cd help; make) 36 (cd help; make)
27 37
28 genkey: 38 genkey:
36 cp $(apk) $(dest) 46 cp $(apk) $(dest)
37 ls -al $(apk) $(dest) 47 ls -al $(apk) $(dest)
38 48
39 buildicon: 49 buildicon:
40 convert base.510.icon.png -background white -resize 500x500 -extent 1024x500 google.play.store/feature.510.icon.png 50 convert base.510.icon.png -background white -resize 500x500 -extent 1024x500 google.play.store/feature.510.icon.png
41 cp -a base.510.icon.png res/drawable-xxxhdpi/icon.png 51 cp -a base.510.icon.png app/src/main/res/drawable-xxxhdpi/icon.png
42 convert base.510.icon.png -resize 144x144 res/drawable-xxhdpi/icon.png 52 convert base.510.icon.png -resize 144x144 app/src/main/res/drawable-xxhdpi/icon.png
43 convert base.510.icon.png -resize 96x96 res/drawable-xhdpi/icon.png 53 convert base.510.icon.png -resize 96x96 app/src/main/res/drawable-xhdpi/icon.png
44 convert base.510.icon.png -resize 72x72 res/drawable-hdpi/icon.png 54 convert base.510.icon.png -resize 72x72 app/src/main/res/drawable-hdpi/icon.png
45 convert base.510.icon.png -resize 48x48 res/drawable-mdpi/icon.png 55 convert base.510.icon.png -resize 48x48 app/src/main/res/drawable-mdpi/icon.png
46 convert base.510.icon.png -resize 36x36 res/drawable-ldpi/icon.png 56 convert base.510.icon.png -resize 36x36 app/src/main/res/drawable-ldpi/icon.png
47 57
48 convert res/drawable-xxxhdpi/icon.png -resize 50% -colorspace Gray res/drawable-xxxhdpi/notification_icon.png 58 convert app/src/main/res/drawable-xxxhdpi/icon.png -resize 50% -colorspace Gray app/src/main/res/drawable-xxxhdpi/notification_icon.png
49 convert res/drawable-xxhdpi/icon.png -resize 50% -colorspace Gray res/drawable-xxhdpi/notification_icon.png 59 convert app/src/main/res/drawable-xxhdpi/icon.png -resize 50% -colorspace Gray app/src/main/res/drawable-xxhdpi/notification_icon.png
50 convert res/drawable-xhdpi/icon.png -resize 50% -colorspace Gray res/drawable-xhdpi/notification_icon.png 60 convert app/src/main/res/drawable-xhdpi/icon.png -resize 50% -colorspace Gray app/src/main/res/drawable-xhdpi/notification_icon.png
51 convert res/drawable-hdpi/icon.png -resize 50% -colorspace Gray res/drawable-hdpi/notification_icon.png 61 convert app/src/main/res/drawable-hdpi/icon.png -resize 50% -colorspace Gray app/src/main/res/drawable-hdpi/notification_icon.png
52 convert res/drawable-mdpi/icon.png -resize 50% -colorspace Gray res/drawable-mdpi/notification_icon.png 62 convert app/src/main/res/drawable-mdpi/icon.png -resize 50% -colorspace Gray app/src/main/res/drawable-mdpi/notification_icon.png
53 convert res/drawable-ldpi/icon.png -resize 50% -colorspace Gray res/drawable-ldpi/notification_icon.png 63 convert app/src/main/res/drawable-ldpi/icon.png -resize 50% -colorspace Gray app/src/main/res/drawable-ldpi/notification_icon.png
54 64
55 indentc: 65 indentc:
56 indent --line-length100 \ 66 indent --line-length100 \
57 --brace-indent4 \ 67 --brace-indent4 \
58 --braces-on-if-line \ 68 --braces-on-if-line \