This document explains the modular multi-project architecture of the OwnLang build system, detailing how the codebase is organized into separate Gradle subprojects and their inter-dependencies. For information about the Gradle build configuration itself, see Gradle Build System. For details on packaging and distribution, see Distribution and Deployment.
OwnLang uses Gradle's multi-project structure to separate concerns into distinct modules. The root project coordinates build settings while individual subprojects handle specific functionality areas.
Sources: settings.gradle1-15 build.gradle1-35
The core OwnLang components follow a layered dependency structure where higher-level components depend on lower-level ones.
Sources: ownlang-desktop/build.gradle21-25 ownlang-utils/build.gradle8-10 ownlang-parser/build.gradle8-9
Extension modules use a compileOnlyApi
dependency pattern to avoid runtime coupling while maintaining compile-time access to core APIs.
Module | Build File | Key Dependencies | Shadow JAR |
---|---|---|---|
main | modules/main/build.gradle | OkHttp, JSON, SnakeYAML | No |
canvasfx | modules/canvasfx/build.gradle | JavaFX Controls & Swing | Yes |
server | modules/server/build.gradle | Javalin, SLF4J, Jackson | Yes |
socket | modules/socket/build.gradle | Socket.io Client | Yes |
jdbc | Not shown in files | Database connectivity | No |
Sources: modules/main/build.gradle8-13 modules/canvasfx/build.gradle15-16 modules/server/build.gradle9-10 modules/socket/build.gradle9-10
The root build.gradle
centralizes version management and common build settings across all subprojects.
Sources: build.gradle1-35 ownlang-core/build.gradle1-36 ownlang-desktop/build.gradle1-13
Several projects include specialized build configurations for their specific requirements.
The ownlang-core
project generates build metadata at compile time:
Sources: ownlang-core/build.gradle19-36
The ownlang-desktop
project defines custom execution tasks:
Task | Description | Arguments |
---|---|---|
runProgram | Execute sample program | -f ../program.own |
runOptimizing | Run with optimizations | -o 9 -m -a -f ../program.own |
runOptimizationDumper | Analyze optimization results | ../program.own |
ownlangExec | Base execution task | Configurable arguments |
Sources: ownlang-desktop/build.gradle35-71
The docs
project coordinates with the desktop application for documentation generation:
Sources: docs/build.gradle19-54