|
@@ -165,50 +165,6 @@ ext {
|
165
|
165
|
libreBuild = (System.env.LIBRE_BUILD ?: "false").toBoolean()
|
166
|
166
|
}
|
167
|
167
|
|
168
|
|
-// If Android SDK is not installed, accept its license so that it
|
169
|
|
-// is automatically downloaded.
|
170
|
|
-afterEvaluate { project ->
|
171
|
|
- // Either the environment variable ANDROID_HOME or the property sdk.dir in
|
172
|
|
- // local.properties identifies where Android SDK is installed.
|
173
|
|
- def androidHome = System.env.ANDROID_HOME
|
174
|
|
- if (!androidHome) {
|
175
|
|
- // ANDROID_HOME is not set. Is sdk.dir set?
|
176
|
|
- def file = file("${project.rootDir}/local.properties")
|
177
|
|
- def props = new Properties()
|
178
|
|
- if (file.canRead()) {
|
179
|
|
- file.withInputStream {
|
180
|
|
- props.load(it)
|
181
|
|
- androidHome = props.'sdk.dir'
|
182
|
|
- }
|
183
|
|
- }
|
184
|
|
- if (!androidHome && (!file.exists() || file.canWrite())) {
|
185
|
|
- // Neither ANDROID_HOME nor sdk.dir is set. Set sdk.dir (because
|
186
|
|
- // environment variables cannot be set).
|
187
|
|
- props.'sdk.dir' = "${project.buildDir}/android-sdk".toString()
|
188
|
|
- file.withOutputStream {
|
189
|
|
- props.store(it, null)
|
190
|
|
- androidHome = props.'sdk.dir'
|
191
|
|
- }
|
192
|
|
- }
|
193
|
|
- }
|
194
|
|
- // If the license is not accepted, accept it so that automatic downloading
|
195
|
|
- // kicks in.
|
196
|
|
- // The license hash can be taken from the accepted licenses, by doing this
|
197
|
|
- // on your local machine the file is
|
198
|
|
- // ${androidHome}/licenses/android-sdk-license
|
199
|
|
- if (androidHome) {
|
200
|
|
- def dir = file("${androidHome}/licenses")
|
201
|
|
- dir.mkdirs()
|
202
|
|
- def file = file("${dir.path}/android-sdk-license")
|
203
|
|
- if (!file.exists()) {
|
204
|
|
- file.withWriter {
|
205
|
|
- def hash = 'd56f5187479451eabf01fb78af6dfcb131a6481e'
|
206
|
|
- it.write(hash, 0, hash.length())
|
207
|
|
- }
|
208
|
|
- }
|
209
|
|
- }
|
210
|
|
-}
|
211
|
|
-
|
212
|
168
|
// Force the version of the Android build tools we have chosen on all
|
213
|
169
|
// subprojects. The forcing was introduced for react-native and the third-party
|
214
|
170
|
// modules that we utilize such as react-native-background-timer.
|