a bit of work I've done while in japan
Find a file
2026-01-05 15:05:23 +01:00
.idea need to sleep 2026-01-05 15:05:23 +01:00
gradle/wrapper no modules yet 2025-12-27 13:41:24 +01:00
tottori-hungergames need to sleep 2026-01-05 15:05:23 +01:00
tottori-microservice-isonline . 2026-01-03 11:07:44 +01:00
tottori-services . 2026-01-03 11:07:44 +01:00
.gitignore . 2026-01-05 08:10:39 +01:00
build.gradle.kts no modules yet 2025-12-27 13:41:24 +01:00
gradle.properties no modules yet 2025-12-27 13:41:24 +01:00
gradlew no modules yet 2025-12-27 13:41:24 +01:00
gradlew.bat no modules yet 2025-12-27 13:41:24 +01:00
README.md maybe use coroutines? 2026-01-05 09:12:00 +01:00
RPC.md . 2026-01-03 11:07:44 +01:00
settings.gradle.kts . 2026-01-04 11:33:35 +01:00

TODO use git submodules for each module

Sorry for the monorepo. have some chatgpt instructions:

Below is a clean, standard Gradle multi-module setup where one module called tottori-services is accessible to all other modules.

Ill show:

  1. Project structure
  2. settings.gradle
  3. Root build.gradle
  4. tottori-services module config (important part)
  5. How other modules depend on it

This works for Java / Kotlin JVM projects (Android is slightly different—tell me if thats your case).


1. Project structure

my-project/
├── settings.gradle
├── build.gradle
├── gradle/
├── gradlew
├── gradlew.bat
├── tottori-services/
│   └── build.gradle
│   └── src/main/java/...
├── app-module/
│   └── build.gradle
│   └── src/main/java/...
├── another-module/
│   └── build.gradle

2. settings.gradle (root)

This tells Gradle which modules exist.

rootProject.name = "my-project"

include(
    "tottori-services",
    "app-module",
    "another-module"
)

3. Root build.gradle

Put shared configuration here so all modules inherit it.

plugins {
    id 'java' apply false
}

subprojects {
    apply plugin: 'java'

    group = "com.example"
    version = "1.0.0"

    repositories {
        mavenCentral()
    }
}

4. tottori-services/build.gradle (IMPORTANT)

Use java-library, not just java.

This allows other modules to access its public APIs correctly.

plugins {
    id 'java-library'
}

dependencies {
    // Example:
    api 'org.apache.commons:commons-lang3:3.14.0'
}

Why java-library?

  • api → visible to modules that depend on this module
  • implementation → internal only

Anything you want other modules to see should be:

  • in src/main/java
  • public
  • declared using api if its a dependency

5. Use tottori-services in other modules

Example: app-module/build.gradle

dependencies {
    implementation project(":tottori-services")
}

Now app-module can access:

import com.example.tottori.SomeService;

as long as:

  • the class is public
  • its in tottori-services

6. Common mistake checklist

✔ Use java-library in tottori-services ✔ Use api for dependencies you want exposed ✔ Add project(":tottori-services") to every module that needs it ✘ Dont put shared code in the root project


Optional: Make it automatically available to all modules

If every module should depend on it, add this to root build.gradle:

subprojects {
    if (name != "tottori-services") {
        dependencies {
            implementation project(":tottori-services")
        }
    }
}

If you want:

  • Kotlin DSL (build.gradle.kts)
  • Android version
  • Shared test utilities
  • Publishing tottori-services as a library

just tell me 👍