-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathbuild.gradle
157 lines (129 loc) · 3.74 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
* Copyright 2024 pyamsoft
*
* 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
*
* http://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 where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
// SDK
minSdk = 24
targetSdk = 35
compileSdk = 35
// Kotlin
kotlin = "2.1.0"
coroutines = "1.10.1"
// Us
pydroid = "27.2.0"
// Leak Canary
leakCanary = "2.14"
// Dagger
dagger = "2.55"
// Compose
compose = "1.7.6"
composeMaterial3 = "1.3.1"
composeActivity = "1.10.0"
desugar = "2.1.4"
ktor = "3.0.3-PYAMSOFT"
// Testing
testRunner = "1.6.2"
}
}
plugins {
// Android AGP
// https://developer.android.com/studio/build#top-level
id("com.android.library") version '8.8.0' apply false
// Fix Android build cache
// https://github.com/gradle/android-cache-fix-gradle-plugin
id("org.gradle.android.cache-fix") version "3.0.1" apply false
// Kotlin
// https://developer.android.com/studio/build#top-level
id("org.jetbrains.kotlin.android") version "${kotlin}" apply false
// Jetpack Compose Compiler
// https://android-developers.googleblog.com/2024/04/jetpack-compose-compiler-moving-to-kotlin-repository.html
id("org.jetbrains.kotlin.plugin.compose") version "${kotlin}" apply false
// Gradle version checker
// https://github.com/ben-manes/gradle-versions-plugin
id("com.github.ben-manes.versions") version "0.51.0" apply false
// Version Filter Plugin
// https://github.com/janderssonse/gradle-versions-filter-plugin
id("se.ascp.gradle.gradle-versions-filter") version "0.1.16" apply false
// Spotless
// https://github.com/diffplug/spotless
id("com.diffplug.spotless") version "7.0.2" apply false
// KSP
// https://github.com/google/ksp
id("com.google.devtools.ksp") version "${kotlin}-1.0.29" apply false
// Gradle Doctor
// https://runningcode.github.io/gradle-doctor/
id("com.osacky.doctor") version "0.10.0" apply true
}
allprojects {
apply plugin: "com.diffplug.spotless"
apply plugin: "com.github.ben-manes.versions"
apply plugin: "se.ascp.gradle.gradle-versions-filter"
// We don't care about enforcing JAVA_HOME checks
doctor {
javaHome {
ensureJavaHomeMatches = false
ensureJavaHomeIsSet = false
failOnError = false
}
}
repositories {
mavenLocal()
gradlePluginPortal()
google()
mavenCentral()
// Jitpack
maven {
setUrl("https://jitpack.io")
content {
includeGroup("com.github.pyamsoft.pydroid")
includeGroup("com.github.pyamsoft")
}
}
}
// Java compile show
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += [
"-Xlint:unchecked",
"-Xlint:deprecation"
]
options.deprecation = true
}
// Spotless plugin
spotless {
java {
target("src/**/*.java")
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
leadingTabsToSpaces(2)
}
kotlin {
target("src/**/*.kt", "*.kts")
ktfmt()
trimTrailingWhitespace()
endWithNewline()
leadingTabsToSpaces(2)
}
groovyGradle {
target("*.gradle")
greclipse()
trimTrailingWhitespace()
endWithNewline()
leadingTabsToSpaces(2)
}
}
}