diff --git a/build.gradle b/build.gradle index 9ba452e8f..20b7af936 100644 --- a/build.gradle +++ b/build.gradle @@ -150,26 +150,56 @@ compileJava { options.compilerArgs = ['-Xdiags:verbose'] } +tasks.named('processResources', ProcessResources).configure { + var replaceProperties = [ + minecraft_version : minecraft_version, + minecraft_version_range: minecraft_version_range, + forge_version : forge_version, + forge_version_range : forge_version_range, + loader_version_range : loader_version_range, + mod_version : mod_version, + embeddium_version_range: embeddium_version_range + ] + inputs.properties replaceProperties + + filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) { + expand replaceProperties + [project: project] + } +} + void addLicense(jarTask) { jarTask.from('LICENSE.md') { rename '(.*)\\.(.*)', '$1_' + archivesBaseName + '.$2' } } -tasks.named('jar', Jar).configure { - manifest { +void addManifest(jarTask) { + jarTask.manifest { attributes([ - 'Specification-Title': 'flywheel', + 'Specification-Title' : 'flywheel', // 'Specification-Vendor': 'flywheel authors', - 'Specification-Version': '1', // We are version 1 of ourselves - 'Implementation-Title': project.jar.archiveBaseName, - 'Implementation-Version': project.jar.archiveVersion, + 'Specification-Version' : '1', // We are version 1 of ourselves + 'Implementation-Title' : project.jar.archiveBaseName, + 'Implementation-Version' : project.jar.archiveVersion, // 'Implementation-Vendor': 'flywheel authors', 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), ]) } +} + +tasks.named('jar', Jar).configure { + archiveClassifier = 'slim' finalizedBy 'reobfJar' + addManifest(it) + addLicense(it) +} + +tasks.named('jarJar', Jar).configure { + archiveClassifier = '' + + finalizedBy 'reobfJarJar' + addManifest(it) addLicense(it) } diff --git a/gradle.properties b/gradle.properties index b21149c0e..89e8f5c5c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,12 @@ org.gradle.daemon = false mod_version = 1.0.0-alpha artifact_minecraft_version = 1.20.1 minecraft_version = 1.20.1 -forge_version = 47.2.6 +forge_version=47.2.19 +# Version ranges for the mods.toml +minecraft_version_range=[1.20.1,1.20.3) +forge_version_range=[47,) +loader_version_range=[47,) +embeddium_version_range=[0.2.10,0.3) # build dependency versions forgegradle_version = [6.0.16,6.2) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index b74467b39..88c8b8d20 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,15 +1,15 @@ modLoader = "javafml" -loaderVersion = "[47,)" +loaderVersion = "${loader_version_range}" issueTrackerURL = "https://github.com/Jozufozu/Flywheel/issues" license = "MIT" [[mods]] modId = "flywheel" # The Implementation-Version property in the jar's MANIFEST.MF file will be used as the mod version at runtime -version = "${file.jarVersion}" +version = "${mod_version}" displayName = "Flywheel" logoFile = "logo.png" -displayURL = "https://www.curseforge.com/minecraft/mc-mods/flywheel" +displayURL = "https://modrinth.com/mod/flywheel" updateJSONURL = "https://api.modrinth.com/updates/flywheel/forge_updates.json" authors = "Jozufozu, PepperCode1" description = ''' @@ -18,20 +18,20 @@ A modern engine for modded minecraft.''' [[dependencies.flywheel]] modId = "forge" mandatory = true -versionRange = "[47.0.0,)" +versionRange = "${forge_version_range}" ordering = "NONE" side = "CLIENT" [[dependencies.flywheel]] modId = "minecraft" mandatory = true -versionRange = "[1.20.1,)" +versionRange = "${minecraft_version_range}" ordering = "NONE" side = "CLIENT" [[dependencies.flywheel]] -modId = "rubidium" +modId = "embeddium" mandatory = false -versionRange = "[0.7.0,)" +versionRange = "${embeddium_version_range}" ordering = "NONE" side = "CLIENT"