-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.gradle
161 lines (132 loc) · 5.5 KB
/
common.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
ext.androidModule = { Boolean isApplication = false ->
if(isApplication) {
apply plugin: 'com.android.application'
} else {
apply plugin: 'com.android.library'
}
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
android {
compileSdkVersion ApplicationConfig.compileSdk
defaultConfig {
minSdkVersion ApplicationConfig.minSdk
targetSdkVersion ApplicationConfig.targetSdk
versionCode ApplicationConfig.versionCode
versionName ApplicationConfig.versionName
multiDexEnabled true
testInstrumentationRunner "com.simtop.billionbeers.di.MockTestRunner"
}
signingConfigs {
release {
//Load keystore
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(keystorePropertiesFile.newDataInputStream())
}
def localStoreFile = keystoreProperties.getProperty('STORE_FILE')
def ciStoreFile = System.getenv('STORE_FILE')
if(localStoreFile == null && ciStoreFile == null) return
storeFile file(localStoreFile != null ? localStoreFile : ciStoreFile)
def localStorePassword = keystoreProperties.getProperty('STORE_PASSWORD')
def ciStorePassword = System.getenv('STORE_PASSWORD')
storePassword localStorePassword != null ? localStorePassword : ciStorePassword
def localAlias = keystoreProperties.getProperty('ALIAS')
def ciAlias = System.getenv('ALIAS')
keyAlias localAlias != null ? localAlias : ciAlias
def localPassword = keystoreProperties.getProperty('PASSWORD')
def ciPassword = System.getenv('PASSWORD')
keyPassword localPassword != null ? localPassword : ciPassword
}
}
buildTypes {
debug {
testCoverageEnabled = true
}
release {
minifyEnabled true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
kapt {
correctErrorTypes true
}
// Always show the result of every unit test, even if it passes.
testOptions.unitTests {
includeAndroidResources = true
all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
}
maxHeapSize = "1024m"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
buildFeatures {
viewBinding = true
}
kapt {
generateStubs = true
}
//Solves some problems for compilation for UI Test
packagingOptions {
pickFirst "**/attach_hotspot_windows.dll"
exclude 'META-INF/AL2.0'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/licenses/ASM'
exclude 'META-INF/*.kotlin_module'
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation Libs.kotlin_stdlib_jdk7
implementation Libs.androidx_core_core_ktx
implementation Libs.appcompat
implementation Libs.material
implementation Libs.constraintlayout
implementation Libs.glide
implementation Libs.lifecycle_extensions
implementation Libs.converter_gson
implementation Libs.logging_interceptor
implementation Libs.room_compiler
implementation Libs.room_ktx
kapt Libs.room_runtime
implementation Libs.hilt_android
//kapt Libs.hilt_android_compiler
kapt Libs.hilt_compiler
testImplementation Libs.mockk_android
testImplementation Libs.mockk
testImplementation Libs.core_testing
testImplementation Libs.kotlinx_coroutines_test
testImplementation Libs.kluent_android
testImplementation Libs.mockwebserver
testImplementation Libs.junit
androidTestImplementation Libs.hilt_android_testing
kaptAndroidTest Libs.hilt_compiler
androidTestImplementation Libs.junit
androidTestImplementation Libs.kotlin_test_junit
androidTestImplementation Libs.kotlinx_coroutines_test
androidTestImplementation Libs.espresso_core
androidTestImplementation Libs.espresso_contrib
androidTestImplementation Libs.espresso_idling_resource
androidTestImplementation Libs.androidx_test_runner
androidTestImplementation Libs.androidx_test_rules
androidTestImplementation Libs.androidx_test_core_ktx
androidTestImplementation Libs.mockk_android
//androidTestImplementation Libs.mockk
androidTestImplementation Libs.junit_ktx
androidTestImplementation Libs.navigation_testing
androidTestImplementation Libs.core_testing
androidTestImplementation Libs.fragment_testing
}
}