diff options
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 113 |
1 files changed, 66 insertions, 47 deletions
diff --git a/build.gradle b/build.gradle index e320d14..7efe09c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,79 +1,98 @@ +//file:noinspection UnnecessaryQualifiedReference +//file:noinspection GroovyAssignabilityCheck + plugins { + id "dev.architectury.architectury-pack200" version "0.1.3" + id "com.github.johnrengelman.shadow" version "7.1.0" + id "cc.woverflow.loom" version "0.10.6" + id "net.kyori.blossom" version "1.3.0" id "java" - id "com.github.johnrengelman.shadow" version "6.1.0" - id "net.minecraftforge.gradle.forge" version "6f53277" } -group "io.polyfrost" -version "1.0-SNAPSHOT" -archivesBaseName = "OneConfig" +version = mod_version +group = "io.polyfrost" +archivesBaseName = mod_name + +blossom { + String className = "src/main/java/io/polyfrost/oneconfig/OneConfig.java" + replaceToken("@VER@", project.version, className) + replaceToken("@NAME@", mod_name, className) + replaceToken("@ID@", mod_id, className) +} -sourceCompatibility = targetCompatibility = 1.8 +sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8 compileJava.options.encoding = 'UTF-8' -minecraft { - version = "1.8.9-11.15.1.2318-1.8.9" - runDir = "run" - mappings = "stable_22" - makeObfSourceJar = false +loom { + launchConfigs { + client { + + } + } + runConfigs { + client { + ideConfigGenerated = true + } + } + forge { + pack200Provider = new dev.architectury.pack200.java.Pack200Adapter() + } } configurations { - shade - implementation.extendsFrom(shade) + include + implementation.extendsFrom(include) } repositories { -mavenCentral() + maven { url 'https://repo.woverflow.cc/' } } dependencies { -implementation 'org.jetbrains:annotations:22.0.0' + minecraft("com.mojang:minecraft:1.8.9") + mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") + forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") } -/** - * This task simply replaces the `${version}` and `${mcversion}` properties in the mcmod.info with the data from Gradle - */ processResources { // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version + inputs.property "version", version + inputs.property "name", mod_name + inputs.property "id", mod_id - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace version and mcversion - expand 'version': project.version, 'mcversion': project.minecraft.version + filesMatching("mcmod.info") { + expand( + "id": mod_id, + "name": mod_name, + "version": version + ) } - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - } + rename '(.+_at.cfg)', 'META-INF/$1' } -/** - * This task simply moves resources so they can be accessed at runtime, Forge is quite weird isn't it - */ -task moveResources { - doLast { - ant.move file: "${buildDir}/resources/main", - todir: "${buildDir}/classes/java" +sourceSets { + main { + output.resourcesDir = java.classesDirectory } } -moveResources.dependsOn processResources -classes.dependsOn moveResources +remapJar { + archiveClassifier = "nodeps" +} + +jar { + manifest.attributes( + 'ModSide': 'CLIENT', + 'ForceLoadAsMod': true, + "TweakOrder": "0" + ) +} shadowJar { - archiveClassifier.set('dep') - configurations = [project.configurations.shade] + archiveClassifier.set('') + from(remapJar.archiveFile) + configurations = [project.configurations.include] duplicatesStrategy DuplicatesStrategy.EXCLUDE } - -reobf { shadowJar { mappingType = "SEARGE" } } -tasks.reobfShadowJar.mustRunAfter shadowJar -afterEvaluate { - build.dependsOn reobfShadowJar -}
\ No newline at end of file +assemble.dependsOn shadowJar
\ No newline at end of file |