Improve buildscript

This commit is contained in:
Marcel Konrad
2022-07-28 18:05:45 +02:00
parent f2f8300cf0
commit 3d72a40522
2 changed files with 20 additions and 34 deletions

View File

@@ -10,22 +10,7 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(17)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' (' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' (' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft { minecraft {
// The mappings can be changed at any time and must be in the following format.
// Channel: Version:
// official MCVersion Official field/method names from Mojang mapping files
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
//
// You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
// Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'official', version: minecraft_version mappings channel: 'official', version: minecraft_version
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs { runs {
@@ -49,7 +34,7 @@ minecraft {
// property 'forge.enabledGameTestNamespaces', "${mod_id}" // property 'forge.enabledGameTestNamespaces', "${mod_id}"
mods { mods {
worldhandler { modSource {
source sourceSets.main source sourceSets.main
} }
} }
@@ -64,7 +49,7 @@ minecraft {
// property 'forge.enabledGameTestNamespaces', 'examplemod' // property 'forge.enabledGameTestNamespaces', 'examplemod'
mods { mods {
worldhandler { modSource {
source sourceSets.main source sourceSets.main
} }
} }
@@ -82,7 +67,7 @@ minecraft {
// property 'forge.enabledGameTestNamespaces', 'examplemod' // property 'forge.enabledGameTestNamespaces', 'examplemod'
mods { mods {
worldhandler { modSource {
source sourceSets.main source sourceSets.main
} }
} }
@@ -98,7 +83,7 @@ minecraft {
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods { mods {
worldhandler { modSource {
source sourceSets.main source sourceSets.main
} }
} }
@@ -140,14 +125,14 @@ dependencies {
jar { jar {
manifest { manifest {
attributes([ attributes([
"Specification-Title": "worldhandler", "Specification-Title": "${mod_id}",
"Specification-Vendor": "Exopandora", "Specification-Vendor": "${author}",
"Specification-Version": "1", "Specification-Version": "1",
"Implementation-Title": project.name, "Implementation-Title": "${mod_name}",
"Implementation-Version": project.jar.archiveVersion, "Implementation-Version": "${minecraft_version}-${version}",
"Implementation-Vendor": "Exopandora", "Implementation-Vendor": "${author}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Main-Class": "exopandora.worldhandler.Main" "Main-Class": "${main_class}"
]) ])
} }
} }

View File

@@ -1,12 +1,13 @@
# WorldHandler # WorldHandler
mod_id=worldhandler mod_id = worldhandler
mod_name=WorldHandler mod_name = WorldHandler
version=3.3.1 version = 3.3.1
minecraft_version=1.19.1 minecraft_version = 1.19.1
forge_version=42.0.0 forge_version = 42.0.0
group=exopandora.worldhandler group = exopandora.worldhandler
main_class=exopandora.worldhandler.Main main_class = exopandora.worldhandler.Main
author = Exopandora
# Gradle # Gradle
org.gradle.jvmargs=-Xmx3G org.gradle.jvmargs = -Xmx3G
org.gradle.daemon=false org.gradle.daemon = false