Skip to content

Gradle plugin that adds the Mixin technology capability to your project.

License

Notifications You must be signed in to change notification settings

Skytils/MixinGradle

 
 

Repository files navigation

MixinGradle Logo

MixinGradle is a Gradle plugin which simplifies the build-time complexity of working with the SpongePowered Mixin framework for Java. It currently only supports usage with ForgeGradle.

Features

MixinGradle automates the following tasks:

Using MixinGradle

To use MixinGradle you must be using ForgeGradle. To configure the plugin for your build:

  1. Add a source repository to your buildScript -> dependencies block:
buildscript {
       repositories {
           <add source repository here>
       }
       dependencies {
           ...
           classpath 'org.spongepowered:mixingradle:0.5-SNAPSHOT'
       }
}
  1. Apply the plugin:
apply plugin: 'org.spongepowered.mixin'
  1. Create your mixin block, specify which sourceSets to process and provide refmap resource names for each one, the generated refmap will be added to the compiler task outputs automatically.
mixin {
       add sourceSets.main, "main.refmap.json"
       add sourceSets.another, "another.refmap.json"
}
  1. Alternatively, you can simply specify the ext.refMap property directly on your sourceSet:
sourceSets {
       main {
           ext.refMap = "main.refmap.json"
       }
       another {
           ext.refMap = "another.refmap.json"
       }
}
  1. You can define other mixin AP options in the mixin block, for example disableTargetValidator and disableTargetExport can be configured either by setting them as boolean properties:
mixin {
       disableTargetExport = true
       disableTargetValidator = true
}

or simply issuing them as directives:

mixin {
       disableTargetExport
       disableTargetValidator
}

You can also set the default obfuscation environment for generated refmaps, this is the obfuscation environment which will be contributed to the refmap's mappings node:

mixin {
       // Specify "notch" or "searge" here
       defaultObfuscationEnv notch
}

Building MixinGradle

MixinGradle can of course be built using Gradle. To perform a build simply execute:

gradle

To add the compiled jar to your local maven repository, run:

gradle build install

About

Gradle plugin that adds the Mixin technology capability to your project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Groovy 100.0%