-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
125 lines (114 loc) · 3.44 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
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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.kotlinCompose) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.spotless)
`maven-publish`
}
allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
}
}
spotless {
kotlin {
target("**/*.kt")
targetExclude("!**/build/**/*.*")
ktlint(libs.versions.ktlint.get())
.editorConfigOverride(
mapOf(
"indent_size" to "2",
"max_line_length" to "120",
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
"ktlint_standard_trailing-comma-on-declaration-site" to "disabled",
),
)
trimTrailingWhitespace()
endWithNewline()
}
kotlinGradle {
target("**/*.gradle.kts")
ktlint(libs.versions.ktlint.get())
.editorConfigOverride(
mapOf(
"indent_size" to "2",
"max_line_length" to "120",
"ij_kotlin_allow_trailing_comma_on_declaration_site" to "true",
),
)
trimTrailingWhitespace()
endWithNewline()
}
}
subprojects {
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
plugins.withType<MavenPublishPlugin> {
apply(plugin = "org.gradle.signing")
configure<PublishingExtension> {
repositories {
maven {
name = "Central"
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
val versionName: String by project
url = if (versionName.endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = project.findProperty("NEXUS_USERTOKEN_NAME")?.toString()
password = project.findProperty("NEXUS_USERTOKEN_PASSWORD")?.toString()
}
}
}
publications.withType<MavenPublication> {
val versionName: String by project
val pomGroupId: String by project
groupId = pomGroupId
version = versionName
pom {
val pomDescription: String by project
val pomUrl: String by project
val pomName: String by project
description.set(pomDescription)
url.set(pomUrl)
name.set(pomName)
scm {
val pomScmUrl: String by project
val pomScmConnection: String by project
val pomScmDevConnection: String by project
url.set(pomScmUrl)
connection.set(pomScmConnection)
developerConnection.set(pomScmDevConnection)
}
licenses {
license {
val pomLicenseName: String by project
val pomLicenseUrl: String by project
val pomLicenseDist: String by project
name.set(pomLicenseName)
url.set(pomLicenseUrl)
distribution.set(pomLicenseDist)
}
}
developers {
developer {
val pomDeveloperId: String by project
val pomDeveloperName: String by project
id.set(pomDeveloperId)
name.set(pomDeveloperName)
}
}
}
}
configure<SigningExtension> {
sign(publications)
}
}
}
}