This repository has been archived by the owner on Feb 11, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.gradle
122 lines (107 loc) · 3.08 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
/*
* Copyright © 2017-2020 WireGuard LLC.
* Copyright © 2018-2020 Harsh Shandilya <[email protected]>. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
buildscript {
apply from: rootProject.file('dependencies.gradle')
repositories {
google()
jcenter()
}
dependencies {
classpath deps.gradle_plugin.android
classpath deps.gradle_plugin.detekt
classpath deps.gradle_plugin.kotlin
classpath deps.gradle_plugin.spotless
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.27.0'
id 'com.savvasdalkitsis.module-dependency-graph' version '0.3'
}
subprojects {
apply from: rootProject.file('dependencies.gradle')
apply from: rootProject.file('spotless.gradle')
apply plugin: 'io.gitlab.arturbosch.detekt'
repositories {
google()
jcenter()
}
pluginManager.withPlugin('kotlin-android') {
dependencies {
implementation deps.kotlin.stdlib8
}
}
pluginManager.withPlugin('kotlin-kapt') {
kapt {
useBuildCache = true
// https://github.com/google/dagger/issues/1449#issuecomment-495404186
javacOptions {
option '-source', '8'
option '-target', '8'
}
}
}
if (name == 'app') {
apply plugin: 'com.android.application'
} else {
apply plugin: 'com.android.library'
android.libraryVariants.all { variant ->
variant.generateBuildConfigProvider.configure { enabled = false }
}
}
android {
compileSdkVersion versions.compileSdk
buildToolsVersion = versions.buildTools
defaultConfig {
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode versions.versionCode
versionName versions.versionName
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
testOptions.unitTests.all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
}
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = '1.8'
}
}
detekt {
config = rootProject.files('detekt-config.yml')
baseline = project.file('detekt-baseline.xml')
parallel = true
}
afterEvaluate {
project.tasks.getByName('check').dependsOn 'detekt'
}
}
project(':app') {
repositories {
maven { url 'https://jitpack.io' }
}
}
apply from: rootProject.file('spotless.root.gradle')
tasks {
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
}
task installHook(type: Copy) {
from 'ci'
into rootProject.file('.git/hooks/')
rename('pre-push-recommended.sh', 'pre-push')
fileMode 0755
}