-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
116 lines (106 loc) · 3.49 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
/*
* MIT License
*
* Copyright (c) 2018 Andrii Chubko
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import buildsrc.Libraries
import buildsrc.Versions
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath Libraries.Gradle.android
classpath Libraries.Gradle.dexcount
classpath Libraries.Gradle.fabric
classpath Libraries.Gradle.firebase_plugins
classpath Libraries.Gradle.google_services
classpath Libraries.Gradle.kotlin
/*
* Temporary workaround for using latest Dagger versions with Jetifier.
* See https://issuetracker.google.com/115738511
*/
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04'
}
}
plugins {
id 'com.diffplug.gradle.spotless' version '3.21.1'
id 'com.github.ben-manes.versions' version '0.21.0'
id 'com.github.triplet.play' version '2.2.0'
}
ext {
ci = System.getenv('CI') == 'true'
}
allprojects {
repositories {
google()
jcenter()
}
afterEvaluate {
if (project.plugins.hasPlugin('kotlin-kapt')) {
kapt {
useBuildCache = true
correctErrorTypes = true
mapDiagnosticLocations = true
// Increase maximum number of printed errors
javacOptions {
option('-Xmaxerrs', 500)
}
// Disable generated code formatting and enable incremental builds for Dagger.
// kapt should start supporting incremental annotation processors in upcoming 1.3.30 release.
// See https://youtrack.jetbrains.com/issue/KT-23880
arguments {
if (!ci) {
arg('dagger.formatGeneratedSource', 'disabled')
arg('dagger.gradle.incremental', 'enabled')
}
}
}
}
}
}
subprojects {
apply plugin: 'com.diffplug.gradle.spotless'
spotless {
kotlin {
target '**/*.kt'
ktlint(Versions.ktlint).userData(['indent_size': '2'])
licenseHeaderFile file('../spotless/copyright.kt')
}
java {
target '**/*.java'
googleJavaFormat()
licenseHeaderFile file('../spotless/copyright.kt')
}
format 'misc', {
target '**/*.gradle', '**/*.gitignore', '**/*.properties', '**/*.kt', '**/*.pro'
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
}
}
Object propOrDef(String propertyName, Object defaultValue) {
def propertyValue = project.properties[propertyName]
return propertyValue != null ? propertyValue : defaultValue
}