forked from Kotlin/anko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
download_android_sdk.xml
166 lines (125 loc) · 7.52 KB
/
download_android_sdk.xml
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" encoding="UTF-8"?>
<project name="download_android_sdk" default="download_android_sdk">
<property name="android.sdk.dir" value="lib/android-sdk"/>
<property name="download.dir" value="lib/download"/>
<condition property="tools.os" value="windows">
<os family="windows"/>
</condition>
<condition property="tools.os" value="macosx">
<os family="mac"/>
</condition>
<condition property="tools.os" value="linux">
<and>
<os family="unix"/>
<not>
<os family="mac"/>
</not>
</and>
</condition>
<target name="download_android_sdk">
<delete dir="${android.sdk.dir}" failonerror="false" />
<mkdir dir="${download.dir}"/>
<mkdir dir="${android.sdk.dir}"/>
<mkdir dir="${android.sdk.dir}/platforms"/>
<mkdir dir="${android.sdk.dir}/build-tools"/>
<download_android_platform android.versioncode="15_r05" android.sdk.version="15" android.full.version="4.0.4" />
<download_android_platform android.versioncode="19_r04" android.sdk.version="19" android.full.version="4.4.2" />
<download_android_platform android.versioncode="21_r02" android.sdk.version="21" android.full.version="5.0.1" />
<download_android_platform android.versioncode="23_r01" android.sdk.version="23" android.full.version="6.0" />
<download_platform_tools android.platform.tools.version="23" />
<download_tools android.tools.version="24.3.4" />
<download_build_tools android.build.tools.version="23.0.1" android.build.tools.full.version="6.0" />
<download_sources android.sources.versioncode="23_r01" android.sources.version="23" />
<download_support_repository android.repo.version="17" android.repo.last="23.0.0" />
</target>
<target name="download_sources">
<delete dir="${android.sdk.dir}" failonerror="false" />
<mkdir dir="${download.dir}"/>
<mkdir dir="${android.sdk.dir}"/>
<mkdir dir="${android.sdk.dir}/platforms"/>
<mkdir dir="${android.sdk.dir}/build-tools"/>
<download_sources android.sources.versioncode="21_r01" android.sources.version="21" />
</target>
<macrodef name="download_android_platform">
<attribute name="android.versioncode" />
<attribute name="android.sdk.version" />
<attribute name="android.full.version" />
<sequential>
<get src="http://dl-ssl.google.com/android/repository/android-@{android.versioncode}.zip"
dest="${download.dir}/android-platform-@{android.versioncode}.zip" usetimestamp="true"/>
<unzip src="${download.dir}/android-platform-@{android.versioncode}.zip" dest="${android.sdk.dir}/platforms"/>
<move file="${android.sdk.dir}/platforms/android-@{android.full.version}" tofile="${android.sdk.dir}/platforms/android-@{android.sdk.version}"/>
<delete dir="${android.sdk.dir}/platforms/android-@{android.full.version}"/>
</sequential>
</macrodef>
<macrodef name="download_platform_tools">
<attribute name="android.platform.tools.version" />
<sequential>
<get src="http://dl-ssl.google.com/android/repository/platform-tools_r@{android.platform.tools.version}-${tools.os}.zip"
dest="${download.dir}/android-platform-tools_r@{android.platform.tools.version}.zip" usetimestamp="true"/>
<unzip src="${download.dir}/android-platform-tools_r@{android.platform.tools.version}.zip" dest="${android.sdk.dir}"/>
</sequential>
</macrodef>
<macrodef name="download_tools">
<attribute name="android.tools.version" />
<sequential>
<get src="http://dl.google.com/android/repository/tools_r@{android.tools.version}-${tools.os}.zip"
dest="${download.dir}/android-tools_r@{android.tools.version}.zip" usetimestamp="true"/>
<unzip src="${download.dir}/android-tools_r@{android.tools.version}.zip" dest="${android.sdk.dir}"/>
</sequential>
</macrodef>
<macrodef name="download_build_tools">
<attribute name="android.build.tools.version" />
<attribute name="android.build.tools.full.version" />
<sequential>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="lib/ant-contrib.jar"/>
<get src="http://dl.google.com/android/repository/build-tools_r@{android.build.tools.version}-${tools.os}.zip"
dest="${download.dir}/android-build-tools_r@{android.build.tools.version}.zip" usetimestamp="true"/>
<unzip src="${download.dir}/android-build-tools_r@{android.build.tools.version}.zip" dest="${android.sdk.dir}/build-tools"/>
<move file="${android.sdk.dir}/build-tools/android-@{android.build.tools.full.version}"
tofile="${android.sdk.dir}/build-tools/@{android.build.tools.version}"/>
<if>
<equals arg1="${tools.os}" arg2="windows"/>
<then />
<else>
<exec executable="chmod">
<arg value="a+x"/>
<arg path="${android.sdk.dir}/build-tools/@{android.build.tools.version}/aapt"/>
<arg path="${android.sdk.dir}/build-tools/@{android.build.tools.version}/aidl"/>
<arg path="${android.sdk.dir}/build-tools/@{android.build.tools.version}/dx"/>
<arg path="${android.sdk.dir}/build-tools/@{android.build.tools.version}/zipalign"/>
</exec>
</else>
</if>
</sequential>
</macrodef>
<macrodef name="download_support_repository">
<attribute name="android.repo.version" />
<attribute name="android.repo.last" />
<sequential>
<get src="http://dl-ssl.google.com/android/repository/android_m2repository_r@{android.repo.version}.zip"
dest="${download.dir}/android_m2repository_r@{android.repo.version}.zip" usetimestamp="true"/>
<mkdir dir="${android.sdk.dir}/extras/android" />
<unzip src="${download.dir}/android_m2repository_r@{android.repo.version}.zip" dest="${android.sdk.dir}/extras/android"/>
<unzip
src="${android.sdk.dir}/extras/android/m2repository/com/android/support/appcompat-v7/@{android.repo.last}/appcompat-v7-@{android.repo.last}.aar"
dest="${android.sdk.dir}/support/appcompat-v7" />
<unzip
src="${android.sdk.dir}/extras/android/m2repository/com/android/support/support-v4/@{android.repo.last}/support-v4-@{android.repo.last}.aar"
dest="${android.sdk.dir}/support/support-v4" />
</sequential>
</macrodef>
<macrodef name="download_sources">
<attribute name="android.sources.versioncode" />
<attribute name="android.sources.version" />
<sequential>
<get src="http://dl-ssl.google.com/android/repository/sources-@{android.sources.versioncode}.zip"
dest="${download.dir}/android_sources_@{android.sources.versioncode}.zip" usetimestamp="true"/>
<mkdir dir="${android.sdk.dir}/sources/android-@{android.sources.version}" />
<unzip src="${download.dir}/android_sources_@{android.sources.versioncode}.zip"
dest="${android.sdk.dir}/sources"/>
<move file="${android.sdk.dir}/sources/src"
tofile="${android.sdk.dir}/sources/android-@{android.sources.version}"/>
</sequential>
</macrodef>
</project>