forked from terrarium-earth/Tempad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
195 lines (163 loc) · 6.32 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
import groovy.json.StringEscapeUtils
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
idea
kotlin("jvm") version "2.0.0"
id("maven-publish")
id("com.teamresourceful.resourcefulgradle") version "0.0.+"
id("net.neoforged.gradle.userdev") version "7.0.153"
}
val minecraftVersion: String by project
val modId: String by project
base {
archivesName.set("$modId-$minecraftVersion")
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
jarJar.enable()
repositories {
maven(url = "https://maven.architectury.dev/")
maven(url = "https://maven.neoforged.net/releases")
maven(url = "https://maven.teamresourceful.com/repository/maven-public/")
maven(url = "https://maven.twelveiterations.com/repository/maven-public/")
maven(url = "https://maven.octo-studios.com/releases")
maven(url = "https://modmaven.dev/" )
maven(url = "https://api.modrinth.com/maven")
mavenLocal()
}
dependencies {
val neoforgeVersion: String by project
val minecraft_version: String by project
val resourcefulConfigVersion: String by project
val resourcefulLibVersion: String by project
val resourcefulLibKtVersion: String by project
val kotlinForForgeVersion: String by project
val curiosVersion: String by project
val mekanismVersion: String by project
val patchouliVersion: String by project
val jadeVersion: String by project
val jeiVersion: String by project
implementation("net.neoforged:neoforge:${neoforgeVersion}")
compileOnly("mekanism:Mekanism:${mekanismVersion}:api")
runtimeOnly("mekanism:Mekanism:${mekanismVersion}")
runtimeOnly("mekanism:Mekanism:${mekanismVersion}:additions")
runtimeOnly("mekanism:Mekanism:${mekanismVersion}:generators")
runtimeOnly("mekanism:Mekanism:${mekanismVersion}:tools")
implementation("com.teamresourceful.resourcefulconfig:resourcefulconfig-neoforge-${minecraft_version}:${resourcefulConfigVersion}")
implementation("com.teamresourceful.resourcefullib:resourcefullib-neoforge-${minecraft_version}:${resourcefulLibVersion}")
compileOnly("com.teamresourceful:bytecodecs:1.1.0")
implementation("thedarkcolour:kotlinforforge-neoforge:${kotlinForForgeVersion}")
implementation("com.teamresourceful.resourcefullibkt:resourcefullibkt-neoforge-${minecraft_version}:${resourcefulLibKtVersion}") {
isTransitive = false
}
jarJar(group = "com.teamresourceful.resourcefullibkt", name = "resourcefullibkt-neoforge-${minecraft_version}", version = resourcefulLibKtVersion).also {
jarJar.pin(it, "[${resourcefulLibKtVersion})")
}
implementation(group = "earth.terrarium.olympus", name = "olympus-neoforge-$minecraftVersion", version = "1.0.1") {
isTransitive = false
}
jarJar(group = "earth.terrarium.olympus", name = "olympus-neoforge-$minecraftVersion", version = "1.0.1").also {
jarJar.pin(it, "[1.0.1)")
}
implementation("top.theillusivec4.curios:curios-neoforge:${curiosVersion}")
compileOnly("vazkii.patchouli:Patchouli:${patchouliVersion}:api")
runtimeOnly("vazkii.patchouli:Patchouli:${patchouliVersion}")
implementation("maven.modrinth:jade:$jadeVersion")
// compile against the JEI API but do not include it at runtime
compileOnly("mezz.jei:jei-${minecraft_version}-common-api:${jeiVersion}")
compileOnly("mezz.jei:jei-${minecraft_version}-neoforge-api:${jeiVersion}")
// at runtime, use the full JEI jar for NeoForge
runtimeOnly("mezz.jei:jei-${minecraft_version}-neoforge:${jeiVersion}")
}
java {
withSourcesJar()
}
tasks.jar {
archiveClassifier.set("dev")
}
tasks.processResources {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
filesMatching(listOf("META-INF/neoforge.mods.toml")) {
expand("version" to project.version)
}
}
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
freeCompilerArgs.add("-Xjvm-default=all")
freeCompilerArgs.add("-Xcontext-receivers")
}
sourceSets.all {
languageSettings.enableLanguageFeature("ExplicitBackingFields")
}
}
publishing {
publications {
create<MavenPublication>("maven") {
artifactId = "$modId-$minecraftVersion"
from(components["java"])
pom {
name.set("Tempad")
url.set("https://github.com/terrarium-earth/$modId")
scm {
connection.set("git:https://github.com/terrarium-earth/$modId.git")
developerConnection.set("git:https://github.com/terrarium-earth/$modId.git")
url.set("https://github.com/terrarium-earth/$modId")
}
licenses {
license {
name.set("ARR")
}
}
}
}
}
repositories {
maven {
setUrl("https://maven.resourcefulbees.com/repository/terrarium/")
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}
}
resourcefulGradle {
templates {
register("embed") {
val minecraftVersion: String by project
val version: String by project
val changelog: String = file("changelog.md").readText(Charsets.UTF_8)
val fabricLink: String? = System.getenv("FABRIC_RELEASE_URL")
val forgeLink: String? = System.getenv("FORGE_RELEASE_URL")
source.set(file("templates/embed.json.template"))
injectedValues.set(mapOf(
"minecraft" to minecraftVersion,
"version" to version,
"changelog" to StringEscapeUtils.escapeJava(changelog),
"fabric_link" to fabricLink,
"forge_link" to forgeLink
))
}
}
}
runs {
// other run configurations here
maybeCreate("data").apply {
programArguments.addAll(
"--mod", modId,
"--all",
"--output", file("src/generated/resources").absolutePath,
"--existing", file("src/main/resources/").absolutePath,
"--client",
"--server"
)
}
}
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}