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

Side by Side Diff: build.gradle

Issue 29649555: Issue 6219 - Create flavors per ABI (Closed)
Patch Set: renamed variable Created Jan. 9, 2018, 6:20 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « README.md ('k') | libadblockplus-android-settings/build.gradle » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import java.util.regex.Matcher
2 import java.util.regex.Pattern
3
4 // ABI flavor of "libadblockplus-android" module
5 def getAbiFlavor() {
6 Gradle gradle = getGradle()
7 String taskReqStr = gradle.getStartParameter().getTaskRequests().toString()
8
9 Pattern pattern;
10
11 if (taskReqStr.contains("assemble")) {
12 pattern = Pattern.compile("assemble(Abi_\\w{2,3})(Release|Debug)*(\\w*)")
13 } else {
14 pattern = Pattern.compile("generate(Abi_\\w{2,3})(Release|Debug)*(\\w*)")
15 }
16
17 Matcher matcher = pattern.matcher(taskReqStr)
18
19 if (matcher.find()) {
20 return matcher.group(1).toLowerCase()
21 } else {
22 return "abi_all"
23 }
24 }
25
1 buildscript { 26 buildscript {
2 repositories { 27 repositories {
3 mavenLocal() 28 mavenLocal()
4 mavenCentral() 29 mavenCentral()
5 jcenter() 30 jcenter()
6 } 31 }
7 dependencies { 32 dependencies {
8 classpath 'com.android.tools.build:gradle:2.3.0' 33 classpath 'com.android.tools.build:gradle:2.3.0'
9 } 34 }
10 } 35 }
11 36
12 subprojects { 37 subprojects {
13 task listAllDependencies(type: DependencyReportTask) {} 38 task listAllDependencies(type: DependencyReportTask) {}
14 } 39 }
40
41 println "[Configuration] Using libadblockplus-android ABI flavor: " + getAbiFlav or()
OLDNEW
« 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