2022-05-31 10:50:46 -04:00
|
|
|
import java.text.SimpleDateFormat
|
|
|
|
import java.util.*
|
|
|
|
|
|
|
|
val modId: String by project
|
|
|
|
val modName: String by project
|
2022-10-17 14:57:09 -04:00
|
|
|
val modVersion: String by project
|
2022-05-31 10:50:46 -04:00
|
|
|
val modAuthor: String by project
|
|
|
|
val modDescription: String by project
|
2022-10-17 14:57:09 -04:00
|
|
|
val license: String by project
|
|
|
|
val extraModsDirectory: String by project
|
|
|
|
val minecraftVersion: String by project
|
|
|
|
val forgeMinVersion: String by project
|
2022-10-28 12:17:53 -04:00
|
|
|
val reiMinVersion: String by project
|
2022-05-31 10:50:46 -04:00
|
|
|
val githubUser: String by project
|
|
|
|
val githubRepo: String by project
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
java
|
|
|
|
}
|
|
|
|
|
2022-09-24 14:05:47 -04:00
|
|
|
subprojects {
|
|
|
|
apply(plugin = "maven-publish")
|
|
|
|
apply(plugin = "java")
|
|
|
|
apply(plugin = "eclipse")
|
|
|
|
apply(plugin = "idea")
|
|
|
|
|
2022-10-17 14:57:09 -04:00
|
|
|
version = "$minecraftVersion-$modVersion"
|
|
|
|
|
2022-05-31 10:50:46 -04:00
|
|
|
repositories {
|
2022-09-24 14:05:47 -04:00
|
|
|
maven("https://maven.parchmentmc.org/")
|
|
|
|
maven("https://maven.shedaniel.me")
|
|
|
|
maven("https://dvs1.progwml6.com/files/maven/")
|
|
|
|
maven("https://maven.saps.dev/minecraft")
|
2022-10-17 14:57:09 -04:00
|
|
|
maven("https://maven.blamejared.com/")
|
2022-07-29 16:45:44 -04:00
|
|
|
flatDir {
|
2022-08-21 13:47:06 -04:00
|
|
|
name = extraModsDirectory
|
|
|
|
dir(file("$extraModsDirectory-$minecraftVersion"))
|
2022-07-29 16:45:44 -04:00
|
|
|
}
|
2022-05-31 10:50:46 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
extensions.configure<JavaPluginExtension> {
|
|
|
|
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
"Specification-Title" to modName,
|
|
|
|
"Specification-Vendor" to modAuthor,
|
|
|
|
"Specification-Version" to archiveVersion,
|
|
|
|
"Implementation-Title" to project.name,
|
|
|
|
"Implementation-Version" to archiveVersion,
|
|
|
|
"Implementation-Vendor" to modAuthor,
|
|
|
|
"Implementation-Timestamp" to SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(Date()),
|
|
|
|
"Timestamp" to System.currentTimeMillis(),
|
|
|
|
"Built-On-Java" to "${System.getProperty("java.vm.version")} (${System.getProperty("java.vm.vendor")})",
|
|
|
|
"Build-On-Minecraft" to minecraftVersion
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2022-09-06 12:00:29 -04:00
|
|
|
processResources {
|
|
|
|
val resourceTargets = listOf("META-INF/mods.toml", "pack.mcmeta", "fabric.mod.json")
|
2022-05-31 10:50:46 -04:00
|
|
|
|
2022-09-06 12:00:29 -04:00
|
|
|
val replaceProperties = mapOf(
|
|
|
|
"version" to project.version as String,
|
|
|
|
"modId" to modId,
|
|
|
|
"modName" to modName,
|
|
|
|
"modAuthor" to modAuthor,
|
|
|
|
"modDescription" to modDescription,
|
2022-10-17 14:57:09 -04:00
|
|
|
"license" to license,
|
|
|
|
"minecraftVersion" to minecraftVersion,
|
|
|
|
"forgeMinVersion" to forgeMinVersion,
|
2022-10-28 12:17:53 -04:00
|
|
|
"reiMinVersion" to reiMinVersion,
|
2022-09-06 12:00:29 -04:00
|
|
|
"githubUser" to githubUser,
|
|
|
|
"githubRepo" to githubRepo
|
|
|
|
)
|
2022-05-31 10:50:46 -04:00
|
|
|
|
2022-09-06 12:00:29 -04:00
|
|
|
inputs.properties(replaceProperties)
|
|
|
|
filesMatching(resourceTargets) {
|
|
|
|
expand(replaceProperties)
|
|
|
|
}
|
2022-05-31 10:50:46 -04:00
|
|
|
}
|
2022-09-24 14:05:47 -04:00
|
|
|
withType<JavaCompile> {
|
|
|
|
options.encoding = "UTF-8"
|
|
|
|
options.release.set(17)
|
|
|
|
}
|
|
|
|
withType<GenerateModuleMetadata> {
|
|
|
|
enabled = false
|
|
|
|
}
|
2022-05-31 10:50:46 -04:00
|
|
|
}
|
|
|
|
}
|