-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
107 lines (93 loc) · 4.34 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
def versionMajor = 1
def versionMinor = 3
def versionPatch = 0
def versionCode = versionPatch + versionMinor * 100 + versionMajor * 10000
androidConfig = [
compileSdkVersion : 28,
minSdkVersion : 16,
targetSdkVersion : 28,
versionCode : versionCode,
versionName : "${versionMajor}.${versionMinor}.${versionPatch}",
testInstrumentationRunner: "androidx.test.runner.AndroidJUnitRunner"
]
}
buildscript {
ext {
depPaths = {
def versions = [
gradlePlugin : '4.2.1',
androidJunit5 : '1.6.2.0',
versions : '0.36.0',
kotlin : '1.5.10',
coroutines : '1.5.0',
appCompat : '1.2.0',
material : '1.2.0',
workManager : '2.4.0',
junit : '4.12',
junitAnd : '1.1.2-rc03',
spek : '2.0.14',
mockk : '1.10.2',
hamkrest : '1.8.0.1',
mockitoKotlin : '1.5.0',
mockitoAndroid: '2.8.47',
espresso : '3.3.0-rc03',
]
[
gradlePlugin : "com.android.tools.build:gradle:$versions.gradlePlugin",
kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin",
androidJunit5 : "de.mannodermaus.gradle.plugins:android-junit5:$versions.androidJunit5",
versionsPlugin: "com.github.ben-manes:gradle-versions-plugin:$versions.versions",
kotlinStd : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$versions.kotlin",
kotlinReflect : "org.jetbrains.kotlin:kotlin-reflect:$versions.kotlin",
kotlinTestJ5 : "org.jetbrains.kotlin:kotlin-test-junit5:$versions.kotlin",
coroutines : "org.jetbrains.kotlinx:kotlinx-coroutines-core:$versions.coroutines",
coroutinesTest: "org.jetbrains.kotlinx:kotlinx-coroutines-test:$versions.coroutines",
coroutinesAnd : "org.jetbrains.kotlinx:kotlinx-coroutines-android:$versions.coroutines",
appCompat : "androidx.appcompat:appcompat:$versions.appCompat",
material : "com.google.android.material:material:$versions.material",
workManager : "androidx.work:work-runtime:$versions.workManager",
junit : "junit:junit:$versions.junit",
junitAnd : "androidx.test.ext:junit:$versions.junitAnd",
spekDsl : "org.spekframework.spek2:spek-dsl-jvm:$versions.spek",
spekRunner : "org.spekframework.spek2:spek-runner-junit5:$versions.spek",
mockk : "io.mockk:mockk:$versions.mockk",
hamkrest : "com.natpryce:hamkrest:$versions.hamkrest",
mockitoKotlin : "com.nhaarman:mockito-kotlin-kt1.1:$versions.mockitoKotlin",
mockitoAndroid: "org.mockito:mockito-android:$versions.mockitoAndroid",
espressoCore : "androidx.test.espresso:espresso-core:$versions.espresso",
]
}()
}
repositories {
google()
jcenter()
}
dependencies {
classpath depPaths.gradlePlugin
classpath depPaths.kotlinPlugin
classpath depPaths.androidJunit5
classpath depPaths.versionsPlugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply plugin: "com.github.ben-manes.versions"
allprojects {
repositories {
google()
jcenter()
}
if (!project.name.contains("sample")) {
// https://youtrack.jetbrains.com/issue/KT-37652
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
freeCompilerArgs += '-Xexplicit-api=strict'
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}