-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
55 lines (52 loc) · 2.11 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
android_build_tools_version = '8.1.1'
compose_version = '1.4.2'
compose_compiler_version = '1.4.6'
kotlin_version = '1.8.20'
java_version = JavaVersion.VERSION_17
}
}
plugins {
id 'com.android.application' version "$android_build_tools_version" apply false
id 'com.android.library' version "$android_build_tools_version" apply false
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
id 'com.google.devtools.ksp' version '1.8.20-1.0.10' apply false
id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlin_version" apply false
id 'com.diffplug.gradle.spotless' version "6.23.3" apply false
}
subprojects {
apply plugin: "com.diffplug.spotless"
spotless {
// optional: limit format enforcement to just the files changed by this feature branch
ratchetFrom 'origin/main'
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
java {
// apply a specific flavor of google-java-format
googleJavaFormat('1.17.0').aosp().reflowLongStrings()
// fix formatting of type annotations
formatAnnotations()
// make sure every file has the following copyright header.
// optionally, Spotless can set copyright years by digging
// through git history (see "license" section below)
licenseHeaderFile rootProject.file("LicenseHeaderFile.txt")
removeUnusedImports()
}
kotlin {
target("src/*/java/**/*.kt")
ktlint("0.50.0")
.setEditorConfigPath("$rootDir/.editorconfig")
licenseHeaderFile(rootProject.file("LicenseHeaderFile.txt"))
.named('license')
endWithNewline()
}
}
}