diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a95026..d4265cd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: ViaForge build +name: ViaForge CI on: [pull_request, push, workflow_dispatch] jobs: @@ -21,10 +21,10 @@ jobs: - name: Make Gradle wrapper runnable on Unix run: chmod +x ./gradlew - name: Build - run: ./gradlew build + run: ./gradlew shadowJar - name: Upload Build Artifacts if: ${{ runner.os == 'Linux' && matrix.java == '8' }} uses: actions/upload-artifact@v3 with: name: ViaForge-1.12.2 - path: mc1122/build/libs/ + path: viaforge-mc112/build/libs/ diff --git a/build.gradle b/build.gradle index e4498b3..2bae1ab 100644 --- a/build.gradle +++ b/build.gradle @@ -6,13 +6,13 @@ plugins { subprojects { apply plugin: "com.github.johnrengelman.shadow" - archivesBaseName = "ViaForge-" + project.maven_name + archivesBaseName = project.maven_name version = maven_version + project.mc_version group = maven_group configurations { - library - implementation.extendsFrom(library) + include + implementation.extendsFrom(include) } repositories { @@ -25,21 +25,30 @@ subprojects { } dependencies { - library "com.viaversion:viaversion:${project.viaversion_version}" - library "com.viaversion:viabackwards:${project.viabackwards_version}" - library "com.viaversion:viarewind-universal:${project.viarewind_version}" - library "org.yaml:snakeyaml:${project.snake_yml_version}" + include "com.viaversion:viaversion:${project.viaversion_version}" + include "com.viaversion:viabackwards:${project.viabackwards_version}" + include "com.viaversion:viarewind-universal:${project.viarewind_version}" + include "org.yaml:snakeyaml:${project.snake_yml_version}" - library "net.raphimc:ViaLoader:${project.vialoader_version}" + include "net.raphimc:ViaLoader:${project.vialoader_version}" } - shadowJar { - archiveFileName = jar.archiveFileName - compileJava.options.encoding = "UTF-8" - exclude "native-binaries/*" - - configurations = [project.configurations.compileClasspath] + jar { + manifest.attributes( + "Specification-Title": "viaforge", + "Specification-Vendor": "viaforge", + "Specification-Version": "1", + "Implementation-Title": project.name, + "Implementation-Version": "${archiveVersion}", + "Implementation-Vendor" :"viaforge", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd"-"HH:mm:ssZ"), + "TweakClass": "org.spongepowered.asm.launch.MixinTweaker", + "TweakOrder": "0", + "FMLCorePluginContainsFMLMod": "true", + "FMLCorePlugin": "de.florianmichael.viaforge.mixin.MixinLoader", + "MixinConfigs": "mixins.${maven_name}.json", + "ForceLoadAsMod": "true" + ) + enabled = false } - - jar.dependsOn("shadowJar") } diff --git a/viaforge-mc112/build.gradle b/viaforge-mc112/build.gradle index 722e659..f4e9be6 100644 --- a/viaforge-mc112/build.gradle +++ b/viaforge-mc112/build.gradle @@ -38,8 +38,8 @@ sourceSets.main.resources { dependencies { minecraft "net.minecraftforge:forge:1.12.2-14.23.5.2859" - library "org.spongepowered:mixin:${mixin_version}" - library "org.slf4j:slf4j-api:${project.slf4j_version}" + include "org.spongepowered:mixin:${mixin_version}" + include "org.slf4j:slf4j-api:${project.slf4j_version}" annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor" } @@ -48,26 +48,13 @@ mixin { add sourceSets.main, "mixins.${maven_name}.refmap.json" } -jar { - manifest.attributes( - "Specification-Title": "viaforge", - "Specification-Vendor": "viaforge", - "Specification-Version": "1", - "Implementation-Title": project.name, - "Implementation-Version": "${archiveVersion}", - "Implementation-Vendor" :"viaforge", - "Implementation-Timestamp": new Date().format("yyyy-MM-dd"-"HH:mm:ssZ"), - "TweakClass": "org.spongepowered.asm.launch.MixinTweaker", - "TweakOrder": "0", - "FMLCorePluginContainsFMLMod": "true", - "FMLCorePlugin": "de.florianmichael.viaforge.mixin.MixinLoader", - "MixinConfigs": "mixins.${maven_name}.json", - "ForceLoadAsMod": "true" - ) - enabled = false +shadowJar { + archiveFileName = jar.archiveFileName + configurations = [project.configurations.include] + duplicatesStrategy DuplicatesStrategy.EXCLUDE } reobf { - shadowJar {} + shadowJar { + } } -