| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 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 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.
| |
| 8 | |
| 9 Pattern pattern; | |
| 10 | |
| 11 if (tskReqStr.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(tskReqStr) | |
| 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() | |
| OLD | NEW |