← All languages

wildling

Kotlin library and CLI for pattern-based string generation. Zero third-party dependencies (Kotlin/JVM standard library only; hand-rolled JSON for templates). Targets JVM 11+.

Example

Install

From this repository:

cd kotlin
./build.sh
./bin/wildling "Year 19##"

From a release tag:

git clone --branch v2.0.0 --depth 1 https://github.com/dotmonk/wildling.git
cd wildling
./build.sh kotlin

Registry: Maven Central — io.github.dotmonk:wildling-kotlin

dependencies {
    implementation("io.github.dotmonk:wildling-kotlin:2.0.2")
}

Produces dist/wildling.jar via ./build.sh. Requires a JRE to run (java -jar), or Docker (the launcher falls back to the Temurin image if java is not on PATH).

As a library, add dist/wildling.jar to your classpath:

import wildling.Wildling

val wildling = Wildling.create(listOf("Year 19##"))
var value = wildling.next()
while (value != false) {
    println(value)
    value = wildling.next()
}

CLI

./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --template ./config.json

Help text and --check output follow docs/cli.md / docs/help.txt.

Build

./build.sh   # Docker (Temurin): fetch kotlinc if needed, kotlinc + jar → dist/wildling.jar

Project tests live in ../tests/ and are run with ../test.sh.