https://github.com/nycodeghg/gradle-spigot-dependency-loader
Gradle Plugin for adding your dependencies to your plugin.yml during build process.
https://github.com/nycodeghg/gradle-spigot-dependency-loader
gradle-plugin hacktoberfest kotlin minecraft papermc spigot
Last synced: 2 months ago
JSON representation
Gradle Plugin for adding your dependencies to your plugin.yml during build process.
- Host: GitHub
- URL: https://github.com/nycodeghg/gradle-spigot-dependency-loader
- Owner: NyCodeGHG
- License: mit
- Created: 2021-06-12T20:32:45.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-30T10:35:14.000Z (over 4 years ago)
- Last Synced: 2025-08-25T16:37:33.490Z (10 months ago)
- Topics: gradle-plugin, hacktoberfest, kotlin, minecraft, papermc, spigot
- Language: Kotlin
- Homepage:
- Size: 137 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gradle Spigot Dependency Loader
[](https://plugins.gradle.org/plugin/de.nycode.spigot-dependency-loader) [](https://github.com/NyCodeGHG/gradle-spigot-dependency-loader/releases)
A simple Gradle plugin, to use the new MC 1.16.5+ runtime dependency loader to load your dependencies at runtime
## How to use
- Add the plugin
Kotlin DSL
```kotlin
plugins {
id("de.nycode.spigot-dependency-loader") version "1.1.2"
}
dependencies {
// the plugin adds a spigot dependency configuration, which will automatically add
// all it's dependencies to the plugin.yml
// compileOnly will automatically inherit from spigot so all spigot dependencies are visible to the compiler and
// your IDE
// Also only mavenCentral() dependencies should be added here
spigot("com.squareup.okhttp3", "okhttp", "4.9.0")
}
```
Groovy DSL
```groovy
plugins {
id "de.nycode.spigot-dependency-loader" version "1.1.2"
}
dependencies {
// the plugin adds a spigot dependency configuration, which will automatically add
// all it's dependencies to the plugin.yml
// compileOnly will automatically inherit from spigot so all spigot dependencies are visible to the compiler and
// your IDE
// Also only mavenCentral() dependencies should be added here
spigot "com.squareup.okhttp3", "okhttp", "4.9.0"
}
```
- Call the `exportDependenciesToPluginYml` Task when building
## Features
- Load your Spigot dependencies at runtime
# The exportDependenciesToPluginYml task
By default, the `exportDependenciesToPluginYml` task gets created which sources the plugin.yml from
the `processResources` output, or the main resources source set and exports it directly into the build output to not
interfere with any YAML guidelines your project might have and poison your source with generated code. If you want to
disable the default task you can create your own like this. The tasks get automatically added as a dependency
on `classes` and depends on `processResources`
```kotlin
spigotDependencyLoader {
createDefaultTask.set(false) // this defaults to true
}
tasks {
task("exportDependenciesToPluginYml") {
pluginYml.set(Path(""))
outputDirectory.set("") //file name is as specified above
// Dependency configurations to export
configurations.add(configurations.spigot) // default configuration
// Extra dependencies not in the configs
dependency("extra:dependency:1.0.0")
// Charset to encode plugin.yml
fileCharset.set(Charsets.UTF_8) // default
}
}
```
## Contributing
Feel free to open an issue or submit a pull request for any bugs/improvements.
## License
This Gradle Plugin is licensed under the MIT License - see the [License](LICENSE) file for details.