Index: build.gradle |
diff --git a/build.gradle b/build.gradle |
index 6ab4fb584ec17006bd37e78456c3b4e8569ae51a..e53d893e674aad1902aab7ab6a2f1dc1dd575bdd 100644 |
--- a/build.gradle |
+++ b/build.gradle |
@@ -1,3 +1,28 @@ |
+import java.util.regex.Matcher |
+import java.util.regex.Pattern |
+ |
+// ABI flavor of "libadblockplus-android" module |
+def getAbiFlavor() { |
+ Gradle gradle = getGradle() |
+ String taskReqStr = gradle.getStartParameter().getTaskRequests().toString() |
+ |
+ Pattern pattern; |
+ |
+ if (taskReqStr.contains("assemble")) { |
+ pattern = Pattern.compile("assemble(Abi_\\w{2,3})(Release|Debug)*(\\w*)") |
+ } else { |
+ pattern = Pattern.compile("generate(Abi_\\w{2,3})(Release|Debug)*(\\w*)") |
+ } |
+ |
+ Matcher matcher = pattern.matcher(taskReqStr) |
+ |
+ if (matcher.find()) { |
+ return matcher.group(1).toLowerCase() |
+ } else { |
+ return "abi_all" |
+ } |
+} |
+ |
buildscript { |
repositories { |
mavenLocal() |
@@ -12,3 +37,5 @@ buildscript { |
subprojects { |
task listAllDependencies(type: DependencyReportTask) {} |
} |
+ |
+println "[Configuration] Using libadblockplus-android ABI flavor: " + getAbiFlavor() |