-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
build.gradle.kts
99 lines (88 loc) · 3.48 KB
/
build.gradle.kts
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
/*
* Copyright 2023 Md. Mahmudul Hasan Shohag
*
* 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.
*
* ------------------------------------------------------------------------
*
* Project: Why Not Compose!
* Developed by: @ImaginativeShohag
*
* Md. Mahmudul Hasan Shohag
* imaginativeshohag@gmail.com
*
* Source: https://github.com/ImaginativeShohag/Why-Not-Compose
*/
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven(url = "https://jitpack.io")
}
}
plugins {
id(Libs.Android.application) version Libs.Gradle.version apply false
id(Libs.Android.library) version Libs.Gradle.version apply false
kotlin("android") version Libs.Kotlin.version apply false
kotlin("plugin.serialization") version Libs.Kotlin.version apply false
id(Libs.Kotlin.composeCompilerGradlePlugin) version Libs.Kotlin.version apply false
id(Libs.Google.DevTools.ksp) version Libs.Google.DevTools.kspVersion apply false
id(Libs.Google.Firebase.crashlyticsGradlePlugin) version Libs.Google.Firebase.crashlyticsGradlePluginVersion apply false
id(Libs.Google.Services.gradlePlugin) version Libs.Google.Services.version apply false
id(Libs.Google.Maps.secretsGradlePlugin) version Libs.Google.Maps.secretsGradlePluginVersion apply false
id(Libs.Google.Hilt.gradlePlugin) version Libs.Google.Hilt.version apply false
id(Libs.DiffPlug.spotless) version Libs.DiffPlug.version
}
subprojects {
apply(plugin = Libs.DiffPlug.spotless)
spotless {
kotlin {
target("**/*.kt")
targetExclude("${layout.buildDirectory}/**/*.kt")
targetExclude("bin/**/*.kt")
ktlint("1.3.1")
.customRuleSets(
listOf(
"io.nlopez.compose.rules:ktlint:0.4.5"
)
)
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
}
format("kts") {
target("**/*.kts")
targetExclude("**/build/**/*.kts")
// Look for the first line that doesn't have a block comment (assumed to be the license)
licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
}
format("xml") {
target("**/*.xml")
targetExclude("**/build/**/*.xml")
// Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml)
licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])")
}
}
}
allprojects {
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}
}
task("testClasses").doLast {
println("This is a dummy testClasses task to fix GitHub CodeQL action issue.")
}