You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: README.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,20 @@ Written in Kotlin, targeting JDK 8 bytecode. `sdk-core` has zero runtime depende
19
19
20
20
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.
21
21
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) ·
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.
51
65
52
66
## Design principles
53
67
@@ -73,6 +87,8 @@ The rest of this document covers the moving parts: transports, the async pipelin
73
87
74
88
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.
75
89
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
+
76
92
## Documentation
77
93
78
94
| Document | Description |
@@ -269,6 +285,16 @@ See [docs/pipelines.md](docs/pipelines.md) for the step-author walkthrough.
269
285
Token-style APIs (`next_page_token`, `pageToken`, …) are served by `CursorPaginationStrategy`:
270
286
construct it with the desired query-param name, e.g. `CursorPaginationStrategy(items, extractor, "page_token")`.
271
287
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
+
272
298
## Building
273
299
274
300
```bash
@@ -290,6 +316,7 @@ All of these break the build:
290
316
- 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.
291
317
-`kotlinx-binary-compatibility-validator` gates the public API surface against committed `.api` snapshots.
292
318
- 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.
0 commit comments