Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: build.gradle

Issue 29649555: Issue 6219 - Create flavors per ABI (Closed)
Patch Set: Created Dec. 26, 2017, 2:19 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.md ('k') | libadblockplus-android-settings/build.gradle » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « README.md ('k') | libadblockplus-android-settings/build.gradle » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld