forked from xamarin/jar2xml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
151 lines (106 loc) · 4.19 KB
/
Makefile
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
API_LEVELS = 4 7 8 10 12 13 14 15 16 17
TARGET=jar2xml.jar
all: $(TARGET)
all-api: api-4.xml.in api-7.xml.in api-8.xml.in api-10.xml.in api-12.xml.in api-13.xml.in api-14.xml.in api-15.xml.in api-16.xml.in api-17.xml.in
clean:
-rm -rf obj
-rm $(TARGET)
-rm -rf tmpout
-rm -rf annotations
-rm -rf scraper.exe scraper.exe.mdb
install:
uninstall:
sources = \
AndroidDocScraper.java \
IDocScraper.java \
JavaArchive.java \
JavaClass.java \
JavaPackage.java \
Start.java
$(TARGET): $(sources) MANIFEST.MF
-rm -rf obj
mkdir -p obj
javac -g -d obj $(sources) -cp asm-debug-all-4.0.jar
mkdir -p tmp-asm-expanded
unzip asm-debug-all-4.0.jar -d tmp-asm-expanded
jar cfm "$@" MANIFEST.MF LICENSE-ASM.txt -C obj/ . -C tmp-asm-expanded .
rm -r tmp-asm-expanded
scraper.exe : scraper.cs
mcs -debug scraper.cs
$(API_LEVELS:%=api-%.xml.in): api-%.xml.in: Makefile jar2xml.jar docs-api-% annotations/%.xml
java -jar jar2xml.jar --jar=$(ANDROID_SDK_PATH)/platforms/android-$*/android.jar [email protected] --droiddocpath=docs-api-$*/reference --annotations=annotations/$*.xml || exit 1
mono-xmltool --prettyprint [email protected] > [email protected] || exit 1
xmlstarlet c14n [email protected] > $@ || exit 1
# test API levels
test-4: api-4.xml.org api-4.xml.in
test-7: api-7.xml.org api-7.xml.in
test-8: api-8.xml.org api-8.xml.in
test-9: api-9.xml.org api-9.xml.in
test-10: api-10.xml.org api-10.xml.in
# (These rules are to get diff agains 10.)
test-12: api-10.xml.org api-12.xml.in
test-13: api-10.xml.org api-13.xml.in
clean-8:
rm api-8.xml.in annotations/8.xml tmpout/8-deprecated-members.xml
clean-9:
rm api-9.xml.in annotations/9.xml tmpout/9-deprecated-members.xml
clean-10:
rm api-10.xml.in annotations/10.xml tmpout/10-deprecated-members.xml
clean-12:
rm api-12.xml.in annotations/12.xml tmpout/12-deprecated-members.xml
clean-13:
rm api-13.xml.in annotations/13.xml tmpout/13-deprecated-members.xml
clean-14:
rm api-14.xml.in annotations/14.xml tmpout/14-deprecated-members.xml
clean-15:
rm api-15.xml.in annotations/15.xml tmpout/15-deprecated-members.xml
clean-16:
rm api-16.xml.in annotations/16.xml tmpout/16-deprecated-members.xml
clean-17:
rm api-17.xml.in annotations/17.xml tmpout/17-deprecated-members.xml
# download and setup docs directory for each API profile
define extract-docs
unzip $1 || exit 1
mv $2 $@
endef
docs-%.zip:
curl http://dl-ssl.google.com/android/repository/$@ > $@ || exit 1
# we couldn't find doc archive for Lv.4, so reusing Lv.7 archive here...
docs-api-4: docs-2.1_r01-linux.zip
$(call extract-docs,$<,docs-2.1_r01-linux)
docs-api-7: docs-2.1_r01-linux.zip
$(call extract-docs,$<,docs-2.1_r01-linux)
docs-api-8: docs-2.2_r01-linux.zip
$(call extract-docs,$<,docs_r01-linux)
docs-api-9: docs-2.3_r01-linux.zip
$(call extract-docs,$<,docs-2.3_r01-linux)
# API level 10 is Android v2.3.3; it's API level 9 (Android v2.3) with a few
# bugfixes which don't impact the documentation.
docs-api-10: docs-2.3_r01-linux.zip
$(call extract-docs,$<,docs-2.3_r01-linux)
docs-api-12: docs-3.1_r01-linux.zip
$(call extract-docs,$<,docs-3.1_r01-linux)
docs-api-13: docs-3.2_r01-linux.zip
$(call extract-docs,$<,docs_r01-linux)
docs-api-14: docs-14_r01.zip
$(call extract-docs,$<,docs)
docs-api-15: docs-15_r02.zip
$(call extract-docs,$<,docs)
docs-api-16: docs-16_r03.zip
$(call extract-docs,$<,docs)
docs-api-17: docs-17_r02.zip
$(call extract-docs,$<,docs)
api-%.xml.org:
# FIXME: disable them until some AOSP web repository becomes available.
#curl "http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob_plain;f=api/$(patsubst api-%.xml.org,%.xml,$@);hb=HEAD" > $@ || exit 1
#mono-xmltool --prettyprint $@ > [email protected] || exit 1
#xmlstarlet c14n [email protected] > $@ || exit 1
# annotations
$(API_LEVELS:%=annotations/%.xml): annotations/%.xml: Makefile scraper.exe docs-api-% tmpout/%-deprecated-members.xml
mkdir -p annotations
mono --debug scraper.exe tmpout/$*-deprecated-members.xml docs-api-$*/reference/ > annotations/$*.xml
$(API_LEVELS:%=tmpout/%-deprecated-members.xml): tmpout/%-deprecated-members.xml: Makefile docs-api-% scraper-main.sh scraper-collector.sh
mkdir -p tmpout
bash scraper-main.sh docs-api-$*/reference > tmpout/$*-deprecated-members.xml || exit 1