Skip to content

Building and Debugging

Building Plugins

cd erii-plugins

# Build a single plugin
./gradlew :my-plugin:build

# Build all plugins
./gradlew buildAllPlugins

Plugin build artifacts are located in the build/plugin/ directory in zip format. Place them in your erii project's plugins/ directory to load.

Debugging Methods

Method 1: Attach to Dev Server

  1. Start the erii development server:

    ./gradlew run
    
  2. Set breakpoints in your IDE, then trigger plugin logic by sending messages through NapCat.

Method 2: Log Debugging

import io.github.oshai.kotlinlogging.KotlinLogging

private val log = KotlinLogging.logger {}

// Use in extensions
log.info { "Plugin loaded: $name" }
log.debug { "Processing message from ${meta.senderId}" }
log.error { "Failed to process: ${e.message}" }

Method 3: Unit Testing

class MyPluginTest {
    @Test
    fun testPluginLogic() {
        // Test plugin core logic
    }
}

Run tests:

./gradlew :erii-plugins:my-plugin:test

Development Tips

  • After modifying plugins, run erii reload to hot-reload without restarting the server
  • View plugin logs: erii server logs
  • Check plugin load status via erii stats