Skip Android deps download if they already exist

It's close to impossible to test locally built changes otherwise.
This commit is contained in:
sfan5 2024-02-18 14:58:38 +01:00 committed by grorp
parent ab2419db24
commit 5715434d5e

@ -43,8 +43,13 @@ android {
} }
// get precompiled deps // get precompiled deps
task downloadDeps(type: Download) { def depsDir = new File(buildDir.parent, 'deps')
def depsDir = new File(buildDir.parent, 'deps') if (new File(depsDir, 'armeabi-v7a').exists()) {
task getDeps {
doLast { logger.lifecycle('Using existing deps from {}', depsDir) }
}
} else {
task downloadDeps(type: Download) {
def depsZip = new File(buildDir, 'deps.zip') def depsZip = new File(buildDir, 'deps.zip')
src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps.zip' src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps.zip'
@ -57,6 +62,7 @@ task downloadDeps(type: Download) {
into depsDir into depsDir
doFirst { logger.lifecycle('Extracting to {}', depsDir) } doFirst { logger.lifecycle('Extracting to {}', depsDir) }
} }
}
} }
preBuild.dependsOn getDeps preBuild.dependsOn getDeps