File: rules

package info (click to toggle)
android-framework-23 6.0.1+r72-5
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 233,244 kB
  • sloc: java: 1,707,033; xml: 247,323; cpp: 211,819; ansic: 2,748; python: 2,640; sh: 1,517; yacc: 343; lex: 214; ruby: 183; perl: 88; makefile: 63; sed: 19
file content (76 lines) | stat: -rwxr-xr-x 3,381 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

UPSTREAM_TAG := android-$(subst +,_,$(DEB_VERSION_UPSTREAM))
REPOS := development \
         frameworks-base \
         frameworks-opt-net-voip \
         frameworks-opt-telephony \
         libcore \
         external/junit
LOGTAGS := $(shell find frameworks/base/core -name *.logtags)
export ANDROID_API_LEVEL = 23

debian/out/all-event-log-tags.txt: $(LOGTAGS)
	merge-event-log-tags -o $@ $^

%/EventLogTags.java: %/EventLogTags.logtags debian/out/all-event-log-tags.txt
	java-event-log-tags -o $@ $^

aidl:
	make -f debian/aidl.mk

%:
	dh $@ --buildsystem=gradle --with maven-repo-helper

override_dh_auto_build: aidl
	mkdir -p debian/out/R
	ln -s values-mcc310-mnc150 frameworks/base/core/res/res/values-mcc310-mnc170
	ln -s values-mcc310-mnc150 frameworks/base/core/res/res/values-mcc310-mnc380
	aapt package -u -x -z -m -J debian/out/R \
	             -M frameworks/base/core/res/AndroidManifest.xml \
	             -S frameworks/base/core/res/res \
	             -A frameworks/base/core/res/assets \
	             -F debian/out/framework-res.apk \
	             --min-sdk-version $(ANDROID_API_LEVEL) \
	             --target-sdk-version $(ANDROID_API_LEVEL) \
	             --product default \
	             --version-code $(ANDROID_API_LEVEL) --version-name 6.0.1 \
	             --skip-symbols-without-default-localization
	7z x debian/out/framework-res.apk -odebian/out/framework-res
	dh_auto_build -- \
		-Dfile.encoding=UTF-8 \
		--settings-file debian/settings.gradle \
		assemble
	proguard -include debian/shrinkedAndroid.proguard.flags \
	         -injars debian/out/android/build/libs/android-$(ANDROID_API_LEVEL).jar\(**/*.class\) \
	         -outjars debian/out/shrinkedAndroid.jar

override_dh_auto_clean:
	dh_auto_clean
	$(RM) -r debian/.gradle debian/build .gradle
	$(RM) -r debian/out
	$(RM) $(LOGTAGS:.logtags=.java)
	$(RM) frameworks/base/core/res/res/values-mcc310-mnc170
	$(RM) frameworks/base/core/res/res/values-mcc310-mnc380

override_dh_install:
	dh_install
	find debian/android-sdk-platform-$(ANDROID_API_LEVEL)/usr/share/android-sdk-platform-$(ANDROID_API_LEVEL)/emulator-skins -name *.ini -exec chmod -x '{}' \;
	find debian/android-sdk-platform-$(ANDROID_API_LEVEL)/usr/share/android-sdk-platform-$(ANDROID_API_LEVEL)/emulator-skins -name layout -exec chmod -x '{}' \;
	find debian/android-sdk-platform-$(ANDROID_API_LEVEL)/usr/share/android-sdk-platform-$(ANDROID_API_LEVEL)/res -name *.xml -exec chmod -x '{}' \;

override_mh_install:
	mh_install
	$(RM) -r debian/libandroid-$(ANDROID_API_LEVEL)-java/usr/share/maven-repo/com/android/android/debian
	$(RM) -r debian/libandroid-uiautomator-$(ANDROID_API_LEVEL)-java/usr/share/maven-repo/com/android/uiautomator/debian

get-orig-source: $(patsubst %, %.tar.gz, $(REPOS))
	$(foreach repo, $(REPOS), mkdir -p $(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM)/$(subst -,/,$(repo));)
	$(foreach repo, $(REPOS), tar -f $(repo).tar.gz -z -x --directory $(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM)/$(subst -,/,$(repo));)
	(cd $(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM); tar --create --xz -f ../../$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM).orig.tar.xz --exclude-from ../debian/orig.excludes *)
	rm -r $^ $(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM)

%.tar.gz:
	wget https://android.googlesource.com/platform/$(subst .tar.gz,,$(subst -,/,$@))/+archive/$(UPSTREAM_TAG).tar.gz -O $@