-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild.gradle
185 lines (154 loc) · 6.41 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
// Check dependencies.
// https://github.com/ben-manes/gradle-versions-plugin
apply plugin: 'com.github.ben-manes.versions'
// Fabric
apply plugin: 'io.fabric'
apply from: '../config/quality/quality.gradle'
apply from: '../config/signing/signing.gradle'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.mercandalli.android.browser"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.appVersionCode
versionName rootProject.ext.appVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "en", "fr", "pt-rBR", "pt-rPT"
}
bundle {
density.enableSplit = true
abi.enableSplit = true
language.enableSplit = false
}
dexOptions {
// 4 Gigabytes is a maximum heap size for dex operation
// http://stackoverflow.com/questions/33750404/android-gradle-what-is-javamaxheapsize-4g
javaMaxHeapSize "4g"
}
signingConfigs {
releaseSigningConfig rootProject.ext.releaseTubeSigningConfig
}
buildTypes {
release {
signingConfig signingConfigs.releaseSigningConfig
minifyEnabled true
shrinkResources true
multiDexEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
versionNameSuffix ".dev"
}
}
testOptions {
animationsDisabled = true
}
sourceSets {
main {
// Split resources.
// https://medium.com/google-developer-experts/android-project-structure-alternative-way-29ce766682f0#.sjnhetuhb
res.srcDirs = [
'src/main/res/common',
'src/main/res/dialog',
'src/main/res/floating',
'src/main/res/icon',
'src/main/res/main',
'src/main/res/on_boarding',
'src/main/res/settings',
'src/main/res/settings_about',
'src/main/res/settings_ad_blocker',
'src/main/res/settings_search_engine',
'src/main/res/settings_theme',
'src/main/res/suggestion'
]
}
// Everything related to connected test live in src/androidTest/core/java
androidTest.java.srcDir 'src/androidTest/core/java'
// Instrumented unit tests live in src/androidTest/unit
androidTest.java.srcDir 'src/androidTest/unit/java'
// Instrumented integration tests live in src/androidTest/integration
androidTest.java.srcDir 'src/androidTest/integration/java'
// Instrumented use cases tests live in src/androidTest/usecases
androidTest.java.srcDir 'src/androidTest/usecases/java'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
configurations {
// KtLint - Static code analysis
// https://proandroiddev.com/kotlin-static-analysis-why-and-how-a12042e34a98
ktlint
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(":feature_purchase")
// Language
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version"
// AndroidX
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "com.google.android.material:material:1.0.0"
// Google
implementation "com.google.firebase:firebase-core:17.2.0"
implementation "com.google.firebase:firebase-config:19.0.3"
// Third party - Monitoring
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
transitive = true
}
// Third party - UI
implementation 'com.github.bumptech.glide:glide:4.10.0'
kapt 'com.github.bumptech.glide:compiler:4.10.0'
implementation 'com.hannesdorfmann:adapterdelegates4:4.2.0'
// Third party - Network
// noinspection GradleDependency
implementation "com.squareup.okhttp3:okhttp:3.12.1" // Require to support API<21
// KtLint - Static code analysis
// https://proandroiddev.com/kotlin-static-analysis-why-and-how-a12042e34a98
ktlint "com.github.shyiko:ktlint:0.31.0"
// Testing-only dependencies
androidTestImplementation "androidx.annotation:annotation:1.1.0"
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.1.1') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'design'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
androidTestImplementation 'tools.fastlane:screengrab:1.2.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:3.1.0'
testImplementation 'org.json:json:20190722'
}
task publish(type: Exec) {
group "play-store"
commandLine "sh", "../config/play-store/publish.sh"
}
// KtLint - Static code analysis
// https://proandroiddev.com/kotlin-static-analysis-why-and-how-a12042e34a98
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args "src/**/*.kt"
// args "--reporter=checkstyle, output=${buildDir}/ktlint.xml
}
apply plugin: 'com.google.gms.google-services'