Index: build.gradle |
diff --git a/build.gradle b/build.gradle |
index 6ab4fb584ec17006bd37e78456c3b4e8569ae51a..c84409b78f501ed49d095fd15f54937573f23b7f 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 tskReqStr = gradle.getStartParameter().getTaskRequests().toString() |
diegocarloslima
2018/01/03 11:42:02
Minor thing, but I think it would be better to ren
anton
2018/01/09 06:20:40
Acknowledged.
|
+ |
+ Pattern pattern; |
+ |
+ if (tskReqStr.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(tskReqStr) |
+ |
+ 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() |