84 lines
3.3 KiB
Groovy
84 lines
3.3 KiB
Groovy
plugins {
|
|
id 'java'
|
|
}
|
|
|
|
group = 'best.lolicon.felis'
|
|
version = '0.1.0'
|
|
|
|
// Emit portable Java 17 bytecode (options.release below) from whatever JDK runs Gradle.
|
|
// Current LOOHP/Limbo releases ship Java 21 API classes (class-file major 65), so that
|
|
// JDK must be >= 21 to *read* them — a JDK 17 fails with "wrong version 65.0, should be
|
|
// 61.0". The plugin build image and CI both run JDK 25. Targeting release 17 keeps the
|
|
// plugin loadable on any Limbo running Java 17+.
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
// LOOHP publishes the Limbo API artifact to their own repository.
|
|
maven {
|
|
name = 'loohp'
|
|
url = 'https://repo.loohpjames.com/repository'
|
|
}
|
|
}
|
|
|
|
// Pull in the platform-neutral link core (best.lolicon.felis.link) the same way
|
|
// every other module does — a source include, not a jar dependency — so the
|
|
// account-link client (LinkClient), the internal read/drive client (FelisApiClient)
|
|
// and the env/properties config loader compile straight into this jar with nothing
|
|
// to shade. See plugins/README.md "Architecture".
|
|
sourceSets {
|
|
main {
|
|
java {
|
|
srcDir '../shared/src/main/java'
|
|
}
|
|
}
|
|
}
|
|
|
|
// The Limbo API version this plugin compiles against: the release the login-gate image
|
|
// bundles, deploy/game-stack.lock's LIMBO_VERSION. deploy/bootstrap.sh passes it to the
|
|
// image build and plugins/test.sh reads it from the lock, e.g.
|
|
// -PlimboVersion=2026.0.3-ALPHA. It has no default: LOOHP's repository serves no
|
|
// maven-metadata.xml, so a dynamic version cannot resolve, and a guessed one would
|
|
// compile against an API the gate does not run. gradle/verification-metadata.xml holds
|
|
// the checksum of the locked release, so a lock refresh regenerates it (see
|
|
// plugins/README.md "Dependency verification").
|
|
def limboVersion = project.findProperty('limboVersion')
|
|
if (!limboVersion) {
|
|
throw new GradleException('pass -PlimboVersion=<LIMBO_VERSION from deploy/game-stack.lock>')
|
|
}
|
|
|
|
dependencies {
|
|
// Limbo provides its own API at runtime (the plugin is loaded into the Limbo
|
|
// JVM), so it is compile-only — nothing to shade.
|
|
compileOnly "com.loohp:Limbo:${limboVersion}"
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8'
|
|
// Portable output: read the Java 21 Limbo API with a JDK >= 21, but emit Java 17
|
|
// bytecode so the plugin loads on any Limbo running Java 17+.
|
|
options.release = 17
|
|
}
|
|
|
|
// The login gate's self-test: LoginFlowTest runs the whole login flow on a virtual
|
|
// clock (a fake scheduler and players around the real LoginFlow, the real felis-api
|
|
// clients against a stub) plus the readiness endpoint, the env parsing and the book.
|
|
// A framework-free main like the other plugins' tests; plugins/test.sh runs
|
|
// `./gradlew loginTest`. The Limbo jar is on the classpath for the adventure types the
|
|
// book is built from.
|
|
sourceSets {
|
|
loginTest {
|
|
java {
|
|
srcDir 'test'
|
|
}
|
|
compileClasspath += sourceSets.main.output + configurations.compileClasspath
|
|
runtimeClasspath += output + compileClasspath
|
|
}
|
|
}
|
|
|
|
tasks.register('loginTest', JavaExec) {
|
|
group = 'verification'
|
|
description = 'Runs the LoginFlowTest self-test main.'
|
|
classpath = sourceSets.loginTest.runtimeClasspath
|
|
mainClass = 'best.lolicon.felis.limbo.LoginFlowTest'
|
|
}
|