OLD | NEW |
1 apply plugin: 'com.android.application' | 1 apply plugin: 'com.android.application' |
2 apply plugin: 'kotlin-android' | 2 apply plugin: 'kotlin-android' |
3 | 3 |
4 android { | 4 android { |
5 compileSdkVersion rootProject.ext.compileSdkVersion | 5 compileSdkVersion rootProject.ext.compileSdkVersion |
6 buildToolsVersion rootProject.ext.buildToolsVersion | 6 buildToolsVersion rootProject.ext.buildToolsVersion |
7 | 7 |
8 compileOptions { | 8 compileOptions { |
9 sourceCompatibility = rootProject.ext.sourceCompatibilityVersion | 9 sourceCompatibility = rootProject.ext.sourceCompatibilityVersion |
10 targetCompatibility = rootProject.ext.targetCompatibilityVersion | 10 targetCompatibility = rootProject.ext.targetCompatibilityVersion |
(...skipping 17 matching lines...) Expand all Loading... |
28 buildTypes { | 28 buildTypes { |
29 release { | 29 release { |
30 minifyEnabled true | 30 minifyEnabled true |
31 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'progu
ard-rules.pro' | 31 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'progu
ard-rules.pro' |
32 lintOptions { | 32 lintOptions { |
33 disable 'MissingTranslation' | 33 disable 'MissingTranslation' |
34 } | 34 } |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
| 38 flavorDimensions "region" |
| 39 |
| 40 productFlavors { |
| 41 world { |
| 42 dimension "region" |
| 43 } |
| 44 |
| 45 cn { |
| 46 dimension "region" |
| 47 applicationIdSuffix ".cn" |
| 48 } |
| 49 } |
| 50 |
38 testOptions { | 51 testOptions { |
39 unitTests { | 52 unitTests { |
40 includeAndroidResources = true | 53 includeAndroidResources = true |
41 } | 54 } |
42 } | 55 } |
43 | 56 |
44 afterEvaluate { project -> | 57 afterEvaluate { project -> |
45 project.tasks.generateReleaseResources << { | |
46 | 58 |
47 updateBundledLists() | 59 project.tasks.all { task -> |
48 println('Bundled lists updated at ' + new Date().format('dd MMM yyyy
, HH:mm:ss zzz')) | 60 if (task.name.matches("generate.*Release.*Resources")) { |
| 61 task.doLast { |
| 62 updateBundledLists() |
| 63 println('Bundled lists updated at ' + new Date().format('dd
MMM yyyy, HH:mm:ss zzz')) |
| 64 } |
| 65 } |
49 } | 66 } |
50 } | 67 } |
51 } | 68 } |
52 | 69 |
53 def updateBundledLists() { | 70 def updateBundledLists() { |
54 new URL(rootProject.ext.easyListUpdateUrl).withInputStream { | 71 new URL(rootProject.ext.easyListUpdateUrl).withInputStream { |
55 i -> new File(rootProject.ext.easyListFilePath).withOutputStream { it <<
i } | 72 i -> new File(rootProject.ext.easyListFilePath).withOutputStream { it <<
i } |
56 } | 73 } |
57 new URL(rootProject.ext.exceptionRulesUpdateUrl).withInputStream { | 74 new URL(rootProject.ext.exceptionRulesUpdateUrl).withInputStream { |
58 i -> new File(rootProject.ext.exceptionRulesFilePath).withOutputStream {
it << i } | 75 i -> new File(rootProject.ext.exceptionRulesFilePath).withOutputStream {
it << i } |
59 } | 76 } |
60 } | 77 } |
61 | 78 |
62 dependencies { | 79 dependencies { |
63 testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion" | 80 testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion" |
64 testImplementation 'junit:junit:4.12' | 81 testImplementation 'junit:junit:4.12' |
65 testImplementation 'org.mockito:mockito-core:2.11.0' | 82 testImplementation 'org.mockito:mockito-core:2.11.0' |
66 testImplementation 'org.robolectric:robolectric:3.5.1' | 83 testImplementation 'org.robolectric:robolectric:3.5.1' |
67 implementation "com.android.support:support-v4:$rootProject.ext.androidSuppo
rtLibraryVersion" | 84 implementation "com.android.support:support-v4:$rootProject.ext.androidSuppo
rtLibraryVersion" |
68 implementation (group: 'commons-validator', name: 'commons-validator', versi
on: '+') { | 85 implementation (group: 'commons-validator', name: 'commons-validator', versi
on: '+') { |
69 exclude group: 'commons-logging', module: 'commons-logging' | 86 exclude group: 'commons-logging', module: 'commons-logging' |
70 } | 87 } |
71 } | 88 } |
OLD | NEW |