This page covers the packaging, distribution, and deployment mechanisms for OwnLang applications and the language runtime itself. The system provides multiple deployment options including standalone JAR distributions, cross-platform launcher scripts, Docker containerization, and code optimization through ProGuard.
For information about the build system that creates these distribution artifacts, see Gradle Build System. For details on the modular project structure that supports this distribution model, see Multi-Project Structure.
The OwnLang distribution system transforms source code through a multi-stage pipeline to create deployable artifacts:
Sources: Dockerfile1-26 proguard.properties1-49 dist/ownlang1-38 dist/ownlang.cmd1-6
The distribution system uses the Gradle Shadow plugin to create self-contained executable JARs. The main application is packaged as OwnLang.jar
containing all core dependencies, while extension modules are packaged as separate JAR files.
The Shadow plugin creates fat JARs by bundling all runtime dependencies into a single executable file. This eliminates the need for complex classpath management during deployment:
Component | JAR Output | Contents |
---|---|---|
Core Runtime | OwnLang.jar | com.annimon.ownlang.Main , parser, lexer, core libraries |
JDBC Module | modules/jdbc-*.jar | Database connectivity, JDBC drivers |
Server Module | modules/server-*.jar | Javalin web server, HTTP handling |
Socket Module | modules/socket-*.jar | Socket.io client, real-time communication |
The main entry point com.annimon.ownlang.Main
is specified in the JAR manifest, allowing direct execution via java -jar OwnLang.jar
.
Sources: Dockerfile17-20 dist/ownlang17 dist/ownlang.cmd4-5
The distribution includes platform-specific launcher scripts that handle classpath construction and JVM invocation:
The ownlang
script provides POSIX-compliant execution with Cygwin compatibility:
Key implementation details from dist/ownlang4-38:
The ownlang.cmd
batch script provides simplified execution for Windows environments:
;
) and wildcard expansion%*
modules/
and libs/
directoriesSources: dist/ownlang1-38 dist/ownlang.cmd1-6 dist/own1-2 dist/own.cmd1-2
The Docker deployment uses a multi-stage build process optimized for layer caching and minimal image size:
The Dockerfile1-26 implements a three-stage build:
shadowJar
taskThe final container includes:
/opt/ownlang
working directory with PATH configurationlibs/OwnLang.jar
(copied from desktop build output)modules/
directory with extension modulesown
and ownlang
with execute permissionsSources: Dockerfile1-26
The ProGuard configuration provides code optimization and obfuscation for production distributions:
The proguard.properties1-49 configuration includes:
Rule Category | Purpose | Configuration Lines |
---|---|---|
Keep Rules | Preserve public APIs and entry points | 13-15, 37, 40-42 |
Warning Suppression | Handle third-party library warnings | 8-11 |
Attribute Preservation | Maintain reflection compatibility | 5-6, 21-22 |
Module Interface | Preserve module loading mechanism | 37 |
keepclasseswithmembers public class * { public static void main(...); }
keep public class * implements com.annimon.ownlang.modules.Module
The configuration supports both soft and hard obfuscation:
Sources: proguard.properties1-49
The OwnLang package manager (own
command) is distributed alongside the main runtime:
The package manager leverages the same distribution mechanism as the main runtime:
OwnLang.jar
and module systemown
and own.cmd
scripts for platform compatibilitySources: dist/own1-2 dist/own.cmd1-2 ownlang-desktop/src/main/resources/scripts/listscripts.own1-7
The deployed OwnLang runtime follows a standardized directory structure:
Directory/File | Purpose | Contents |
---|---|---|
OwnLang.jar | Main executable | Core runtime, parser, standard library |
modules/ | Extension modules | JDBC, server, socket, and other optional modules |
libs/ | External dependencies | Third-party libraries (when not using Shadow JAR) |
ownlang / ownlang.cmd | Main launcher | Cross-platform execution scripts |
own / own.cmd | Package manager | Package management and project tools |
This structure supports both standalone distributions and containerized deployments while maintaining consistent module loading and classpath management across platforms.
Sources: dist/ownlang17-36 dist/ownlang.cmd4-5 Dockerfile15-24
Refresh this wiki