diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-03-12 14:53:23 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-03-12 14:53:23 +0700 |
commit | dd0d2d6d5c0191861cab0611d9fc28d7f4edb088 (patch) | |
tree | 96d8b3e88821e42b9b0357ddda1c5170992a57e5 /build.gradle | |
parent | eef8bab78435d86107d95951cc1da04317520d33 (diff) | |
download | Chatting-dd0d2d6d5c0191861cab0611d9fc28d7f4edb088.tar.gz Chatting-dd0d2d6d5c0191861cab0611d9fc28d7f4edb088.tar.bz2 Chatting-dd0d2d6d5c0191861cab0611d9fc28d7f4edb088.zip |
chat tabs documentation
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 138 |
1 files changed, 56 insertions, 82 deletions
diff --git a/build.gradle b/build.gradle index e9af2ed..17cd5f6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,16 @@ -//file:noinspection GradlePackageUpdate +//file:noinspection UnnecessaryQualifiedReference +//file:noinspection GroovyAssignabilityCheck + plugins { - id "net.minecraftforge.gradle.forge" version "6f53277" - id "com.github.johnrengelman.shadow" version "6.1.0" - id 'org.spongepowered.mixin' version "d5f9873" - id 'org.jetbrains.kotlin.jvm' version "1.6.10" + id "dev.architectury.architectury-pack200" version "0.1.3" + id 'org.jetbrains.kotlin.jvm' version '1.6.10' + id "cc.woverflow.loom" version "0.10.1" id "net.kyori.blossom" version "1.3.0" id "java" } version = mod_version -group = "cc.woverflow" +group = "com.example" archivesBaseName = mod_name blossom { @@ -18,23 +19,31 @@ blossom { replaceToken("@NAME@", mod_name, className) replaceToken("@ID@", mod_id, className) } - -sourceCompatibility = targetCompatibility = 1.8 +kotlin.jvmToolchain { + languageVersion = JavaLanguageVersion.of(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 - - clientRunArgs += "--mixin mixins.${mod_id}.json" - clientRunArgs += '--tweakClass gg.essential.loader.stage0.EssentialSetupTweaker' - clientJvmArgs += '-Dfml.coreMods.load=cc.woverflow.wcore.tweaker.WCoreTweaker' +loom { + launchConfigs { + client { + arg("--tweakClass", "cc.woverflow.onecore.tweaker.OneCoreTweaker") + property("onecore.mixin", "mixins.${mod_id}.json") + } + } + runConfigs { + client { + ideConfigGenerated = true + } + } + forge { + pack200Provider = new dev.architectury.pack200.java.Pack200Adapter() + mixinConfig("mixins.${mod_id}.json") + mixin.defaultRefmapName.set("mixins.${mod_id}.refmap.json") + } } configurations { - // Creates an extra configuration that implements `implementation` to be used later as the configuration that shades libraries include implementation.extendsFrom(include) } @@ -44,27 +53,20 @@ repositories { } dependencies { - include ('gg.essential:loader-launchwrapper:1.1.3') { - transitive = false - } - compileOnly 'gg.essential:essential-1.8.9-forge:1788' - compileOnly annotationProcessor ('org.spongepowered:mixin:0.8.5-SNAPSHOT') - annotationProcessor("com.google.code.gson:gson:2.2.4") - annotationProcessor("com.google.guava:guava:21.0") - annotationProcessor("org.ow2.asm:asm-tree:6.2") - compileOnly 'cc.woverflow:w-core:1.1.3' - include ('cc.woverflow:w-core-tweaker:1.0.2') { + 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") + compileOnly 'gg.essential:essential-1.8.9-forge:1933' + compileOnly 'cc.woverflow:onecore:1.3.3' + include ('cc.woverflow:onecore-tweaker:1.3.0') { transitive = false } + compileOnly ('org.spongepowered:mixin:0.8.5-SNAPSHOT') } -/** - * 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", version - inputs.property "mcversion", minecraft.version inputs.property "name", mod_name inputs.property "id", mod_id @@ -72,10 +74,10 @@ processResources { expand( "id": mod_id, "name": mod_name, - "version": version, - "mcversion": minecraft.version + "version": version ) } + filesMatching("mixins.${mod_id}.json") { expand("id": mod_id) } @@ -83,57 +85,29 @@ processResources { rename '(.+_at.cfg)', 'META-INF/$1' } -jar { - manifest.attributes( - "ModSide": "CLIENT", - "TweakClass": "gg.essential.loader.stage0.EssentialSetupTweaker", - "TweakOrder": "0", - "MixinConfigs": "mixins.chatting.json", - 'ForceLoadAsMod': true, - "FMLCorePlugin": "cc.woverflow.wcore.tweaker.WCoreTweaker", - "FMLCorePluginContainsFMLMod": true - ) - - enabled = false -} - -/** - * 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/kotlin" - } -} - -moveResources.dependsOn processResources -classes.dependsOn moveResources - -mixin { - disableRefMapWarning = true - defaultObfuscationEnv searge - add sourceSets.main, "mixins.${mod_id}.refmap.json" -} - -// This adds support to ("include") libraries into our JAR -shadowJar { - archiveClassifier.set('') - configurations = [project.configurations.include] - duplicatesStrategy DuplicatesStrategy.EXCLUDE -} - -reobf { - shadowJar { - classpath = sourceSets.main.compileClasspath - } -} - -tasks.reobfJar.dependsOn tasks.shadowJar sourceSets { dummy main { compileClasspath += dummy.output - ext.refMap = "mixins.${mod_id}.refmap.json" + output.resourcesDir = java.classesDirectory + } +} + +jar { + dependsOn configurations.include + from(configurations.include.collect { it.isDirectory() ? it : zipTree(it) }) { + def i = 0 + filesMatching("META-INF/NOTICE*") { name = "$name.${i++}" } + filesMatching("META-INF/LICENSE*") { name = "$name.${i++}" } + filesMatching("META-INF/mods.toml") { name = "$name.${i++}" } + filesMatching("LICENSE*") { name = "$name.${i++}" } } + + manifest.attributes( + 'ModSide': 'CLIENT', + 'ForceLoadAsMod': true, + 'TweakClass': 'cc.woverflow.onecore.tweaker.OneCoreTweaker', + 'MixinConfigs': "mixins.${mod_id}.json", + "TweakOrder": "0" + ) }
\ No newline at end of file |