Compare commits

..

2 Commits

Author SHA1 Message Date
Joseph Doherty b6a0d9069c fix(java-client): bump CLIENT_VERSION constant 0.1.2 -> 0.2.0 to match artifact
The hardcoded clientVersion() string lagged the Gradle version bump in the
JDK-17 retarget, so version/--json self-reported 0.1.2. Align it (and the two
CLI version-command test assertions) to 0.2.0. 97/97 tests pass.
2026-06-26 16:19:17 -04:00
Joseph Doherty 291c94ffe1 build(java-client): retarget JDK 21 -> 17 for Ignition 8.3 (v0.2.0)
Ignition 8.3 runs on JDK 17; the 0.1.2 client was compiled --release 21
(class-file v65) and would throw UnsupportedClassVersionError when loaded
in an Ignition module. Drop the toolchain and bytecode target to 17 so the
artifact loads on the gateway (a 17 build still runs on 21+). No source uses
Java 18-21 APIs, so this is a pure target change. Bump 0.1.2 -> 0.2.0.

Update the toolchain-pinning smoke test to assert feature()==17.
All 97 tests pass; all jar classes verified class-file v61. Roadmap G0.
2026-06-26 16:02:48 -04:00
4 changed files with 12 additions and 8 deletions
+5 -3
View File
@@ -13,18 +13,20 @@ ext {
subprojects { subprojects {
group = 'com.zb.mom.ww.mxgateway' group = 'com.zb.mom.ww.mxgateway'
version = '0.1.2' version = '0.2.0'
pluginManager.withPlugin('java') { pluginManager.withPlugin('java') {
java { java {
// Retargeted 21 -> 17 so the artifact loads on Ignition 8.3's JDK 17
// (a 17-targeted build still runs on 21+). See roadmap G0.
toolchain { toolchain {
languageVersion = JavaLanguageVersion.of(21) languageVersion = JavaLanguageVersion.of(17)
} }
} }
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
options.release = 21 options.release = 17
} }
tasks.withType(Test).configureEach { tasks.withType(Test).configureEach {
@@ -56,7 +56,7 @@ final class MxGatewayCliTests {
assertEquals(0, run.exitCode()); assertEquals(0, run.exitCode());
assertEquals("", run.errors()); assertEquals("", run.errors());
assertTrue(run.output().contains("mxgateway-java 0.1.2")); assertTrue(run.output().contains("mxgateway-java 0.2.0"));
assertTrue(run.output().contains("gatewayProtocolVersion=3")); assertTrue(run.output().contains("gatewayProtocolVersion=3"));
assertTrue(run.output().contains("workerProtocolVersion=1")); assertTrue(run.output().contains("workerProtocolVersion=1"));
} }
@@ -86,7 +86,7 @@ final class MxGatewayCliTests {
CliRun run = execute(new FakeClientFactory(), "version", "--json"); CliRun run = execute(new FakeClientFactory(), "version", "--json");
assertEquals(0, run.exitCode()); assertEquals(0, run.exitCode());
assertTrue(run.output().contains("\"clientVersion\":\"0.1.2\"")); assertTrue(run.output().contains("\"clientVersion\":\"0.2.0\""));
assertTrue(run.output().contains("\"gatewayProtocolVersion\":3")); assertTrue(run.output().contains("\"gatewayProtocolVersion\":3"));
} }
@@ -9,7 +9,7 @@ package com.zb.mom.ww.mxgateway.client;
public final class MxGatewayClientVersion { public final class MxGatewayClientVersion {
private static final int GATEWAY_PROTOCOL_VERSION = 3; private static final int GATEWAY_PROTOCOL_VERSION = 3;
private static final int WORKER_PROTOCOL_VERSION = 1; private static final int WORKER_PROTOCOL_VERSION = 1;
private static final String CLIENT_VERSION = "0.1.2"; private static final String CLIENT_VERSION = "0.2.0";
private MxGatewayClientVersion() { private MxGatewayClientVersion() {
} }
@@ -23,7 +23,9 @@ final class GeneratedContractSmokeTests {
} }
@Test @Test
void javaTwentyOneToolchainRunsTests() { void javaSeventeenToolchainRunsTests() {
assertEquals(21, Runtime.version().feature()); // Pinned to 17: the client is retargeted to JDK 17 so it loads on
// Ignition 8.3's JDK 17 runtime (roadmap G0). A 17 build still runs on 21+.
assertEquals(17, Runtime.version().feature());
} }
} }