Skip to content

Commit 9a6ddd1

Browse files
authored
refactor(build): migrate to gulp (#2)
1 parent ed9b30f commit 9a6ddd1

17 files changed

Lines changed: 1731 additions & 298 deletions

.github/workflows/platform-integration-android.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ jobs:
6666
- name: Install pnpm dependencies
6767
run: mise x -- corepack pnpm install --frozen-lockfile
6868

69+
- name: Build Android AAR
70+
run: mise x -- corepack pnpm run build:android-aar
71+
6972
- name: Build integration APK
70-
run: mise x -- bash -c 'GODOT_BIN="${GODOT:-godot}" scripts/build_integration_android.sh'
73+
run: mise x -- corepack pnpm run build:integration-android
7174

7275
- name: Enable KVM
7376
run: |

.github/workflows/platform-integration-ios.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
uses: maxim-lobanov/setup-xcode@v1
4444
with:
4545
xcode-version: latest-stable
46-
46+
4747
- name: Install XcodeGen, Task, SCons and MoltenVK
4848
run: brew install xcodegen task scons molten-vk
4949

@@ -52,12 +52,12 @@ jobs:
5252
curl -LO https://github.com/godotengine/godot/archive/refs/tags/4.6.2-stable.tar.gz
5353
tar -xzf 4.6.2-stable.tar.gz
5454
mv godot-4.6.2-stable godot
55-
55+
5656
cd godot
57-
57+
5858
MOLTENVK_PATH="$(brew --prefix molten-vk)"
5959
echo "Using MoltenVK from: ${MOLTENVK_PATH}"
60-
60+
6161
scons platform=macos target=editor \
6262
vulkan_sdk_path="${MOLTENVK_PATH}" \
6363
core/version_generated.gen.h \
@@ -81,8 +81,11 @@ jobs:
8181
- name: Install pnpm dependencies
8282
run: mise x -- corepack pnpm install --frozen-lockfile
8383

84+
- name: Build iOS XCFramework
85+
run: mise x -- corepack pnpm run build:ios-xcframework
86+
8487
- name: Build integration App
85-
run: mise x -- bash -c 'GODOT_BIN="${GODOT:-godot}" scripts/build_integration_ios.sh'
88+
run: mise x -- corepack pnpm run build:integration-ios
8689

8790
- name: Start iOS Simulator
8891
run: |
@@ -96,7 +99,7 @@ jobs:
9699
- name: Run integration tests
97100
run: |
98101
xcrun simctl install $SIMULATOR_ID dist/integration/ios_debug.app
99-
102+
100103
scripts/run_integration_ios_test.sh ipc_round_trip_probe
101104
scripts/run_integration_ios_test.sh webview_lifecycle_probe
102105
scripts/run_integration_ios_test.sh res_asset_loading_probe

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
node_modules/
88
dist/
99
build/
10+
godot/
1011
*.apk
1112
*.aab
1213
*.aar
13-
!packages/kirie/addon/addons/kirie/libraries/android/Kirie-debug.aar
1414
*.xcframework
1515

1616
.build_version

AGENTS.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ higher-level work.
3333
the first runnable manual integration target
3434
- `tests/integration`
3535
exported-app platform bridge regression target
36+
- `gulpfile.ts`
37+
native artifact and integration export orchestration
3638
- `scripts`
37-
local build and run helpers for Android and iOS validation
39+
local run helpers for Android and iOS validation
3840
- `.codex/skills`
3941
repo-local Codex skills for project maintenance workflows
4042
- `docs`
@@ -84,22 +86,19 @@ is a standard Godot plugin:
8486

8587
- users consume `addons/kirie`
8688
- Android binaries are exported through `EditorExportPlugin`
87-
- during bring-up, local `.aar` files under the addon are acceptable because the
88-
current Android bridge does not require Kirie-owned Maven-delivered runtime
89-
dependencies
9089
- Maven-based Android delivery can be revisited if Kirie gains Android
9190
dependencies that need Gradle metadata or transitive resolution
9291

9392
When producing a downloadable addon tree, ensure Android `.aar` files are real
94-
files in the generated output, not repository-local symlinks into Gradle build
93+
files in the staged output, not repository-local symlinks into Gradle build
9594
directories.
9695

9796
## iOS Packaging Direction
9897

9998
For the current milestone, iOS should be owned by the standard addon tree:
10099

101100
- users consume `addons/kirie`
102-
- `Kirie.xcframework` belongs under `addons/kirie/ios` in produced addon trees
101+
- `Kirie.xcframework` belongs under `addons/kirie/ios` in staged addon trees
103102
- iOS native pieces are injected through `EditorExportPlugin` Apple export hooks
104103
- do not reintroduce `res://ios/plugins` or `.gdip` shims unless the export hook
105104
approach fails and the user explicitly chooses that fallback
@@ -132,6 +131,20 @@ For the current milestone, iOS should be owned by the standard addon tree:
132131
tool workaround.
133132
- Keep Gradle wrapper and Xcode usage as-is; mise only provides the Java runtime
134133
and command-line tools around them.
134+
- Start command invocations with the fewest necessary flags and options. Add
135+
extra flags only after the project or user has a concrete need for them.
136+
- Native artifact orchestration lives in `gulpfile.ts`. Use
137+
`mise x -- corepack pnpm run build:android-aar`,
138+
`mise x -- corepack pnpm run build:ios-xcframework`, or
139+
`mise x -- corepack pnpm run build:native-artifacts` instead of adding new
140+
shell-only orchestration for the same artifact path.
141+
- Integration export orchestration also lives in `gulpfile.ts`. Use
142+
`mise x -- corepack pnpm run build:integration-android` or
143+
`mise x -- corepack pnpm run build:integration-ios` instead of adding new
144+
integration build shell scripts.
145+
- Keep `gulpfile.ts` executable by Node's built-in TypeScript type stripping:
146+
use erasable TypeScript syntax only and do not add `ts-node`, `tsx`, or other
147+
TypeScript runtime loaders unless a real non-erasable TypeScript need appears.
135148

136149
## Engineering Rules
137150

@@ -164,6 +177,9 @@ configured yet.
164177
- Do not wrap platform APIs with thin pass-through helpers unless the wrapper
165178
actually stabilizes the Godot-facing API, hides a platform difference, or
166179
creates a meaningful test seam.
180+
- Do not add extra guard code only to beautify errors. Prefer the underlying
181+
tool, runtime, or filesystem error unless the guard changes behavior or makes
182+
a likely failure materially easier to debug.
167183
- Prefer keeping logic close to the module that owns it instead of extracting it
168184
into cross-cutting helpers too early.
169185
- Add configuration, extension points, and generic options only when they are
@@ -199,11 +215,12 @@ configured yet.
199215
`mise x -- corepack pnpm run format:swift`.
200216
- When changing Android bridge code, validate the Godot-to-native-to-web path as
201217
soon as practical.
218+
- After changing Android native code under `packages/kirie/native/android`,
219+
run `mise x -- corepack pnpm run build:android-aar` before exported-app tests.
202220
- When changing iOS bridge code, validate the Godot-to-native-to-web path as
203221
soon as practical.
204222
- After changing iOS native code under `packages/kirie/native/ios`, always run
205-
`scripts/build_kirie_ios.sh` so `addons/kirie/ios/Kirie.xcframework` is
206-
refreshed before any device testing.
223+
`mise x -- corepack pnpm run build:ios-xcframework` before device testing.
207224
- When changing the IPC shape, make sure at least one real request/response
208225
round-trip remains covered by the example or integration tests.
209226
- When changing `KirieClient`, compile it against the Godot .NET SDK. A platform
@@ -234,11 +251,12 @@ configured yet.
234251
### Binary artifacts
235252

236253
- Avoid committing build outputs by default.
237-
- Do not commit `.aar`, `.xcframework`, exported app bundles, or similar binary
238-
artifacts unless the repository intentionally adopts them as source-distributed
239-
plugin assets.
240-
- If the repository starts tracking a binary artifact class intentionally, add
241-
the rule explicitly here.
254+
- `.aar`, `.xcframework`, exported app bundles, and similar binaries are release
255+
staging artifacts in this repository. Generate them into the addon tree or
256+
release staging tree when needed, but do not commit them.
257+
- If the repository intentionally adopts a binary artifact class as
258+
source-distributed plugin assets later, add the exception explicitly here and
259+
update `.gitignore` in the same change.
242260

243261
### Logging and lifecycle
244262

@@ -261,5 +279,3 @@ infrastructure.
261279
not exist yet.
262280
- Richer app-level adapters or invocation APIs above `@gd-kirie/ipc` are not
263281
implemented yet.
264-
- Source tracking policy is not finalized yet for generated binary artifacts
265-
such as local `.aar` files and `.xcframework` bundles.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ example, and regression-test areas:
2424
- `packages/ipc`: a thin browser-side transport wrapper for Kirie WebView pages
2525
- `examples/basic-ipc`: the first runnable manual integration example
2626
- `tests/integration`: exported-app platform integration tests
27-
- `scripts`: local build and run helpers for native validation
27+
- `gulpfile.ts`: native artifact and integration export orchestration
28+
- `scripts`: local run helpers for native validation
2829
- `docs`: project notes and design decisions
2930
- `docs/dreams`: exploratory notes for ideas outside the current milestone
3031

docs/platform-integration-tests.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,16 @@ bridge assertion.
162162

163163
## Android Local Flow
164164

165+
Build the staged Android addon AAR first:
166+
167+
```bash
168+
mise x -- corepack pnpm run build:android-aar
169+
```
170+
165171
Build the test APK:
166172

167173
```bash
168-
scripts/build_integration_android.sh
174+
mise x -- corepack pnpm run build:integration-android
169175
```
170176

171177
Install it once:
@@ -212,18 +218,34 @@ Tests are isolated by app session:
212218
This avoids residual WebView, JavaScript, singleton, signal, and cache state
213219
without exporting a separate APK for every test.
214220

215-
## CI Direction
221+
## iOS Local Flow
222+
223+
Build the staged iOS addon XCFramework first:
224+
225+
```bash
226+
mise x -- corepack pnpm run build:ios-xcframework
227+
```
228+
229+
Build the simulator app:
216230

217-
The intended GitHub Actions shape is:
231+
```bash
232+
mise x -- corepack pnpm run build:integration-ios
233+
```
234+
235+
Install and run tests with the simulator helper:
236+
237+
```bash
238+
scripts/run_integration_ios_test.sh ipc_round_trip_probe
239+
```
240+
241+
The iOS XCFramework and simulator app tasks expect the Godot source checkout at
242+
repo-root `godot/`.
243+
244+
## CI Direction
218245

219-
- set up Node and Java with `jdx/mise-action`
220-
- set up Godot and export templates with `chickensoft-games/setup-godot`
221-
- install pnpm dependencies
222-
- build the Android AAR
223-
- export `tests/integration` as an Android APK
224-
- start an emulator with `reactivecircus/android-emulator-runner`
225-
- install the APK once
226-
- run each test through `scripts/run_integration_android_test.sh`
246+
The CI flows live in `.github/workflows/platform-integration-android.yml` and
247+
`.github/workflows/platform-integration-ios.yml`. They build the native staging
248+
artifacts before exporting the integration project.
227249

228250
CI should reuse the same marker contract and app-session isolation used
229251
locally.

docs/references.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ packaging, or platform WebView bridge details.
7878

7979
## JavaScript packaging
8080

81+
- [Node.js TypeScript support](https://nodejs.org/api/typescript.html)
82+
Reference for Node's built-in TypeScript type stripping and erasable syntax
83+
constraints used by the repository `gulpfile.ts`.
84+
- [Gulp creating tasks](https://gulpjs.com/docs/en/getting-started/creating-tasks/)
85+
Reference for exported Gulp task functions and task composition.
86+
- [Execa](https://github.com/sindresorhus/execa)
87+
Reference for programmatic process execution from the repository task runner.
8188
- [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/)
8289
Reference for publishing npm packages from GitHub Actions through OIDC instead
8390
of long-lived npm tokens.
@@ -102,3 +109,5 @@ packaging, or platform WebView bridge details.
102109
support, C# signals, and .NET reflection or AOT documentation.
103110
- When changing npm package publishing, start with npm trusted publishing,
104111
GitHub Actions OIDC, bumpp, and pnpm publish behavior.
112+
- When changing native artifact orchestration, start with Node.js TypeScript
113+
support and the Gulp task composition references.

0 commit comments

Comments
 (0)