-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
207 lines (185 loc) · 5.9 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
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
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.jetbrains.dokka.gradle.DokkaPlugin
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm) apply true
alias(libs.plugins.jetbrains.compose.compiler) apply false
alias(libs.plugins.ceres.android.application) apply false
alias(libs.plugins.ceres.android.application.compose) apply false
alias(libs.plugins.ceres.android.library) apply false
alias(libs.plugins.ceres.android.library.compose) apply false
alias(libs.plugins.teogor.winds) apply true
alias(libs.plugins.teogor.drifter) apply false
alias(libs.plugins.vanniktech.maven) apply true
alias(libs.plugins.dokka) apply true
alias(libs.plugins.spotless) apply true
alias(libs.plugins.api.validator) apply true
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
}
winds {
features {
mavenPublishing = true
docsGenerator = true
}
moduleMetadata {
name = "Drifter"
description =
"\uD83C\uDFAE Drifter simplifies the integration between Unity and Android, enhancing performance seamlessly and effortlessly."
yearCreated = 2023
websiteUrl = "https://source.teogor.dev/drifter/"
apiDocsUrl = "https://source.teogor.dev/drifter/html/"
artifactDescriptor {
group = "dev.teogor.drifter"
name = "Drifter"
version = createVersion(1, 0, 0) {
alphaRelease(2)
}
nameFormat = NameFormat.FULL
artifactIdFormat = ArtifactIdFormat.MODULE_NAME_ONLY
}
// Providing SCM (Source Control Management)
scm<Scm.GitHub> {
owner = "teogor"
repository = "drifter"
}
// Providing Ticket System
ticketSystem<TicketSystem.GitHub> {
owner = "teogor"
repository = "drifter"
}
// Providing Licenses
licensedUnder(License.Apache2())
// Providing Persons
person<Person.DeveloperContributor> {
id = "teogor"
name = "Teodor Grigor"
email = "[email protected]"
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/"
}
}
val modulesByPath = listOf(
":drifter-plugin",
":demo",
":demo:app",
":demo:module-unity",
)
val ktlintVersion = "0.50.0"
val isCI = System.getenv("CI") != null
val excludeModules = if (!isCI) {
listOf(
project.name,
"app",
"module-unity",
)
} else {
listOf(
project.name,
)
}
subprojects {
if (!excludeModules.contains(this.name)) {
apply<com.diffplug.gradle.spotless.SpotlessPlugin>()
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("**/build/**/*.kt")
ktlint(ktlintVersion)
.editorConfigOverride(
mapOf(
"android" to "true",
"ktlint_code_style" to "intellij_idea",
"ij_kotlin_allow_trailing_comma" to "true",
// These rules were introduced in ktlint 0.46.0 and should not be
// enabled without further discussion. They are disabled for now.
// See: https://github.com/pinterest/ktlint/releases/tag/0.46.0
"disabled_rules" to
"filename," +
"annotation,annotation-spacing," +
"argument-list-wrapping," +
"double-colon-spacing," +
"enum-entry-name-case," +
"multiline-if-else," +
"no-empty-first-line-in-method-block," +
"package-name," +
"trailing-comma," +
"spacing-around-angle-brackets," +
"spacing-between-declarations-with-annotations," +
"spacing-between-declarations-with-comments," +
"unary-op-spacing," +
"no-trailing-spaces," +
"no-wildcard-imports," +
"max-line-length",
),
)
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"), "(<[^!?])")
}
}
}
}
apiValidation {
/**
* Sub-projects that are excluded from API validation
*/
ignoredProjects.addAll(excludeModules)
/**
* Flag to programmatically disable compatibility validator
*/
validationDisabled = false
}
subprojects {
if (!modulesByPath.contains([email protected])) {
apply<DokkaPlugin>()
}
}
tasks.dokkaHtmlMultiModule {
dependsOn(":unity:dokkaHtmlMultiModule")
}