Commit Graph

2 Commits

Author SHA1 Message Date
tiennm99 2d74117fe2 refactor: rename packages org.nico.ratel.landlords -> com.miti99.caro.{common,server}
- Move all 11 shared sub-packages (channel, entity, enums, exception,
  features, handler, helper, print, robot, transfer, utils) under
  com.miti99.caro.common.
- Move server sub-packages (event, handler, proxy, timer) + SimpleServer
  + ServerContains under com.miti99.caro.server.
- Move tests under com.miti99.caro.common.{helper,robot}.tests.
- Rewrite package declarations and imports across all 58 .java files via
  regex script (server rules applied before common to avoid overlap).
- Update <mainClass> in server/pom.xml to com.miti99.caro.server.SimpleServer.
- Update .proto files' package + java_package to com.miti99.caro.common.entity
  (for future regeneration).
- Fix generate.sh relative output path (common/ no longer exists).
- Include rewrite-packages.py script under plans/ for auditability.

Note: protoc-generated ClientTransferData.java / ServerTransferData.java
retain internal_static_* variable names and embedded descriptor byte strings
with the old package — these are implementation details that do not affect
the public Java package and preserve protobuf wire compatibility.

Validation: mvn -f server/pom.xml clean verify on Java 25 — all 37 tests
pass (29 GomokuHelperTest + 8 GomokuAITest).
2026-04-10 19:14:02 +07:00
tiennm99 5b68ee9cc4 refactor: standalone maven, java 25, shade, gson, junit 5, rename to server/
Build system modernization:
- Delete root parent pom.xml; server/pom.xml is now standalone.
- Drop Spring Boot parent; use maven-shade-plugin 3.6.0 for fat jar.
- Upgrade source/target to Java 25 (LTS); pin explicit dep versions:
    netty-all 4.1.115.Final, protobuf-java 3.25.5, gson 2.11.0,
    junit-jupiter 5.11.3, maven-compiler-plugin 3.13.0,
    maven-surefire-plugin 3.5.2, maven-shade-plugin 3.6.0.
- New coordinates: com.miti99.caro:caro-server:0.0.1-beta.
- Shade transformers: manifest (main class), services, appending
  (Netty io.netty.versions.properties merge).

Dependency migration:
- Replace com.smallnico:noson with gson across 5 files (7 call sites):
    MapHelper, TransferProtocolUtils, ServerEventListener_CODE_GAME_WATCH,
    ServerEventListener_CODE_GET_ROOMS, ServerEventListener_CODE_ROOM_CREATE.
  All call sites now funnel through existing JsonUtils wrapper (DRY).
- Migrate GomokuHelperTest + GomokuAITest from JUnit 4 to JUnit 5
  (org.junit.Test -> org.junit.jupiter.api.Test,
   org.junit.Assert.* -> org.junit.jupiter.api.Assertions.*).

Directory + infra:
- git mv landlords-server/ -> server/.
- Rewrite server/Dockerfile: Java 25 base images
  (maven:3.9-eclipse-temurin-25 build, eclipse-temurin:25-jre-alpine runtime),
  simplified COPY paths (no more multi-module layout).
- docker-compose.yml: dockerfile points to server/Dockerfile.
- .github/workflows/build.yml: setup-java temurin 25,
  `mvn -f server/pom.xml -B clean verify`.

Validation: mvn verify on Java 25 passes all 37 tests (29 GomokuHelper
+ 8 GomokuAI), shade produces caro-server-0.0.1-beta.jar cleanly.

Note: package names remain org.nico.ratel.landlords.* in this phase;
renamed to com.miti99.caro.{common,server}.* in Phase 4.
2026-04-10 19:10:51 +07:00