-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
118 lines (99 loc) · 3.19 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
import com.adarshr.gradle.testlogger.theme.ThemeType
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`java-gradle-plugin`
`kotlin-dsl`
alias(libs.plugins.kotlin)
alias(libs.plugins.plugin.publish)
alias(libs.plugins.test.logger)
alias(libs.plugins.spotless)
}
group = "gg.meza"
description =
"Stonecraft is a configuration Gradle plugin that removes the boilerplate of setting up a multi-loader, multi-version Minecraft modding workspace."
repositories {
mavenCentral()
mavenLocal()
gradlePluginPortal()
maven("https://maven.kikugie.dev/releases")
maven("https://maven.fabricmc.net/")
maven("https://maven.architectury.dev")
maven("https://maven.minecraftforge.net")
maven("https://maven.neoforged.net/releases/")
}
dependencies {
compileOnly(gradleApi())
implementation(libs.stonecutter)
implementation(libs.gson)
implementation(libs.architectury.loom)
implementation(libs.mod.publish)
testImplementation(gradleTestKit())
testImplementation(libs.mockito.core)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.junit)
testImplementation(libs.junit.pioneer)
testImplementation(kotlin("test"))
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
tasks.withType<Test> {
useJUnitPlatform()
jvmArgs("-XX:+EnableDynamicAgentLoading")
jvmArgs("--add-opens", "java.base/java.util=ALL-UNNAMED")
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
}
testlogger {
theme = ThemeType.PLAIN
}
java {
withSourcesJar()
}
gradlePlugin {
website = "https://stonecraft.meza.gg"
vcsUrl = "https://github.com/meza/Stonecraft.git"
testSourceSet(sourceSets["test"])
plugins {
create("gg.meza.stonecraft") {
id = "gg.meza.stonecraft"
displayName = "Stonecraft"
implementationClass = "gg.meza.stonecraft.ModPlugin"
tags = listOf(
"minecraft",
"multi-loader",
"configuration",
"modding",
"minecraft modding",
"development environment configuration"
)
description = project.description
}
}
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.compilerOptions {
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0) // Changed from KOTLIN_2_1
jvmTarget.set(JvmTarget.JVM_21)
freeCompilerArgs.addAll(listOf("-opt-in=kotlin.ExperimentalStdlibApi", "-opt-in=kotlin.RequiresOptIn"))
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
spotless {
kotlin {
ktlint()
.editorConfigOverride(
mapOf(
"ktlint_code_style" to "intellij_idea",
"ktlint_standard_no-line-break-before-assignment" to "disabled",
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
"ktlint_standard_trailing-comma-on-declaration-site" to "disabled"
)
)
}
}
publishing {
repositories {
mavenLocal()
}
}