This repo makes the A12 Kernel buildable on a fresh machine without trial-and-error, using public sources only. It clones the required A12 repos from public GitHub, applies the small local patches needed to build the open-source mirror, and publishes the kernel + its A12 dependencies to your local Maven repository (~/.m2). Any consumer project that pins the kernel can then resolve it.
It is the canonical, project-independent bootstrap — clone it as a sibling of the A12 repos it builds, run ./bootstrap.sh, then build your consumer project.
⚠️ This bootstrap is for the JAVA side only — TypeScript support is missing. The kernel also ships a parallel TypeScript runtime (@com.mgmtp.a12.kernel/*), but it is not built or published here, and there is no patch for it. The TS packages depend on@com.mgmtp.a12.utils/*(utils/logging/localization),@com.mgmtp.a12.devtools/*, and an ANTLR fork that this kit does not set up. Wiring up the TS side (e.g. building those sibling repos and serving them from a local npm registry) is an open task (seea12-kernel/BUILD-TODO.md). Everything here produces only the kernel's Java artifacts.
./bootstrap.sh # clone (if missing) -> patch -> publish Java artifacts to mavenLocal
# then build your consumer project (the exact command is printed at the end)Re-running is safe (idempotent): present repos are skipped, an already-applied patch is detected, publishing just overwrites. Set A12_CONSUMER_DIR to your project dir to have the closing message print a ready-to-paste build command.
bootstrap.sh clones four repos from https://github.com/mgm-tp (the GITHUB_ORG_URL default). By default they sit next to this repo, under A12_ROOT (this repo's parent directory):
A12_ROOT/ # default: the parent directory of a12-kernel-bootstrap
├── a12-kernel-bootstrap/ # ← this repo (the bootstrap kit)
├── a12-kernel/ # the kernel itself — all kernel-* modules (publish stage 8)
├── a12-base/ # base model API / marshalling / utils @ 29.3.0 (publish stage 2)
├── a12-kernel-mm/ # metamodel: typings, dmjsons, validators (publish stages 4–7)
└── a12-devtools/ # the build-utilities Gradle plugin (publish stage 1)
# ... plus any consumer project (e.g. a12-kernel-demo) as another sibling
| Repo | Default location | Override env var | Provides |
|---|---|---|---|
a12-kernel |
$A12_ROOT/a12-kernel |
A12_KERNEL_DIR |
the kernel modules a consumer resolves (kernel-md-facade, …) |
a12-base |
$A12_ROOT/a12-base |
A12_BASE_DIR |
base model API / marshalling / utils, published @ 29.3.0 |
a12-kernel-mm |
$A12_ROOT/a12-kernel-mm |
A12_MM_DIR |
metamodel typings, dmjsons, and validators the kernel needs |
a12-devtools |
$A12_ROOT/a12-devtools |
A12_DEVTOOLS_DIR |
the build-utilities Gradle plugin (stub-patched here) |
Each is cloned at its default branch, which may have moved past the versions this kit pins — if the publish lands a different version, the script warns at the end (see Compatibility below). Already-present repos are skipped, so you can point any *_DIR variable at an existing checkout to reuse it instead of cloning.
- git, curl, unzip, and (for the
mmdmjsonspublish step) Node.js + npm onPATH. - JDK 21 — runs Gradle. Auto-detected on macOS via
/usr/libexec/java_home -v 21, or setJAVA21_HOME. - JDK 25 — needed only to compile
a12-devtools'sbuild-utilities(it declares a Java 25 toolchain). Auto-detected, or setJAVA25_HOME; the script warns if missing. - Gradle 9.0.0 — downloaded automatically if not provided. Do not use 9.5.1 — it can't build
a12-kernel-mm(itskotlin-dslplugin marker is unresolvable there).
Building the open-source repos from public sources needs two small, local build-time adjustments, which bootstrap.sh applies automatically. One supplies a stub for the build-utilities Gradle plugin (its src/ isn't part of the public a12-devtools export); the other makes a few version and build-configuration tweaks to a12-kernel-mm so it resolves and configures cleanly against the public model set. Both touch only the build setup — not the kernel's behaviour — and are kept in patches/ for inspection.
mm validators are generated by kernel codegen, while the kernel depends on mm — a cycle. The bootstrap breaks it by publishing to mavenLocal in this staged order (versions already match the kernel's pins, so mavenLocal resolution works):
build-utilities → a12-base@29.3.0 → kernel runtime/customfieldtype APIs → mm typings → mm dmjsons → the mm_common validator seed (built with A12_KERNEL_BOOTSTRAP_VALIDATORS_DISABLE_MM_VALIDATION=true) → remaining mm validators → all kernel modules.
gradle/public-repos.init.gradle is the isolated Gradle init (only mavenCentral() + gradlePluginPortal() + mavenLocal()), installed into an isolated GRADLE_USER_HOME so the machine's global Gradle config (which may point at a private registry) is bypassed.
All optional; defaults assume the repos are siblings of this repo.
| Variable | Default | Purpose |
|---|---|---|
A12_ROOT |
parent dir of this repo | where sibling repos live / get cloned |
A12_KERNEL_DIR / A12_BASE_DIR / A12_MM_DIR / A12_DEVTOOLS_DIR |
$A12_ROOT/<repo> |
override an individual repo location |
GITHUB_ORG_URL |
https://github.com/mgm-tp |
clone source |
KERNEL_VERSION / BASE_VERSION |
30.8.1 / 29.3.0 |
version pins the kit publishes under (override to match a different consumer) |
GRADLE_VERSION |
9.0.0 |
Gradle to download/use |
GRADLE_BIN |
(downloaded) | use an existing Gradle 9.0.0 binary |
GRADLE_DIST_DIR |
$A12_ROOT/.gradle-dist |
where Gradle is downloaded |
A12_GRADLE_USER_HOME |
$A12_ROOT/.gradle-isolated |
isolated, public-repos-only Gradle home |
JAVA21_HOME / JAVA25_HOME |
java_home -v 21 / 25 |
JDKs |
A12_CONSUMER_DIR |
(unset) | a consumer project dir, used only to print a ready-to-run build command at the end |
--skip-clone, --skip-patch, --skip-publish (run only the phases you want), --help.
This kit publishes kernel 30.8.1 and a12-base 29.3.0 by default. Because it clones each repo's default branch, a repo that has moved past these pins can publish a different version. The script checks mavenLocal at the end and warns if the published kernel-md-facade version differs from KERNEL_VERSION. If that happens: build the a12-kernel / a12-kernel-mm release matching the version you need (check out that tag/commit before running), export KERNEL_VERSION / BASE_VERSION to match, or align your consumer's pins.
- TypeScript is not built (see the banner above).
- The
kernel-md-structuralmapping/kernel-mapping-rt-facade/kernel-md-datatransfer-codegensubtree is not built — it needs an mm artifact (ct_field_type_attributes-1-a12) that the publica12-kernel-mmexport doesn't generate. The consumer-facingkernel-md-facadedoesn't depend on it.
The bootstrap script and docs in this repo are released under the MIT License — see LICENSE. The small build-time patches under patches/ (the build-utilities stub and the a12-kernel-mm tweaks) derive from mgm's A12 sources and are mgm's, licensed separately — see the upstream repositories for their terms.