Menu

Multi-Project Structure

Relevant source files

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.

Project Organization

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

Core Component Dependencies

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

Module System Architecture

Extension modules use a compileOnlyApi dependency pattern to avoid runtime coupling while maintaining compile-time access to core APIs.

ModuleBuild FileKey DependenciesShadow JAR
mainmodules/main/build.gradleOkHttp, JSON, SnakeYAMLNo
canvasfxmodules/canvasfx/build.gradleJavaFX Controls & SwingYes
servermodules/server/build.gradleJavalin, SLF4J, JacksonYes
socketmodules/socket/build.gradleSocket.io ClientYes
jdbcNot shown in filesDatabase connectivityNo

Sources: modules/main/build.gradle8-13 modules/canvasfx/build.gradle15-16 modules/server/build.gradle9-10 modules/socket/build.gradle9-10

Build Configuration Management

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

Specialized Build Features

Several projects include specialized build configurations for their specific requirements.

Generated Sources

The ownlang-core project generates build metadata at compile time:

Sources: ownlang-core/build.gradle19-36

Application Tasks

The ownlang-desktop project defines custom execution tasks:

TaskDescriptionArguments
runProgramExecute sample program-f ../program.own
runOptimizingRun with optimizations-o 9 -m -a -f ../program.own
runOptimizationDumperAnalyze optimization results../program.own
ownlangExecBase execution taskConfigurable arguments

Sources: ownlang-desktop/build.gradle35-71

Documentation Integration

The docs project coordinates with the desktop application for documentation generation:

Sources: docs/build.gradle19-54