Skip to content

Commit 3e6d983

Browse files
authored
Consume capture-runtime 0.1.0 from Maven Central (#52)
* Depend on Maven Central capture-runtime for Flutter Android builds. Local and published plugin builds resolve com.gettugboat.sdk:capture-runtime instead of compiling platforms/android or stubbing native capture. * Open a Flutter pin PR after capture-runtime reaches Maven Central. Keep the plugin pin from racing unpublished AARs: CI rejects a newer pin than VERSION_NAME, and a post-publish job waits for repo1 before bumping Flutter.
1 parent d50d5ee commit 3e6d983

27 files changed

Lines changed: 399 additions & 209 deletions

.github/workflows/publish-android.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# 1. On push to main, creates tag capture-runtime-v<version> when that version
55
# is not already on GitHub Packages (or Maven Central, once configured).
66
# 2. On that tag (push or workflow_dispatch), publishes the AAR.
7+
# 3. After a tag publish, waits for Maven Central repo1 then opens a Flutter
8+
# pin PR (chore/pin-capture-runtime-<version>) if the plugin still lags.
79
#
810
# GitHub Packages is the default hosted registry (GITHUB_TOKEN). Maven Central
911
# is optional until namespace + secrets exist; see docs/releases/process.md.
@@ -182,3 +184,21 @@ jobs:
182184
exit 0
183185
fi
184186
./gradlew :capture-runtime:publishAndReleaseToMavenCentral -Ptugboat.publishMavenCentral=true
187+
188+
pin_flutter:
189+
if: startsWith(github.ref, 'refs/tags/capture-runtime-v')
190+
needs: publish
191+
runs-on: ubuntu-latest
192+
permissions:
193+
contents: write
194+
pull-requests: write
195+
steps:
196+
- name: Checkout
197+
uses: actions/checkout@v4
198+
with:
199+
fetch-depth: 0
200+
token: ${{ secrets.GITHUB_TOKEN }}
201+
- name: Open Flutter pin PR
202+
env:
203+
GH_TOKEN: ${{ github.token }}
204+
run: bash tool/ci/open-flutter-runtime-pin-pr.sh

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ The Tugboat CLI is maintained separately.
2424
| `docs/` | Architecture, integration, privacy, performance, releases |
2525
| `tool/ci` | Host test, generate, and release-control scripts |
2626

27-
Do not copy the C++ core into the published pub package. In this monorepo the
28-
Flutter plugin compiles Android and Apple runtimes from `platforms/` (and
29-
`core/`) when those trees resolve. Published pub consumers get a stub HostApi
30-
that reports unsupported native capture and keep the default Flutter backend.
27+
Do not copy the C++ core into the published pub package. The Flutter Android
28+
plugin depends on Maven Central `com.gettugboat.sdk:capture-runtime`. Apple
29+
native capture still compiles `platforms/apple` sources in the monorepo;
30+
published pub checkouts without that tree stub iOS native capture.
3131

3232
## Capture backends
3333

@@ -63,10 +63,10 @@ bash tool/ci/build-android-runtime.sh
6363
bash tool/ci/run-flutter-tests.sh
6464
```
6565

66-
Native Android apps consume the AAR from untracked `.local-maven/` after
67-
`bash tool/ci/build-android-runtime.sh`, or from GitHub Packages after a
68-
`capture-runtime-v*` tag. The Flutter plugin compiles
69-
`platforms/android/capture-runtime` from source in the monorepo.
66+
Native Android apps consume the AAR from Maven Central
67+
(`com.gettugboat.sdk:capture-runtime:0.1.0`), or from untracked `.local-maven/`
68+
after `bash tool/ci/build-android-runtime.sh`. The Flutter plugin uses the
69+
Maven Central coordinate and does not compile `platforms/android` from source.
7070

7171
## Development
7272

docs/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ gates, canaries) are not listed below.
5858

5959
## Current compatibility
6060

61-
- package version: `0.8.13` (`0.8.x` patch after published `0.8.12`);
62-
- native runtime: `capture-runtime` `0.1.0` (GitHub Packages on
63-
`capture-runtime-v*`; Flutter still compiles from monorepo sources);
64-
- planned first native-capable adapter: Flutter `0.9.0` after privacy and performance gates;
61+
- package version: `0.8.14` (`0.8.x` patch; Android plugin uses Maven Central
62+
`capture-runtime` `0.1.0`);
63+
- native runtime: `capture-runtime` `0.1.0` on Maven Central;
64+
- planned first native-default adapter: Flutter `0.9.0` after privacy and performance gates;
6565
- session JSON schema: `10`;
6666
- fingerprint schema: `6`;
6767
- minimum Dart SDK: `3.9.2`;

docs/architecture/repository-map.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ package references sources under `platforms/apple` and
1919
`core/image-processing`.
2020

2121
Do not copy the C++ core into the published pub package. Files above a
22-
published pub archive are not part of that archive. In this monorepo the
23-
Flutter plugin compiles Android and Apple runtime sources when those trees
24-
resolve. Published pub archives omit those trees and stub native capture as
25-
unsupported. Native Android apps consume the local Maven AAR or the hosted
26-
GitHub Packages / Maven Central coordinate; native Apple apps still use the
27-
root CocoaPod / SwiftPM package.
22+
published pub archive are not part of that archive. The Flutter Android
23+
plugin depends on Maven Central `com.gettugboat.sdk:capture-runtime`. The
24+
iOS plugin compiles Apple runtime sources when `platforms/apple` resolves;
25+
published pub archives omit that tree and stub iOS native capture.
26+
Native Android apps consume Maven Central or the local Maven AAR; native
27+
Apple apps still use the root CocoaPod / SwiftPM package.
2828

2929
Ownership rules: [repository-scope.md](repository-scope.md).
3030
Build commands: [common-build.md](../integration/common-build.md).

docs/architecture/repository-scope.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ In scope:
6262
- Return only masked JPEG bytes and bounded metadata
6363
- Local Maven publication for the native Android sample
6464
- Hosted GitHub Packages publication on `capture-runtime-v*` tags
65+
- Maven Central `com.gettugboat.sdk:capture-runtime` for Flutter and native apps
6566

6667
Capture scale stays Dart-owned. The adapter sends the bitmap width and
6768
height that the current capturer would have used. The runtime serializes
@@ -85,9 +86,10 @@ older OS versions report `unsupportedApi` and Flutter falls back.
8586

8687
## Flutter adapter scope
8788

88-
`package:tugboat` stays the public Dart API. First native-capable version is
89-
planned as `0.9.0`. This Phase 0/1 line is `0.8.13` and does not enable
90-
native capture.
89+
`package:tugboat` stays the public Dart API. Native Android capture is
90+
available as an opt-in on `0.8.14` via Maven Central `capture-runtime`
91+
`0.1.0`. This line does not enable native capture by default; `0.9.0` is
92+
still the planned native-default adapter.
9193

9294
In scope for the Android and Apple CPU betas:
9395

@@ -97,9 +99,9 @@ In scope for the Android and Apple CPU betas:
9799
- Send mask metadata and previous dHash; receive masked JPEG only
98100
- Automatic fallback; never publish native and Flutter results for one request
99101
- Preserve session schema, frame transport, scheduling, and mask policy
100-
- Android: the Flutter plugin compiles `capture-runtime` from source in the
101-
monorepo. Native Android apps use the local Maven AAR or the hosted
102-
GitHub Packages / Maven Central coordinate. iOS: the
102+
- Android: the Flutter plugin depends on Maven Central
103+
`com.gettugboat.sdk:capture-runtime:0.1.0`. Native Android apps use the
104+
same coordinate, or `.local-maven` for unpublished runtime work. iOS: the
103105
plugin compiles `TugboatCaptureRuntime` sources; the root CocoaPod remains
104106
for native Apple apps.
105107

docs/integration/android-development.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ python3 tool/ci/dump-android-runtime-api.py > platforms/android/capture-runtime/
2828
Hosted publication (GitHub Packages, then Maven Central) is documented in
2929
[release process](../releases/process.md).
3030

31-
The Flutter plugin at `sdks/flutter/packages/tugboat/android` compiles
32-
`CaptureRuntime` from this source tree (no unpublished Maven coordinate) and
33-
wraps it behind the Pigeon `NativeCaptureHostApi`. Published pub checkouts
34-
without `platforms/android` stub native capture as unsupported. Do not log
35-
pixel or JPEG data.
31+
The Flutter plugin at `sdks/flutter/packages/tugboat/android` depends on
32+
Maven Central `com.gettugboat.sdk:capture-runtime:0.1.0` and wraps it behind
33+
the Pigeon `NativeCaptureHostApi`. Changing `CaptureRuntime` for a Flutter
34+
build requires publishing a new AAR version and bumping that coordinate.
35+
Do not log pixel or JPEG data.

docs/integration/common-build.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ bash tool/ci/run-flutter-tests.sh
1010
bash tool/ci/verify-native-capture-pigeon.sh
1111
```
1212

13-
The Android AAR publishes to untracked `.local-maven/` for native Android
14-
apps and the sample. Hosted GitHub Packages / Maven Central publication is
15-
documented in [process.md](../releases/process.md). The Flutter plugin
16-
compiles `capture-runtime` from source when `platforms/android` is present,
17-
so example APKs do not need that Maven artifact.
13+
The Android AAR publishes to untracked `.local-maven/` for the standalone
14+
native sample. Hosted Maven Central publication is documented in
15+
[process.md](../releases/process.md). The Flutter plugin depends on
16+
`com.gettugboat.sdk:capture-runtime:0.1.0` from Maven Central.
1817

1918
Release-control scripts (also run in CI):
2019

docs/integration/flutter-development.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ outputs.
2020

2121
Screenshot pixels still default to `RepaintBoundary`. Enable native CPU
2222
capture only through
23-
`TugboatScreenshotCaptureBackend.nativeCpuExperimental`. In the monorepo the
24-
Flutter plugin compiles the Android and Apple runtimes from source. It does
25-
not depend on unpublished Maven or CocoaPods artifacts. Published pub
26-
consumers get a stub that reports native capture unsupported. See
23+
`TugboatScreenshotCaptureBackend.nativeCpuExperimental`. In the monorepo and
24+
on pub.dev, the Android plugin depends on Maven Central
25+
`com.gettugboat.sdk:capture-runtime:0.1.0`. The iOS plugin still compiles
26+
`TugboatCaptureRuntime` from source when `platforms/apple` is present;
27+
published pub checkouts stub iOS native capture. See
2728
[native-cpu-experimental.md](native-cpu-experimental.md) and
2829
[apple-development.md](apple-development.md).
2930

docs/releases/compatibility.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
| Adapter | Adapter version | Native runtime |
44
| --- | --- | --- |
5+
| Flutter `tugboat` | 0.8.14 | Android `com.gettugboat.sdk:capture-runtime:0.1.0` from Maven Central. Apple `TugboatCaptureRuntime` 0.1.x compiled from monorepo sources (unpublished CocoaPod is not required). Plugin iOS floor 12; native capture still reports unsupported below iOS 15. |
56
| Flutter `tugboat` | 0.8.13 | Android `capture-runtime` 0.1.x compiled from monorepo sources (hosted Maven is not required). Apple `TugboatCaptureRuntime` 0.1.x compiled from monorepo sources (unpublished CocoaPod is not required). Plugin iOS floor 12; native capture still reports unsupported below iOS 15. |
67
| Flutter `tugboat` | 0.8.12 | none (Flutter `flutterRepaintBoundary` only; session identity stamp patch) |
78
| Flutter `tugboat` | 0.9.0 (planned) | Android `capture-runtime` 0.1.x and Apple `TugboatCaptureRuntime` 0.1.x |
89
| Apple `TugboatCaptureRuntime` | 0.1.0 | unpublished local CocoaPod / SwiftPM; iOS 15 live Flutter-layer CPU path |
910
| `@tugboat/react-native` || not started |
1011

11-
The first tagged pair after gates pass will be Flutter `v0.9.0` with
12-
`capture-runtime-v0.1.0` on Maven Central. Until then native capture stays
13-
opt-in and the Flutter package remains on the 0.8.x line. Do not publish
14-
Apple `0.1.0`. GitHub Packages can host `capture-runtime` `0.1.0` for native
15-
Android apps before Central verification completes.
12+
Flutter `0.8.14` consumes `capture-runtime` `0.1.0` from Maven Central.
13+
Native capture stays opt-in. Do not publish Apple `0.1.0`. The first
14+
native-default adapter is still planned as Flutter `0.9.0`.
1615

1716
CI requires this table to change whenever Flutter adapter source or the
1817
public Android/C ABI or Apple Swift surface changes

docs/releases/process.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ docs procedure.
2727
- Flutter adapter source (`lib/`, `android/`, `ios/`, `pigeons/`, `pubspec.yaml`)
2828
bumps `tugboat` and updates this compatibility table.
2929
- A runtime public API change that adapters consume also updates the table.
30+
- The Flutter plugin's `capture-runtime` Maven pin must not be newer than
31+
`VERSION_NAME`. Changing the pin requires it to equal `VERSION_NAME`.
32+
Runtime-only PRs may leave the pin lagging until Central has the new AAR.
3033

3134
## pub.dev (Flutter 0.8.x)
3235

@@ -74,10 +77,26 @@ dependencies {
7477
}
7578
```
7679

77-
The Flutter plugin still compiles `platforms/android/capture-runtime` from
78-
source in the monorepo and stubs native capture in published pub archives.
79-
Do not point the plugin at GitHub Packages; pub.dev hosts cannot supply
80-
GitHub credentials.
80+
The Flutter plugin depends on Maven Central
81+
`com.gettugboat.sdk:capture-runtime:0.1.0`. Do not point it at GitHub
82+
Packages; pub.dev hosts cannot supply GitHub credentials. iOS native capture
83+
still compiles from monorepo sources and stubs in published pub archives.
84+
85+
### Two-merge sequence for a new AAR
86+
87+
1. Runtime PR: bump `VERSION_NAME` (for example `0.1.1`) and merge. Wait until
88+
`publish-android.yml` has put that version on Maven Central (repo1 POM
89+
returns 200).
90+
2. Flutter PR: pin
91+
`implementation("com.gettugboat.sdk:capture-runtime:<that version>")`,
92+
bump `tugboat` / `tugboat_dio`, and merge. That publishes to pub.dev.
93+
94+
Do not merge a Flutter pin for a version that is not on repo1 yet. After a
95+
`capture-runtime-v*` tag publish, `publish-android.yml` waits for repo1 and
96+
opens `chore/pin-capture-runtime-<version>` when the plugin still lags. That
97+
job is a no-op if the pin already matches `VERSION_NAME` or the branch/PR
98+
already exists. Recovery: re-run **Publish Android runtime** on the tag.
99+
The repository must allow GitHub Actions to create pull requests.
81100

82101
### Maven Central (public hosts)
83102

@@ -99,7 +118,8 @@ Required before the Flutter plugin can depend on the AAR from pub.dev.
99118

100119
## After native gates pass
101120

102-
1. Confirm `capture-runtime` `0.1.0` is on Maven Central.
103-
2. Point the Flutter plugin at the published coordinate.
104-
3. Bump Flutter to `0.9.0`, keep native capture opt-in.
121+
1. Confirm `capture-runtime` `0.1.0` is on Maven Central (done for 0.8.14).
122+
2. Point the Flutter plugin at the published coordinate (done in 0.8.14).
123+
3. Bump Flutter to `0.9.0`, keep native capture opt-in until gates pass, then
124+
consider making native capture the default.
105125
4. Tag `v0.9.0` (same pattern as 0.8.x) so GitHub Actions publishes the pub packages.

0 commit comments

Comments
 (0)