Skip to content

Commit 50c2ce0

Browse files
stepangoClaw
andauthored
F-105: design Kotlin Multiplatform targets for Forma Gradle (#214)
Add docs/KMP-TARGETS.md (tools.forma.kmp, kmp-* types, jvm+android v1, type-owned MPP, closed matrix) and P11 tickets F-106–F-110. Update VISION, ARCHITECTURE, README, PROGRESS. Co-authored-by: Claw <claw@Claws-MacBook-Pro.local>
1 parent a656ad3 commit 50c2ce0

6 files changed

Lines changed: 475 additions & 13 deletions

File tree

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ systems like Buck and Bazel.
5757
8. [forma-core public API design](docs/forma-core-api.md) — extraction contract for types / restrictions / registry (F-020)
5858
9. [JVM targets](docs/JVM-TARGETS.md) — pure JVM platform plugin `tools.forma.jvm` (F-030)
5959
10. [JVM sample application](docs/JVM-SAMPLE.md) — multi-module pure-JVM gold standard (`jvm-application/`, F-031)
60-
11. [Bazel adapter design](docs/BAZEL-ADAPTER.md) — target types to rules, restriction graph to visibility (F-040 design)
61-
12. [Bazel adapter spike](bazel-adapter/README.md) — generate/check BUILD from Forma model (F-041; JVM-first)
62-
13. [Bazel sample (experimental)](bazel-sample/) — minimal `kt_jvm_*` workspace exercising forma-core matrix + `impl``impl` (F-042)
63-
14. [**Progressive examples + agent skills**](docs/PROGRESSIVE-EXAMPLES.md) — feature-by-feature ladders (`examples/`) + coding-agent skills (F-050)
64-
15. [**Test coverage**](docs/TEST-COVERAGE.md) — JaCoCo on `plugins/`, happy-path LINE ≥60% gate
60+
11. [**Kotlin Multiplatform design**](docs/KMP-TARGETS.md)`tools.forma.kmp` types, matrix, no call-site target shopping (F-105; implement F-106…F-110)
61+
12. [Bazel adapter design](docs/BAZEL-ADAPTER.md) — target types to rules, restriction graph to visibility (F-040 design)
62+
13. [Bazel adapter spike](bazel-adapter/README.md) — generate/check BUILD from Forma model (F-041; JVM-first)
63+
14. [Bazel sample (experimental)](bazel-sample/) — minimal `kt_jvm_*` workspace exercising forma-core matrix + `impl``impl` (F-042)
64+
15. [**Progressive examples + agent skills**](docs/PROGRESSIVE-EXAMPLES.md) — feature-by-feature ladders (`examples/`) + coding-agent skills (F-050)
65+
16. [**Test coverage**](docs/TEST-COVERAGE.md) — JaCoCo on `plugins/`, happy-path LINE ≥60% gate
6566

6667
Configuration made easy:
6768

TICKETS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,22 @@ worker (ops); `v2`→`master` (explicit git promote only). **F-094** stays `bloc
146146
| F-103 | todo | Hybrid targets example (flat dir / api+impl co-location) | GH **#44** — teaching example: simplified flat layout (api/impl/stub mental model, easy multi-module nav). May use includer layout + progressive example; align with F-084/F-088 fleet layout. No restore of `androidLibrary`. |
147147
| F-104 | todo | Hybrid configuration / stub targets for IDE sync | GH **#43** — stub targets + deps API so IDE sync can swap `impl``stub` (compileOnly/runtimeOnly pattern) via **one project-global flag**, not per-module hacks. Design+spike; depend on F-101/`target` APIs. Keep matrix truth. |
148148

149+
## P11 — Kotlin Multiplatform (Stepan 2026-07-25)
150+
151+
Third Gradle platform on forma-core (`tools.forma.kmp`). **Design:** [`docs/KMP-TARGETS.md`](docs/KMP-TARGETS.md).
152+
**User priority (2026-07-25):** implement **F-106** next (before F-100…F-104) unless a hotfix blocks.
153+
v1 = **jvm + android** shared libraries only; type-owned MPP; **no** per-module target shopping;
154+
composition stays at Android/JVM roots. iOS/JS/Wasm = later phase.
155+
156+
| ID | Status | Title | Notes |
157+
|----|--------|-------|-------|
158+
| F-105 | done | Design KMP targets + matrix + plugin shape | `docs/KMP-TARGETS.md` — types `kmp-api`/`kmp-library`/`kmp-util`/`kmp-test-util`; `kmpProjectConfiguration`; rejected free-form `kotlin { targets }`; VISION/ARCHITECTURE/README pointers |
159+
| F-106 | todo | `:kmp` plugin skeleton + `KmpTargetRegistry` matrix tests | Module `plugins/kmp`, plugin id `tools.forma.kmp`, types + `registerKmpDefaults`, unit tests; no half-working public DSL until F-107 |
160+
| F-107 | todo | Apply kotlin-multiplatform + `kmpLibrary` DSL | Feature applicator jvm+android; deps via commonMain path; spike Android KMP library plugin id under AGP 9.3; `kmpProjectConfiguration` |
161+
| F-108 | todo | Android/JVM consumer matrix edges → kmp.* | Extend `AndroidTargetRegistry` + `JvmTargetRegistry`; update `DEPENDENCY-MATRIX.md` from code; avoid `:kmp``:android` cycle |
162+
| F-109 | todo | Progressive example `examples/kmp/01-shared-library` | Shared `kmp-library` + JVM (and optional Android) consumer; green documented Gradle tasks |
163+
| F-110 | todo | KMP user docs + agent skill + curriculum | `KMP-GETTING-STARTED.md`, `examples/agent-skills/forma-kmp-targets.md`, PROGRESSIVE-EXAMPLES ladder, README |
164+
149165
## Backlog (lower priority / historical GitHub)
150166

151167
Keep for reference; do not start unless higher tickets done or user prioritizes:

docs/ARCHITECTURE.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ that compose via `includeBuild`:
6161

6262
- `pluginManagement { includeBuild("../build-settings") }`
6363
- `tools.forma.includer` **0.2.0** from Portal (not local includer composite)
64-
- Includer discovers `:android`, `:config`, `:core`, `:deps`, `:jvm`, `:owners`, `:target`, `:validation` (F-021 `:core`; F-030 `:jvm`)
64+
- Includer discovers `:android`, `:config`, `:core`, `:deps`, `:jvm`, `:owners`, `:target`, `:validation` (F-021 `:core`; F-030 `:jvm`); **`:kmp` planned F-106** (F-105 design)
6565

6666
---
6767

@@ -91,12 +91,12 @@ Group/version (root `plugins/build.gradle.kts`): **`tools.forma` / `0.1.3`**.
9191
│ │ │
9292
└─────┬─────┴────────────┘
9393
94-
┌──────────────────────┐
95-
│ │
96-
┌─────┴─────┐ ┌─────┴─────┐
97-
│ android │ jvm │ F-030 pure JVM DSL + JvmTargetRegistry
98-
│ DSL+AGP │ no AGP │ (parallel platform consumer of core)
99-
└───────────┘ └───────────┘
94+
┌───────────┼───────────────────┐
95+
96+
┌─────┴─────┐ ┌───┴────┐ ┌─────┴─────┐
97+
│ android │ │ jvm kmp │ F-105 design; F-106+ module
98+
│ DSL+AGP │ │ no AGP │ MPP DSL │ (tools.forma.kmp)
99+
└───────────┘ └────────┘ └───────────┘
100100
```
101101

102102
| Module | Plugin id | Depends on | Responsibility |
@@ -109,6 +109,7 @@ Group/version (root `plugins/build.gradle.kts`): **`tools.forma` / `0.1.3`**.
109109
| `:deps` | `tools.forma.deps` | `:core`, `:validation`, `:target`, `:config`, kotlin-dsl | `FormaDependency` model, `applyDependencies`, version-catalog generators |
110110
| `:android` | `tools.forma.android` | `:core` + all of the above + **AGP** + Kotlin GP | Target DSL; `AndroidTargetTypes` + `AndroidRestrictionKit` (F-021); content helpers call core `ContentRule` (F-022) |
111111
| `:jvm` | `tools.forma.jvm` | `:core`, `:deps`, `:validation`, `:target`, `:owners` + Kotlin GP (**no AGP**) | Pure JVM DSL (`api`/`impl`/`library`/`util`/`testUtil` in package `tools.forma.jvm`); `JvmTargetTypes` + `JvmTargetRegistry` (F-030) |
112+
| `:kmp` | `tools.forma.kmp` | `:core`, `:deps`, `:validation`, `:target`, `:owners` + Kotlin MPP GP (**no** hard dep on `:android`; AGP coords as needed for androidTarget) | **Planned F-106+** — KMP DSL (`kmpLibrary` / `kmpApi` / …); `KmpTargetTypes` + `KmpTargetRegistry`; design [`KMP-TARGETS.md`](KMP-TARGETS.md) (F-105) |
112113

113114
`:android` compiles against **AGP 9.3.0** (aligned with sample
114115
`androidProjectConfiguration(agpVersion = …)` — F-018 / #182). Keep

0 commit comments

Comments
 (0)