From fa7eae752dd1ac2ef437f4cb19ed9a79ae93418e Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 11 Jan 2018 18:07:57 +0100 Subject: Only build openvpn3 swig files when building openvpn3 --- main/build.gradle | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/main/build.gradle b/main/build.gradle index f10f3795..0d23fcdc 100644 --- a/main/build.gradle +++ b/main/build.gradle @@ -137,6 +137,13 @@ android.applicationVariants.all { variant -> variant.mergeAssets.dependsOn(variant.externalNativeBuildTasks) } -android.applicationVariants.all { variant -> - variant.getJavaCompiler().dependsOn(generateOpenVPN3Swig) -} + +android.variantFilter { variant -> + def dim = variant.flavors.collectEntries { + [(it.productFlavor.dimension): it.productFlavor.name] + } + + if (dim.dimensionOne == 'implementation' && dim.dimensionSecond == 'ovpn3') { + variant.getJavaCompiler().dependsOn(generateOpenVPN3Swig) + } +} \ No newline at end of file -- cgit v1.2.3