Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(build): the native build finds the four headers that moved

yhha94ea76cbaf4
diff --git a/build-tools/tasks/native.js b/build-tools/tasks/native.js
index c704e242e..4b9ef3dd4 100644
--- a/build-tools/tasks/native.js
+++ b/build-tools/tasks/native.js
@@ -65,11 +65,13 @@ export const ENGINE_BINDING_HEADERS = [
'MaterialBindings.hpp',
];
+// Paths are relative to src/esengine/bindings — a side module's sources sit
+// together under modules/<name>/, so the entry is a path, not a bare filename.
export const MODULE_BINDING_HEADERS = [
- 'PhysicsBindings.hpp',
- 'VideoBindings.hpp',
- 'SpineBindings.hpp',
- 'DragonBonesBindings.hpp',
+ 'modules/physics/PhysicsBindings.hpp',
+ 'modules/video/VideoBindings.hpp',
+ 'modules/spine/SpineBindings.hpp',
+ 'modules/dragonbones/DragonBonesBindings.hpp',
];
export const NATIVE_BINDING_HEADERS = [...ENGINE_BINDING_HEADERS, ...MODULE_BINDING_HEADERS];
diff --git a/sdk/tests/binding-surface.test.ts b/sdk/tests/binding-surface.test.ts
index 7961fc92c..11dc207df 100644
--- a/sdk/tests/binding-surface.test.ts
+++ b/sdk/tests/binding-surface.test.ts
@@ -356,6 +356,18 @@ describe('WASM binding surface: side modules (C exports)', () => {
.toEqual([]);
});
+ // The device build reads this list to generate its QuickJS wrappers, and it is
+ // the only consumer — so a header that moves takes ~17 minutes of Dawn build to
+ // report itself, at release time, on the one workflow that compiles for a phone.
+ // v0.36.0's release failed exactly here, four headers behind a reorganisation.
+ it('every binding header the native build lists is where it says it is', async () => {
+ const { NATIVE_BINDING_HEADERS } = await import('../../build-tools/tasks/native.js');
+ const missing = (NATIVE_BINDING_HEADERS as string[])
+ .filter((h) => !existsSync(resolve(CPP, 'bindings', h)));
+ expect(missing, `listed in build-tools/tasks/native.js but absent: ${missing.join(', ')}`)
+ .toEqual([]);
+ });
+
// Exported for the NATIVE side only, so no SDK caller names them: which spine
// runtime a host linked (the web names the artifact instead — spine38 / 41 / 42)
// and how much the event buffer published, which a native wrapper needs to copy