Files
Felis/plugins/paper/build.gradle

63 lines
2.4 KiB
Groovy

plugins {
id 'java'
}
group = 'best.lolicon.felis'
version = '0.1.0'
// The lobby runs Paper 26.x, which needs Java 25, and paper-api 26.x is published as a
// Java-25 artifact (its Gradle module metadata declares org.gradle.jvm.version = 25), so
// this module compiles with a Java-25 toolchain. The toolchain block makes that explicit
// and self-enforcing: Gradle uses a detected JDK 25 whichever JDK runs Gradle, and fails
// loudly if none is present. The shared codec is plain Java-17 source, which 25 compiles
// forward-compatibly.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
repositories {
mavenCentral()
maven {
name = 'papermc'
url = 'https://repo.papermc.io/repository/maven-public/'
}
}
dependencies {
// paper-api is compile-only (the server provides it at runtime). It pulls in
// Bukkit + Adventure, which is all the lobby face needs.
//
// Pinned to the API of the exact server the lobby image bundles: deploy/game-stack.lock's
// PAPER_JAR_URL is paper-<mc>-<build>.jar, and PaperMC publishes that build's API as
// <mc>.build.<build>-<channel>. A release build, never a -SNAPSHOT, so the same sources
// compile against the same bytes every time (gradle/verification-metadata.xml checks
// them). deploy/bootstrap_test.sh fails when this and the lock drift apart.
compileOnly 'io.papermc.paper:paper-api:26.3.build.40-alpha'
}
// The lobby is a PURE UI face (spec §12): it speaks only the felis:control
// plugin-message channel and never holds a felis-api token or talks to felis-api
// directly. We enforce that physically here — the shared source root is on the
// path, but the include filter ships ONLY the paper package and the three codec
// files (Control + ControlFrame + Json). FelisApiClient, LinkClient and the token
// config are not compiled in at all, so the lobby cannot reach the API even by
// mistake. If a codec class grows a new dependency, compilation fails loudly here
// rather than silently widening the lobby's reach.
sourceSets {
main {
java {
srcDir '../shared/src/main/java'
include 'best/lolicon/felis/paper/**'
include 'best/lolicon/felis/link/Control.java'
include 'best/lolicon/felis/link/ControlFrame.java'
include 'best/lolicon/felis/link/Json.java'
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}