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

Delta Between Two Patch Sets: build.gradle

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

Powered by Google App Engine
This is Rietveld