From 58bf4f04b1c76122415ff020dce5a3b53f13a3d8 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 18 Feb 2024 14:58:38 +0100 Subject: [PATCH] Skip Android deps download if they already exist It's close to impossible to test locally built changes otherwise. --- android/native/build.gradle | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/android/native/build.gradle b/android/native/build.gradle index 396ccff85..e78ddfc49 100644 --- a/android/native/build.gradle +++ b/android/native/build.gradle @@ -43,19 +43,25 @@ android { } // get precompiled deps -task downloadDeps(type: Download) { - def depsDir = new File(buildDir.parent, 'deps') - def depsZip = new File(buildDir, 'deps.zip') +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') - src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps.zip' - dest depsZip - overwrite false + src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps.zip' + dest depsZip + overwrite false - task getDeps(dependsOn: downloadDeps, type: Copy) { - depsDir.mkdir() - from zipTree(depsZip) - into depsDir - doFirst { logger.lifecycle('Extracting to {}', depsDir) } + task getDeps(dependsOn: downloadDeps, type: Copy) { + depsDir.mkdir() + from zipTree(depsZip) + into depsDir + doFirst { logger.lifecycle('Extracting to {}', depsDir) } + } } }