-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathbuild.gradle
142 lines (119 loc) · 4.33 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
* 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.45"
kotlinVersion = "1.8.10"
navigationVersion = "2.5.3"
}
repositories {
google()
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/" }
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
classpath 'com.android.tools.build:gradle:8.1.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath "com.pascalwelsch.gitversioner:gitversioner:0.5.0"
// Performance Monitoring plugin: https://firebase.google.com/docs/perf-mon
classpath 'com.google.firebase:perf-plugin:1.4.2'
// Crashlytics plugin
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
// 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 "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
id "io.gitlab.arturbosch.detekt" version "1.23.0"
}
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
mavenCentral()
}
}
subprojects {
apply plugin: "com.ncorti.ktfmt.gradle" // Version should be inherited from parent
// https://github.com/cortinico/ktfmt-gradle
ktfmt {
googleStyle()
}
}
detekt {
toolVersion = "1.23.0"
source = files("ground/src", "sharedTest/src")
allRules = true
config = files("${project.rootDir}/config/detekt/detekt.yml")
baseline = file("${project.rootDir}/config/detekt/baseline.xml")
buildUponDefaultConfig = true
ignoreFailures = false
basePath = projectDir
}
task checkCode(type: GradleBuild) {
tasks = ['checkstyle', 'lintDebug', 'ktfmtCheck', 'detekt']
}
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 = '18.1.0'
jvmToolchainVersion = 17
}