forked from google/ground-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
128 lines (108 loc) · 4.01 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
/*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Top-level build file. Configuration specified here is inherited by all sub-projects/modules.
buildscript {
ext {
hiltVersion = "2.44"
kotlinVersion = "1.8.10"
navigationVersion = "2.5.3"
}
repositories {
google()
jcenter()
mavenLocal()
maven { url "https://maven.google.com" }
maven { url "https://github.com/ben-manes/gradle-versions-plugin/raw/mvnrepo" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
classpath 'com.android.tools.build:gradle:7.4.0'
classpath 'com.google.gms:google-services:4.3.10'
classpath "com.pascalwelsch.gitversioner:gitversioner:0.5.0"
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.5'
// Performance Monitoring plugin: https://firebase.google.com/docs/perf-mon
classpath 'com.google.firebase:perf-plugin:1.4.1'
// Crashlytics plugin
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.0'
// Kotlin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "com.github.ben-manes.versions" version "0.36.0"
id "com.github.spotbugs" version "4.7.2" apply false
id "org.jetbrains.kotlin.android" version "$kotlinVersion" apply false
id "org.jetbrains.kotlin.plugin.serialization" version "$kotlinVersion"
id "com.ncorti.ktfmt.gradle" version "0.11.0"
id "com.google.dagger.hilt.android" version "$hiltVersion" apply false
}
allprojects {
repositories {
google() // For github repos.
mavenLocal()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://repo.osgeo.org/repository/release/" } // GeoTools
jcenter()
}
}
subprojects {
apply plugin: "com.ncorti.ktfmt.gradle" // Version should be inherited from parent
// https://github.com/cortinico/ktfmt-gradle
ktfmt {
googleStyle()
}
}
task checkCode(type: GradleBuild) {
tasks = ['checkstyle', 'lintDebug', 'pmd', 'spotbugsDebug', 'ktfmtCheck']
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// https://github.com/passsy/gradle-gitVersioner-plugin
apply plugin: "com.pascalwelsch.gitversioner"
gitVersioner {
baseBranch "master"
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
// https://github.com/ben-manes/gradle-versions-plugin
// To check which dependencies are out of date:
// ./gradlew dependencyUpdates
tasks.dependencyUpdates {
// Disallow release candidates as upgradable versions from stable versions
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
checkForGradleUpdate = true
checkConstraints = true
gradleReleaseChannel = "current"
outputFormatter = "json,plain"
outputDir = "ground/build/reports/dependencyUpdates"
}
ext {
androidCompileSdk = 33
androidMinSdk = 24
androidTargetSdk = 30
gmsMapsVersion = '17.0.1'
}