diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 000000000..80d8a5906 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,25 @@ +name: Java CI with Gradle + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew SetupCIWorkspace build + - name: Build with Gradle (nomixin) + run: ./gradlew build -Pnomixin + - uses: actions/upload-artifact@v2 + with: + name: Package + path: build/libs \ No newline at end of file diff --git a/build.gradle b/build.gradle index de0b533aa..0d18976e2 100644 --- a/build.gradle +++ b/build.gradle @@ -87,9 +87,15 @@ jar { //Add //--tweakClass org.spongepowered.asm.launch.MixinTweaker --mixin customnpcs.mixins.json //to your client and server program arguments if working in a dev environment. +def embedMixin = !project.hasProperty("nomixin"); def yourMixinConfig = 'customnpcs.mixins.json' def refMapForYourConfig = 'customnpcs.refmap.json' def relativePathToMixinAP = 'tools/mixin-0.8-SNAPSHOT.jar' + +if(!embedMixin){ + version += "+nomixin" +} + repositories { maven { name = "sponge" @@ -98,13 +104,24 @@ repositories { } dependencies { - embed('org.spongepowered:mixin:0.7.11-SNAPSHOT') { - // Mixin includes a lot of dependencies that are too up-to-date - exclude module: 'launchwrapper' - exclude module: 'guava' - exclude module: 'gson' - exclude module: 'commons-io' - exclude module: 'log4j-core' + if(embedMixin){ + embed('org.spongepowered:mixin:0.7.11-SNAPSHOT') { + // Mixin includes a lot of dependencies that are too up-to-date + exclude module: 'launchwrapper' + exclude module: 'guava' + exclude module: 'gson' + exclude module: 'commons-io' + exclude module: 'log4j-core' + } + } else { + implementation('org.spongepowered:mixin:0.7.11-SNAPSHOT') { + // Mixin includes a lot of dependencies that are too up-to-date + exclude module: 'launchwrapper' + exclude module: 'guava' + exclude module: 'gson' + exclude module: 'commons-io' + exclude module: 'log4j-core' + } } }