Index: adblockplussbrowser/build.gradle |
=================================================================== |
--- a/adblockplussbrowser/build.gradle |
+++ b/adblockplussbrowser/build.gradle |
@@ -17,6 +17,8 @@ |
targetSdkVersion rootProject.ext.targetSdkVersion |
versionCode 14 |
versionName '1.1.4' |
+ buildConfigField "String", "FLAVOR_REGION_WORLD", '"world"' |
+ buildConfigField "String", "FLAVOR_REGION_CHINA", '"china"' |
diegocarloslima
2018/04/20 13:33:01
Since the current flavor is defined at build time,
|
} |
sourceSets { |
@@ -43,7 +45,7 @@ |
dimension "region" |
} |
- cn { |
+ china { |
diegocarloslima
2018/04/20 13:33:01
Renamed to make the flavor finding through the tas
|
dimension "region" |
applicationIdSuffix ".cn" |
} |
@@ -60,7 +62,7 @@ |
project.tasks.all { task -> |
if (task.name.matches("generate.*Release.*Resources")) { |
task.doLast { |
- updateBundledLists() |
+ updateBundledLists(task.name) |
println('Bundled lists updated at ' + new Date().format('dd MMM yyyy, HH:mm:ss zzz')) |
} |
} |
@@ -68,8 +70,10 @@ |
} |
} |
-def updateBundledLists() { |
- new URL(rootProject.ext.easyListUpdateUrl).withInputStream { |
+def updateBundledLists(taskName) { |
+ def easylistUrl = taskName.contains("China") ? |
diegocarloslima
2018/04/20 13:33:02
I couldn't find any reliable and elegant way of de
|
+ rootProject.ext.easyListChinaUpdateUrl : rootProject.ext.easyListDefaultUpdateUrl |
+ new URL(easylistUrl).withInputStream { |
i -> new File(rootProject.ext.easyListFilePath).withOutputStream { it << i } |
} |
new URL(rootProject.ext.exceptionRulesUpdateUrl).withInputStream { |