Building Plugins with Gradle
All plugin builds must be performed from within the Nix development shell.Enter Development Shell
Build All Plugins
To build all plugins in the monorepo:--parallel flag enables parallel execution, significantly speeding up build times when building multiple plugins.
Build a Specific Plugin
To build a single plugin:Build Configuration
Shadow JAR
All plugins use the Shadow Gradle plugin to create fat JARs with all dependencies bundled. Key configuration frombuild.gradle.kts:
shadowJar task is automatically executed during gradle build.
Plugin Metadata
Plugin versions are automatically injected intoplugin.yml during the build process:
plugin.yml always has the correct version number.
Build Outputs
Built plugin JARs are located in each plugin’s build directory:plugins/OyasaiPets/build/libs/OyasaiPets.jarplugins/OyasaiUtilities/build/libs/OyasaiUtilities.jar
Testing with Nix
The platform includes comprehensive testing via Nix flakes:- Builds all packages
- Runs all tests (if any exist)
- Validates Nix expressions
- Shows verbose output (
-Lflag)
CI runs
nix flake check on every pull request. Ensure this passes locally before pushing.Dependency Updates
When you add or modify Gradle dependencies:Build Troubleshooting
Build Cache Issues
If you encounter strange build errors, try cleaning the Gradle cache:Kotlin Plugin Issues
Ensure the Kotlin plugin is properly configured. The rootbuild.gradle.kts applies Kotlin to all plugin projects:
Missing Repositories
If dependencies fail to download, verify the required repositories are configured inbuild.gradle.kts:
Local Testing
After building a plugin, you can test it on a local Purpur server. See Deployment for instructions on running a local test server.Code Quality
Before committing your changes:Next Steps
- Learn about Deployment options for testing your plugins
- Review contribution guidelines in
CONTRIBUTING.md - Set up a local Purpur server for testing