-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
142 lines (126 loc) · 3.96 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import com.diffplug.gradle.spotless.SpotlessExtension
import com.diffplug.gradle.spotless.SpotlessPlugin
import dev.teogor.winds.api.ArtifactIdFormat
import dev.teogor.winds.api.License
import dev.teogor.winds.api.NameFormat
import dev.teogor.winds.api.Person
import dev.teogor.winds.api.Scm.GitHub
import dev.teogor.winds.api.SonatypeHost
import dev.teogor.winds.api.TicketSystem
import dev.teogor.winds.ktx.createVersion
import dev.teogor.winds.ktx.person
import dev.teogor.winds.ktx.scm
import dev.teogor.winds.ktx.ticketSystem
import org.gradle.api.internal.catalog.DelegatingProjectDependency
import org.jetbrains.dokka.gradle.DokkaPlugin
plugins {
alias(libs.plugins.jetbrains.compose) apply false
alias(libs.plugins.jetbrains.compose.compiler) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.jetbrains.kotlin.multiplatform) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.teogor.winds)
alias(libs.plugins.vanniktech.maven)
alias(libs.plugins.jetbrains.dokka)
alias(libs.plugins.diffplug.spotless)
alias(libs.plugins.jetbrains.kotlinx.binary.compatibility)
}
winds {
features {
mavenPublishing = true
docsGenerator = true
workflowSynthesizer = true
}
moduleMetadata {
name = "Nudge"
description = """
|🛎️ Nudge simplifies snackbars, bringing quick, customizable notifications to your Compose apps!
|""".trimMargin()
yearCreated = 2024
websiteUrl = "https://source.teogor.dev/nudge/"
apiDocsUrl = "https://source.teogor.dev/nudge/html/"
artifactDescriptor {
group = "dev.teogor.nudge"
name = "nudge"
version = createVersion(1, 0, 0) {
alphaRelease(1)
}
nameFormat = NameFormat.FULL
artifactIdFormat = ArtifactIdFormat.MODULE_NAME_ONLY
}
// Providing SCM (Source Control Management)
scm<GitHub> {
owner = "teogor"
repository = "nudge"
}
// Providing Ticket System
ticketSystem<TicketSystem.GitHub> {
owner = "teogor"
repository = "nudge"
}
// Providing Licenses
licensedUnder(License.Apache2())
// Providing Persons
person<Person.DeveloperContributor> {
id = "teogor"
name = "Teodor Grigor"
email = "open-source@teogor.dev"
url = "https://teogor.dev"
roles = listOf("Code Owner", "Developer", "Designer", "Maintainer")
timezone = "UTC+2"
organization = "Teogor"
organizationUrl = "https://github.com/teogor"
}
}
publishing {
enabled = false
enablePublicationSigning = true
optInForVanniktechPlugin = true
cascade = true
sonatypeHost = SonatypeHost.S01
}
documentationBuilder {
htmlPath = "html/"
}
}
subprojects {
apply<SpotlessPlugin>()
configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude(
"**/build/**/*.kt",
)
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
trimTrailingWhitespace()
endWithNewline()
}
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"), "(<[^!?])")
}
}
}
val excludedProjects = listOf<DelegatingProjectDependency>(
projects.demo,
)
subprojects {
val paths = excludedProjects.map { it.identityPath.path }
if (!paths.contains(this.path)) {
apply<DokkaPlugin>()
}
}
apiValidation {
val ignoredProjectNames = excludedProjects
.map { project -> project.identityPath.path.removePrefix(":") }
ignoredProjects.addAll(ignoredProjectNames)
}