Overview
Oyasai Server Platform uses Gradle 9 with Kotlin DSL for building all plugins. The build system is integrated with Nix for reproducible builds and dependency management.Gradle Configuration
Build System Components
- Gradle Version: 9 (provided via Nix)
- JDK: Temurin 25
- Build Language: Kotlin DSL (.gradle.kts files)
- Plugins: Kotlin JVM, Shadow (fat JAR creation)
Project Structure
Root Build Configuration
The rootbuild.gradle.kts configures all plugin subprojects automatically.
Buildscript Dependencies
build.gradle.kts:3-10.
Repository Configuration
All projects have access to these repositories:build.gradle.kts:12-19.
Subproject Configuration
Every plugin under:plugins:* automatically receives:
-
Applied Plugins:
org.jetbrains.kotlin.jvmcom.gradleup.shadowjava-library
-
JAR Configuration:
- Default JAR task is disabled
- Shadow JAR is used for all builds
- No classifier (clean filenames)
- Duplicate strategy: EXCLUDE
-
Resource Processing:
- Version property expansion in
plugin.yml - UTF-8 charset for filtering
- Version property expansion in
-
Build Task:
- Depends on
shadowJartask
- Depends on
build.gradle.kts:21-53.
Common Gradle Tasks
Build Tasks
Shadow JAR Tasks
Dependency Tasks
Project Information
Plugin Build Files
Minimal build.gradle.kts
Most plugins only need to declare dependencies:plugins/OyasaiUtilities/build.gradle.kts:1-5.
With Multiple Dependencies
With Kotlin Standard Library
Nix Integration
gradle2nix
Oyasai Platform usesgradle2nix for reproducible Nix builds. When you add or update dependencies, you must regenerate the lockfile.
Update Lockfile
- Resolves all Gradle dependencies
- Generates
gradle.lockfor Nix - Ensures reproducible builds
Nix Build Process
The Nix build system builds all plugins in a single batch:nix/oyasai-scope.nix:50-76.
Individual Plugin Derivations
Each plugin gets a thin derivation that copies from the batch build:nix/oyasai-scope.nix:106-114.
Version Management
Setting Version
The version is set at the project level and automatically expanded inplugin.yml:
${version} placeholder is replaced during the processResources task (see build.gradle.kts:44-49).
Version in Nix
When creating server packages, you can reference plugins by version:Build Performance
Parallel Builds
Always use--parallel for multi-plugin builds:
Gradle Daemon
The Gradle daemon speeds up subsequent builds. It’s enabled by default in Nix devshell.Build Cache
Gradle’s build cache is automatically configured. Incremental builds reuse unchanged outputs.CI Builds
The CI runs:CONTRIBUTING.md:46-50.
Troubleshooting
Clean Build
If you encounter build issues:Refresh Dependencies
Force Gradle to re-download dependencies:Check Lockfile Sync
If Nix builds fail but Gradle builds succeed:Gradle Wrapper Issues
In the Nix devshell, use the provided Gradle:Next Steps
Plugin Development
Learn how to create and build plugins
Nix Packages
Create server configurations with Nix
Testing
Test your plugins locally
Contributing
Submit your changes for review