Skip to content

Commit 1d63d87

Browse files
committed
docs: refresh README for example module, R8 keep-rules, and navigation
Bring the README current with recently merged work and make it easier to navigate: - Add a contents bar linking the major sections. - Point the quick start at the runnable sdk-example module so readers can run the assembled toolkit end to end with a single Gradle task. - Note the two unpublished modules (sdk-example, sdk-shrink-test) alongside the published-module table. - Document the consumer R8/ProGuard keep-rules shipped under META-INF/proguard, which downstream shrinkers inherit automatically, and list the sdk-shrink-test guard among the build's quality gates.
1 parent 109d78a commit 1d63d87

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ Written in Kotlin, targeting JDK 8 bytecode. `sdk-core` has zero runtime depende
1919

2020
Current version `0.0.1-alpha.1`. The public API is stabilising and breaking changes between alpha releases are expected. External pull requests are welcome.
2121

22+
## Contents
23+
24+
[Quick start](#quick-start) ·
25+
[Design principles](#design-principles) ·
26+
[Modules](#modules) ·
27+
[Documentation](#documentation) ·
28+
[Usage](#usage) ·
29+
[Pipeline stages](#pipeline-stages) ·
30+
[Package map](#package-map-sdk-core) ·
31+
[Shrinking with R8 / ProGuard](#shrinking-with-r8--proguard) ·
32+
[Building](#building) ·
33+
[Dependencies](#dependencies) ·
34+
[License](#license)
35+
2236
## Quick start
2337

2438
```kotlin
@@ -47,7 +61,7 @@ pipeline.send(request).use { response ->
4761
}
4862
```
4963

50-
The rest of this document covers the moving parts: transports, the async pipeline, runtime adapters, and body logging.
64+
For a complete, runnable version of this wiring — an `IoProvider`, a transport, a serde, and a full pipeline driven against an embedded server — see the `sdk-example` module and run `./gradlew :sdk-example:run`. The rest of this document covers the moving parts: transports, the async pipeline, runtime adapters, and body logging.
5165

5266
## Design principles
5367

@@ -73,6 +87,8 @@ The rest of this document covers the moving parts: transports, the async pipelin
7387

7488
Each adapter module depends on `sdk-core` and exactly one third-party library. JDK 8 or newer is the baseline, with the two exceptions in the table: `sdk-transport-jdkhttp` needs JDK 11 and `sdk-async-virtualthreads` needs JDK 21. Local builds use Gradle 9.3.1 and Kotlin 2.3.21.
7589

90+
Two further modules build but are never published: `sdk-example`, the runnable end-to-end sample above, and `sdk-shrink-test`, a test-only harness that runs R8 against a consumer of the SDK to verify the toolkit survives downstream shrinking.
91+
7692
## Documentation
7793

7894
| Document | Description |
@@ -269,6 +285,16 @@ See [docs/pipelines.md](docs/pipelines.md) for the step-author walkthrough.
269285
Token-style APIs (`next_page_token`, `pageToken`, …) are served by `CursorPaginationStrategy`:
270286
construct it with the desired query-param name, e.g. `CursorPaginationStrategy(items, extractor, "page_token")`.
271287

288+
## Shrinking with R8 / ProGuard
289+
290+
Every published jar carries its own consumer keep-rules under `META-INF/proguard/`. R8 and the
291+
Android Gradle Plugin apply rules packaged there automatically, so a downstream application that
292+
shrinks its build inherits them with no extra configuration. The rules protect the parts a shrinker
293+
cannot prove reachable on its own: the SPI seams wired at runtime (`IoProvider`, the transport
294+
clients, the serde) and the immutable HTTP models and `Tristate` that reflective serializers bind by
295+
walking constructors and Kotlin metadata. The test-only `sdk-shrink-test` module runs R8 against a
296+
consumer of the SDK on every build to keep those rules honest.
297+
272298
## Building
273299

274300
```bash
@@ -290,6 +316,7 @@ All of these break the build:
290316
- ktlint and detekt with `ignoreFailures = false`. Detekt is skipped on `sdk-async-virtualthreads` and `sdk-transport-jdkhttp`, whose JDK 21 / JDK 11 toolchains run analysis on a JDK 25 system JVM that detekt 1.23.x cannot parse; both build scripts link the upstream issue and the re-enable conditions. It runs everywhere else, including the JDK 8 transports.
291317
- `kotlinx-binary-compatibility-validator` gates the public API surface against committed `.api` snapshots.
292318
- Aggregate Kover line coverage has an 80% floor.
319+
- The `sdk-shrink-test` R8 guard, wired into `check`, fails the build if the shipped consumer keep-rules stop protecting the toolkit under shrinking. It needs a JDK 11 toolchain and fetches `com.android.tools:r8` from Google's Maven repo.
293320

294321
## Dependencies
295322

0 commit comments

Comments
 (0)