Gradle plugin for remapping mojang-mapped artifact to spigot-mapped
Uses SpecialSource for remapping.
For those seeking for nms & stable remapper, try using userdev
from PaperMC/paperweight project.
I will not (can not) provide any additional help for additional non-spigot features (incl. support for specific spigot fork)
There could be some methods that do not remap properly, so it is required to find some workarounds for those methods.
Using the plugins DSL:
plugins {
id("io.github.patrick.remapper") version "1.4.2"
}
Using legacy plugin application:
Click to View
buildscript {
repositories {
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath("io.github.patrick-choe:mojang-spigot-remapper:1.4.2")
}
}
apply(plugin = "io.github.patrick.remapper")
Using the plugins DSL:
plugins {
id "io.github.patrick.remapper" version "1.4.2"
}
Using legacy plugin application:
Click to View
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "io.github.patrick-choe:mojang-spigot-remapper:1.4.2"
}
}
apply plugin: "io.github.patrick.remapper"
- Prerequisite: Run BuildTools with
--remapped
option. - Setup by applying the plugin to the project. See above for more details.
- This will add
remap
task to the project.
- This will add
- Configure
remap
task. Advanced configuration option is available in the below section.- Example:
tasks { remap { version.set("1.20.5") } }
- Example:
- Run
remap
task to remap mojang-mapped jar artifact to spigot-mapped.
tasks {
remap {
// Required
// Specify minecraft (spigot) version of your project.
// TODO: Auto-detect library version by default
version.set("1.20.5")
// Use this option to change remapping action.
// Defaults to `RemapTask.Action.MOJANG_TO_SPIGOT`.
action.set(RemapTask.Action.MOJANG_TO_SPIGOT)
// If this option is set to true, the entire task would be skipped.
skip.set(true)
// Use this option to explicitly set the input task.
// Defaults to `jar` task.
inputTask.set(jar)
// If this option is used, instead of overwriting an existing artifact,
// the remap output would be available at file named as `archiveName`.
// Note that `archiveName` has higher priority over `archiveClassifier`.
archiveName.set("${project.name}-${project.version}-remapped.jar")
// If this option is used, instead of overwriting an existing artifact,
// the remap output would be available at "${archiveBaseName}-${archiveVersion}-${archiveClassifier}.jar"
// Note that `archiveName` has higher priority over `archiveClassifier`.
archiveClassifier.set("remapped")
// Use this option to set output directory of remapped archive file.
// Defaults to output directory of input task.
archiveDirectory.set(File(projectDir, "output"))
}
}
All contributions are welcome!
If you encounter any problems, or have suggestions, please leave an issue!
Contact me at
- Discord: patrickkr
- Email: mailpatrickkr [@] gmail.com
- Remove transitive dependency inheritance
- Remove unnecessary error suppressing
1.4.1
- Update library versions
- Fix deprecated gradle features (Thanks to @gmitch215)
1.4.0
- Update library versions
- Modify buildscript
- Change type of
archiveDirectory
option toDirectoryProperty
(Thanks to @AlexProgrammerDE) - Change visibility of
ActualProcedure
tointernal
1.3.0
- Update library versions
- Add archiveDirectory option
1.2.0
- Fix internal implementation of remapping
- Change configuration options
1.1.2
- Fix publication error from v1.1.1
1.1.1
- Update library versions
- Add note about
userdev
1.1.0
- Add archiveName, archiveClassifier option
1.0.0
- Initial release