-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathbuild.gradle.kts
79 lines (69 loc) · 2.11 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
import java.io.ByteArrayOutputStream
import com.diffplug.gradle.spotless.SpotlessExtension
import com.diffplug.gradle.spotless.SpotlessPlugin
fun getGitCommit(): String {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = stdout
}
return stdout.toString().trim()
}
plugins {
id("noxesium.publishing") apply false
alias(libs.plugins.loom) apply false
alias(libs.plugins.moddev) apply false
alias(libs.plugins.spotless) apply false
}
val javaVersion: Int = 21
allprojects {
group = "com.noxcrew.noxesium"
version = "${property("mod_version")}+${getGitCommit()}"
repositories {
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://maven.enginehub.org/repo/")
maven("https://maven.fabricmc.net/")
maven("https://maven.neoforged.net/releases/")
maven("https://maven.terraformersmc.com/")
mavenCentral()
maven {
setUrl("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
}
}
}
subprojects {
apply<JavaLibraryPlugin>()
apply<Noxesium_publishingPlugin>()
apply<SpotlessPlugin>()
tasks.withType<JavaCompile> {
options.release.set(javaVersion)
sourceCompatibility = javaVersion.toString()
targetCompatibility = javaVersion.toString()
}
extensions.configure<SpotlessExtension> {
java {
palantirJavaFormat("2.50.0")
}
kotlin {
ktlint("1.5.0")
suppressLintsFor {
step = "ktlint"
shortCode = "standard:package-name"
}
suppressLintsFor {
step = "ktlint"
shortCode = "standard:annotation"
}
suppressLintsFor {
step = "ktlint"
shortCode = "standard:property-naming"
}
}
}
extensions.configure<JavaPluginExtension> {
toolchain.languageVersion.set(JavaLanguageVersion.of(javaVersion))
}
}