| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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() |
| LEFT | RIGHT |