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: renamed variable Created Jan. 9, 2018, 6:20 a.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..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()
« 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