@preeternal/react-native-godot 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/Package.swift +106 -0
- package/README.md +590 -2
- package/android/build.gradle +291 -0
- package/android/consumer-rules.pro +20 -0
- package/android/fix-prefab.gradle +54 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/CMakeLists.txt +78 -0
- package/android/src/main/cpp/GodotModule.cpp +764 -0
- package/android/src/main/cpp/OnLoad.cpp +66 -0
- package/android/src/main/cpp/libgodot_android.h +73 -0
- package/android/src/main/cpp/libgodot_jni.cpp +658 -0
- package/android/src/main/cpp/libgodot_jni.h +116 -0
- package/android/src/main/cpp/native_godot_module_jni.cpp +86 -0
- package/android/src/main/cpp/native_godot_module_jni.h +58 -0
- package/android/src/main/java/com/preeternal/reactnativegodot/NativeGodotModuleModule.kt +83 -0
- package/android/src/main/java/com/preeternal/reactnativegodot/NativeGodotModulePackage.kt +41 -0
- package/android/src/main/java/com/preeternal/reactnativegodot/NativeLibraryLoader.kt +5 -0
- package/android/src/main/java/com/preeternal/reactnativegodot/RTNGodotIO.kt +123 -0
- package/android/src/main/java/com/preeternal/reactnativegodot/RTNGodotView.kt +92 -0
- package/android/src/main/java/com/preeternal/reactnativegodot/RTNGodotViewManager.kt +34 -0
- package/android/src/main/java/com/preeternal/reactnativegodot/RTNLibGodot.kt +215 -0
- package/android/src/main/res/layout/downloading_expansion.xml +165 -0
- package/android/src/main/res/layout/godot_app_layout.xml +5 -0
- package/android/src/main/res/layout/snackbar.xml +27 -0
- package/android/src/main/res/layout/status_bar_ongoing_event_progress_bar.xml +108 -0
- package/android/src/main/res/mipmap/icon.png +0 -0
- package/android/src/main/res/mipmap/icon_background.png +0 -0
- package/android/src/main/res/mipmap/icon_foreground.png +0 -0
- package/android/src/main/res/mipmap/icon_monochrome.png +0 -0
- package/android/src/main/res/mipmap-anydpi-v26/icon.xml +8 -0
- package/android/src/main/res/mipmap-anydpi-v26/themed_icon.xml +11 -0
- package/android/src/main/res/mipmap-hdpi/icon.png +0 -0
- package/android/src/main/res/mipmap-hdpi/icon_background.png +0 -0
- package/android/src/main/res/mipmap-hdpi/icon_foreground.png +0 -0
- package/android/src/main/res/mipmap-hdpi/icon_monochrome.png +0 -0
- package/android/src/main/res/mipmap-mdpi/icon.png +0 -0
- package/android/src/main/res/mipmap-mdpi/icon_background.png +0 -0
- package/android/src/main/res/mipmap-mdpi/icon_foreground.png +0 -0
- package/android/src/main/res/mipmap-mdpi/icon_monochrome.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/icon.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/icon_background.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/icon_foreground.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/icon_monochrome.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/icon.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/icon_background.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/icon_foreground.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/icon_monochrome.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/icon.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/icon_background.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/icon_foreground.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/icon_monochrome.png +0 -0
- package/android/src/main/res/values/dimens.xml +9 -0
- package/android/src/main/res/values/strings.xml +61 -0
- package/android/src/main/res/values/styles.xml +25 -0
- package/android/src/main/res/values-fa/strings.xml +14 -0
- package/android/src/main/res/values-ko/strings.xml +54 -0
- package/android/src/main/res/xml/godot_provider_paths.xml +15 -0
- package/android/src/test/java/com/preeternal/reactnativegodot/NativeGodotModulePackageTest.kt +26 -0
- package/app.plugin.js +169 -0
- package/cpp/AppleRendererPolicy.h +95 -0
- package/cpp/GodotModule.h +126 -0
- package/cpp/LibGodotABI.h +52 -0
- package/cpp/NativeGodotModule.cpp +825 -0
- package/cpp/NativeGodotModule.h +45 -0
- package/cpp/godot-log.h +64 -0
- package/ios/GodotModule.mm +695 -0
- package/ios/NativeGodotModuleProvider.h +35 -0
- package/ios/NativeGodotModuleProvider.mm +42 -0
- package/ios/RTNGodotView.h +42 -0
- package/ios/RTNGodotView.mm +671 -0
- package/ios/log.mm +38 -0
- package/lib/module/NativeNativeGodotModule.js +59 -0
- package/lib/module/NativeNativeGodotModule.js.map +1 -0
- package/lib/module/RTNGodotView.js +6 -0
- package/lib/module/RTNGodotView.js.map +1 -0
- package/lib/module/RTNGodotView.native.js +5 -0
- package/lib/module/RTNGodotView.native.js.map +1 -0
- package/lib/module/RTNGodotViewNativeComponent.ts +37 -0
- package/lib/module/index.js +30 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeNativeGodotModule.d.ts +26 -0
- package/lib/typescript/src/NativeNativeGodotModule.d.ts.map +1 -0
- package/lib/typescript/src/RTNGodotView.d.ts +7 -0
- package/lib/typescript/src/RTNGodotView.d.ts.map +1 -0
- package/lib/typescript/src/RTNGodotView.native.d.ts +3 -0
- package/lib/typescript/src/RTNGodotView.native.d.ts.map +1 -0
- package/lib/typescript/src/RTNGodotViewNativeComponent.d.ts +11 -0
- package/lib/typescript/src/RTNGodotViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +282 -4
- package/prebuilt-utils.rb +46 -0
- package/react-native-godot.podspec +41 -0
- package/react-native.config.js +16 -0
- package/scripts/check-16kb.sh +136 -0
- package/scripts/check-packaged-artifacts.sh +156 -0
- package/scripts/ci/verify-ios-simulator.py +48 -0
- package/scripts/ci/verify-prebuilt-install.cjs +41 -0
- package/scripts/download-prebuilt.js +283 -0
- package/scripts/prebuilt-config.js +80 -0
- package/scripts/spm-autolinking-plugin.js +87 -0
- package/src/NativeNativeGodotModule.ts +90 -0
- package/src/RTNGodotView.native.tsx +2 -0
- package/src/RTNGodotView.tsx +12 -0
- package/src/RTNGodotViewNativeComponent.ts +37 -0
- package/src/index.tsx +28 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**************************************************************************/
|
|
4
|
+
/* NativeGodotModule.ts */
|
|
5
|
+
/**************************************************************************/
|
|
6
|
+
/* Copyright (c) 2024-2025 Slay GmbH */
|
|
7
|
+
/* */
|
|
8
|
+
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
9
|
+
/* a copy of this software and associated documentation files (the */
|
|
10
|
+
/* "Software"), to deal in the Software without restriction, including */
|
|
11
|
+
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
12
|
+
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
13
|
+
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
14
|
+
/* the following conditions: */
|
|
15
|
+
/* */
|
|
16
|
+
/* The above copyright notice and this permission notice shall be */
|
|
17
|
+
/* included in all copies or substantial portions of the Software. */
|
|
18
|
+
/* */
|
|
19
|
+
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
20
|
+
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
21
|
+
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
|
|
22
|
+
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
23
|
+
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
24
|
+
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
25
|
+
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
26
|
+
/**************************************************************************/
|
|
27
|
+
|
|
28
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
29
|
+
import { createWorkletRuntime, runOnRuntimeAsync } from 'react-native-worklets';
|
|
30
|
+
const GodotInstaller = TurboModuleRegistry.get('NativeGodotModule');
|
|
31
|
+
if (globalThis.RTNGodot == null) {
|
|
32
|
+
if (GodotInstaller == null) {
|
|
33
|
+
console.error('Native Godot Module cannot be found! Make sure you correctly ' + 'installed native dependencies and rebuilt your app.');
|
|
34
|
+
} else if (!GodotInstaller.installTurboModule()) {
|
|
35
|
+
console.error('NativeGodotModule installation failed.');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const installedGodotModule = globalThis.RTNGodot;
|
|
39
|
+
if (installedGodotModule != null && globalThis.__godotWorkletRuntime == null) {
|
|
40
|
+
const godotQueue = installedGodotModule.createGodotQueue();
|
|
41
|
+
globalThis.__godotWorkletRuntime = createWorkletRuntime({
|
|
42
|
+
name: 'ReactNativeGodot',
|
|
43
|
+
queue: godotQueue,
|
|
44
|
+
initializer: () => {
|
|
45
|
+
'worklet';
|
|
46
|
+
|
|
47
|
+
globalThis.RTNGodot = installedGodotModule;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
export const RTNGodot = globalThis.RTNGodot;
|
|
52
|
+
export function runOnGodotThread(f) {
|
|
53
|
+
const runtime = globalThis.__godotWorkletRuntime;
|
|
54
|
+
if (runtime == null) {
|
|
55
|
+
return Promise.reject(new Error('NativeGodotModule worklet runtime is not installed'));
|
|
56
|
+
}
|
|
57
|
+
return runOnRuntimeAsync(runtime, f);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=NativeNativeGodotModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","createWorkletRuntime","runOnRuntimeAsync","GodotInstaller","get","globalThis","RTNGodot","console","error","installTurboModule","installedGodotModule","__godotWorkletRuntime","godotQueue","createGodotQueue","name","queue","initializer","runOnGodotThread","f","runtime","Promise","reject","Error"],"sourceRoot":"../../src","sources":["NativeNativeGodotModule.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAA0B,cAAc;AACpE,SACEC,oBAAoB,EACpBC,iBAAiB,QAEZ,uBAAuB;AAM9B,MAAMC,cAAc,GAAGH,mBAAmB,CAACI,GAAG,CAAO,mBAAmB,CAAC;AAmBzE,IAAIC,UAAU,CAACC,QAAQ,IAAI,IAAI,EAAE;EAC/B,IAAIH,cAAc,IAAI,IAAI,EAAE;IAC1BI,OAAO,CAACC,KAAK,CACX,+DAA+D,GAC7D,qDACJ,CAAC;EACH,CAAC,MAAM,IAAI,CAACL,cAAc,CAACM,kBAAkB,CAAC,CAAC,EAAE;IAC/CF,OAAO,CAACC,KAAK,CAAC,wCAAwC,CAAC;EACzD;AACF;AAEA,MAAME,oBAAoB,GAAGL,UAAU,CAACC,QAAQ;AAChD,IAAII,oBAAoB,IAAI,IAAI,IAAIL,UAAU,CAACM,qBAAqB,IAAI,IAAI,EAAE;EAC5E,MAAMC,UAAU,GAAGF,oBAAoB,CAACG,gBAAgB,CAAC,CAAC;EAC1DR,UAAU,CAACM,qBAAqB,GAAGV,oBAAoB,CAAC;IACtDa,IAAI,EAAE,kBAAkB;IACxBC,KAAK,EAAEH,UAAU;IACjBI,WAAW,EAAEA,CAAA,KAAM;MACjB,SAAS;;MACTX,UAAU,CAACC,QAAQ,GAAGI,oBAAoB;IAC5C;EACF,CAAC,CAAC;AACJ;AAEA,OAAO,MAAMJ,QAAQ,GAAGD,UAAU,CAACC,QAAgC;AAEnE,OAAO,SAASW,gBAAgBA,CAAIC,CAAU,EAAc;EAC1D,MAAMC,OAAO,GAAGd,UAAU,CAACM,qBAAqB;EAChD,IAAIQ,OAAO,IAAI,IAAI,EAAE;IACnB,OAAOC,OAAO,CAACC,MAAM,CACnB,IAAIC,KAAK,CAAC,oDAAoD,CAChE,CAAC;EACH;EACA,OAAOpB,iBAAiB,CAACiB,OAAO,EAAED,CAAC,CAAC;AACtC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RTNGodotView","_props","Error"],"sourceRoot":"../../src","sources":["RTNGodotView.tsx"],"mappings":";;AAOA,OAAO,SAASA,YAAYA,CAACC,MAAyB,EAAS;EAC7D,MAAM,IAAIC,KAAK,CACb,yEACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["default","RTNGodotView"],"sourceRoot":"../../src","sources":["RTNGodotView.native.tsx"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,YAAY,QAAQ,+BAA+B;AACvE,cAAc,+BAA+B","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**************************************************************************/
|
|
2
|
+
/* RTNGodotViewNativeComponent.ts */
|
|
3
|
+
/**************************************************************************/
|
|
4
|
+
/* Copyright (c) 2024-2025 Slay GmbH */
|
|
5
|
+
/* */
|
|
6
|
+
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
7
|
+
/* a copy of this software and associated documentation files (the */
|
|
8
|
+
/* "Software"), to deal in the Software without restriction, including */
|
|
9
|
+
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
10
|
+
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
11
|
+
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
12
|
+
/* the following conditions: */
|
|
13
|
+
/* */
|
|
14
|
+
/* The above copyright notice and this permission notice shall be */
|
|
15
|
+
/* included in all copies or substantial portions of the Software. */
|
|
16
|
+
/* */
|
|
17
|
+
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
18
|
+
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
19
|
+
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
|
|
20
|
+
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
21
|
+
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
22
|
+
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
23
|
+
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
24
|
+
/**************************************************************************/
|
|
25
|
+
|
|
26
|
+
import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
|
|
27
|
+
|
|
28
|
+
import { codegenNativeComponent } from 'react-native';
|
|
29
|
+
|
|
30
|
+
export interface NativeProps extends ViewProps {
|
|
31
|
+
windowName?: string;
|
|
32
|
+
onSurfaceReady?: CodegenTypes.DirectEventHandler<Readonly<{}>>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default codegenNativeComponent<NativeProps>(
|
|
36
|
+
'RTNGodotView'
|
|
37
|
+
) as HostComponent<NativeProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**************************************************************************/
|
|
4
|
+
/* index.ts */
|
|
5
|
+
/**************************************************************************/
|
|
6
|
+
/* Copyright (c) 2024-2025 Slay GmbH */
|
|
7
|
+
/* */
|
|
8
|
+
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
9
|
+
/* a copy of this software and associated documentation files (the */
|
|
10
|
+
/* "Software"), to deal in the Software without restriction, including */
|
|
11
|
+
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
12
|
+
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
13
|
+
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
14
|
+
/* the following conditions: */
|
|
15
|
+
/* */
|
|
16
|
+
/* The above copyright notice and this permission notice shall be */
|
|
17
|
+
/* included in all copies or substantial portions of the Software. */
|
|
18
|
+
/* */
|
|
19
|
+
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
20
|
+
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
21
|
+
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
|
|
22
|
+
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
23
|
+
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
24
|
+
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
25
|
+
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
26
|
+
/**************************************************************************/
|
|
27
|
+
|
|
28
|
+
export { RTNGodot, runOnGodotThread } from "./NativeNativeGodotModule.js";
|
|
29
|
+
export { RTNGodotView } from './RTNGodotView';
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RTNGodot","runOnGodotThread","RTNGodotView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,gBAAgB,QAAQ,8BAA2B;AAEtE,SAASC,YAAY,QAAQ,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**************************************************************************/
|
|
2
|
+
/**************************************************************************/
|
|
3
|
+
/**************************************************************************/
|
|
4
|
+
import { type TurboModule } from 'react-native';
|
|
5
|
+
import { type WorkletRuntime } from 'react-native-worklets';
|
|
6
|
+
export interface Spec extends TurboModule {
|
|
7
|
+
installTurboModule(): boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface GodotModuleInterface {
|
|
10
|
+
createInstance(args: Array<string>): any;
|
|
11
|
+
getInstance(): any;
|
|
12
|
+
API(): any;
|
|
13
|
+
updateWindow(windowName: string, adding: boolean): void;
|
|
14
|
+
pause(): void;
|
|
15
|
+
resume(): void;
|
|
16
|
+
is_paused(): boolean;
|
|
17
|
+
createGodotQueue(): object;
|
|
18
|
+
destroyInstance(): void;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
var RTNGodot: GodotModuleInterface | undefined;
|
|
22
|
+
var __godotWorkletRuntime: WorkletRuntime | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare const RTNGodot: GodotModuleInterface;
|
|
25
|
+
export declare function runOnGodotThread<T>(f: () => T): Promise<T>;
|
|
26
|
+
//# sourceMappingURL=NativeNativeGodotModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeNativeGodotModule.d.ts","sourceRoot":"","sources":["../../../src/NativeNativeGodotModule.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,4EAA4E;AAqB5E,4EAA4E;AAE5E,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,kBAAkB,IAAI,OAAO,CAAC;CAC/B;AAID,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;IACzC,WAAW,IAAI,GAAG,CAAC;IACnB,GAAG,IAAI,GAAG,CAAC;IACX,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACxD,KAAK,IAAI,IAAI,CAAC;IACd,MAAM,IAAI,IAAI,CAAC;IACf,SAAS,IAAI,OAAO,CAAC;IACrB,gBAAgB,IAAI,MAAM,CAAC;IAC3B,eAAe,IAAI,IAAI,CAAC;CACzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,QAAQ,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC/C,IAAI,qBAAqB,EAAE,cAAc,GAAG,SAAS,CAAC;CACvD;AA0BD,eAAO,MAAM,QAAQ,EAA0B,oBAAoB,CAAC;AAEpE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAQ1D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
export type RTNGodotViewProps = ViewProps & {
|
|
3
|
+
windowName?: string;
|
|
4
|
+
onSurfaceReady?: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function RTNGodotView(_props: RTNGodotViewProps): never;
|
|
7
|
+
//# sourceMappingURL=RTNGodotView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTNGodotView.d.ts","sourceRoot":"","sources":["../../../src/RTNGodotView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,wBAAgB,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,KAAK,CAI7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTNGodotView.native.d.ts","sourceRoot":"","sources":["../../../src/RTNGodotView.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**************************************************************************/
|
|
2
|
+
/**************************************************************************/
|
|
3
|
+
/**************************************************************************/
|
|
4
|
+
import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
|
|
5
|
+
export interface NativeProps extends ViewProps {
|
|
6
|
+
windowName?: string;
|
|
7
|
+
onSurfaceReady?: CodegenTypes.DirectEventHandler<Readonly<{}>>;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: HostComponent<NativeProps>;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=RTNGodotViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTNGodotViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/RTNGodotViewNativeComponent.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,4EAA4E;AAqB5E,4EAA4E;AAE5E,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI3E,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;CAChE;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**************************************************************************/
|
|
2
|
+
/**************************************************************************/
|
|
3
|
+
/**************************************************************************/
|
|
4
|
+
export { RTNGodot, runOnGodotThread } from './NativeNativeGodotModule.js';
|
|
5
|
+
export { RTNGodotView } from './RTNGodotView';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,4EAA4E;AAqB5E,4EAA4E;AAE5E,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,8BAA2B,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,284 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@preeternal/react-native-godot",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Embed Godot into React Native apps",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"preeternal-react-native-godot-source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./app.plugin.js": "./app.plugin.js",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"src",
|
|
18
|
+
"lib",
|
|
19
|
+
"cpp",
|
|
20
|
+
"android",
|
|
21
|
+
"ios",
|
|
22
|
+
"scripts",
|
|
23
|
+
"app.plugin.js",
|
|
24
|
+
"react-native-godot.podspec",
|
|
25
|
+
"Package.swift",
|
|
26
|
+
"prebuilt-utils.rb",
|
|
27
|
+
"react-native.config.js",
|
|
28
|
+
"!lib/typescript/example",
|
|
29
|
+
"!ios/libs",
|
|
30
|
+
"!ios/build",
|
|
31
|
+
"!android/libs",
|
|
32
|
+
"!android/build",
|
|
33
|
+
"!android/gradle",
|
|
34
|
+
"!android/gradlew",
|
|
35
|
+
"!android/gradlew.bat",
|
|
36
|
+
"!android/local.properties",
|
|
37
|
+
"!**/__tests__",
|
|
38
|
+
"!**/__fixtures__",
|
|
39
|
+
"!**/__mocks__",
|
|
40
|
+
"!**/.*"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"example": "yarn workspace @preeternal/react-native-godot-example",
|
|
44
|
+
"android": "yarn workspace @preeternal/react-native-godot-example android",
|
|
45
|
+
"ios": "yarn workspace @preeternal/react-native-godot-example ios",
|
|
46
|
+
"start": "yarn workspace @preeternal/react-native-godot-example start",
|
|
47
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
48
|
+
"prepare": "bob build",
|
|
49
|
+
"postinstall": "node scripts/download-prebuilt.js",
|
|
50
|
+
"download-prebuilt": "node scripts/download-prebuilt.js",
|
|
51
|
+
"check:packaged-artifacts": "bash scripts/check-packaged-artifacts.sh",
|
|
52
|
+
"typecheck": "tsc",
|
|
53
|
+
"test": "node --test scripts/__tests__/*.test.cjs && jest --passWithNoTests",
|
|
54
|
+
"release": "release-it --only-version",
|
|
55
|
+
"lint": "eslint \"**/*.{js,cjs,mjs,ts,tsx}\""
|
|
56
|
+
},
|
|
57
|
+
"keywords": [
|
|
58
|
+
"react-native",
|
|
59
|
+
"ios",
|
|
60
|
+
"android"
|
|
61
|
+
],
|
|
62
|
+
"repository": {
|
|
63
|
+
"type": "git",
|
|
64
|
+
"url": "git+https://github.com/Preeternal/react-native-godot.git"
|
|
65
|
+
},
|
|
66
|
+
"author": "Preeternal <preeternal@gmail.com> (https://github.com/Preeternal)",
|
|
67
|
+
"license": "MIT",
|
|
68
|
+
"bugs": {
|
|
69
|
+
"url": "https://github.com/Preeternal/react-native-godot/issues"
|
|
70
|
+
},
|
|
71
|
+
"homepage": "https://github.com/Preeternal/react-native-godot#readme",
|
|
72
|
+
"publishConfig": {
|
|
73
|
+
"registry": "https://registry.npmjs.org/",
|
|
74
|
+
"access": "public"
|
|
75
|
+
},
|
|
76
|
+
"npm": {
|
|
77
|
+
"versionArgs": [
|
|
78
|
+
"--allow-same-version",
|
|
79
|
+
"--workspaces-update=false"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"@commitlint/cli": "^21.2.4",
|
|
84
|
+
"@commitlint/config-conventional": "^21.2.4",
|
|
85
|
+
"@eslint/compat": "^2.1.1",
|
|
86
|
+
"@eslint/eslintrc": "^3.3.7",
|
|
87
|
+
"@eslint/js": "^9.39.5",
|
|
88
|
+
"@jest/globals": "^29.7.0",
|
|
89
|
+
"@react-native/babel-preset": "0.88.0",
|
|
90
|
+
"@react-native/eslint-config": "0.88.0",
|
|
91
|
+
"@react-native/jest-preset": "0.88.0",
|
|
92
|
+
"@release-it/conventional-changelog": "^12.0.2",
|
|
93
|
+
"@types/react": "^19.2.0",
|
|
94
|
+
"del-cli": "^8.0.1",
|
|
95
|
+
"eslint": "^9.39.5",
|
|
96
|
+
"eslint-config-prettier": "^10.1.8",
|
|
97
|
+
"eslint-plugin-ft-flow": "^3.0.11",
|
|
98
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
99
|
+
"jest": "^29.7.0",
|
|
100
|
+
"lefthook": "^2.2.2",
|
|
101
|
+
"prettier": "^3.9.10",
|
|
102
|
+
"react": "19.3.0",
|
|
103
|
+
"react-native": "0.88.0",
|
|
104
|
+
"react-native-builder-bob": "^0.44.1",
|
|
105
|
+
"react-native-worklets": "patch:react-native-worklets@npm%3A0.13.1#~/.yarn/patches/react-native-worklets-npm-0.13.1-3a63e554a7.patch",
|
|
106
|
+
"release-it": "^21.1.1",
|
|
107
|
+
"turbo": "^2.11.10",
|
|
108
|
+
"typescript": "^6.0.3"
|
|
109
|
+
},
|
|
110
|
+
"peerDependencies": {
|
|
111
|
+
"react": "*",
|
|
112
|
+
"react-native": "*",
|
|
113
|
+
"react-native-worklets": ">=0.13.0 <0.14.0"
|
|
114
|
+
},
|
|
115
|
+
"codegenConfig": {
|
|
116
|
+
"name": "RTNGodotSpec",
|
|
117
|
+
"type": "all",
|
|
118
|
+
"jsSrcsDir": "src",
|
|
119
|
+
"android": {
|
|
120
|
+
"javaPackageName": "com.preeternal.reactnativegodot"
|
|
121
|
+
},
|
|
122
|
+
"ios": {
|
|
123
|
+
"modulesProvider": {
|
|
124
|
+
"NativeGodotModule": "NativeGodotModuleProvider"
|
|
125
|
+
},
|
|
126
|
+
"components": {
|
|
127
|
+
"RTNGodotView": {
|
|
128
|
+
"className": "RTNGodotView"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"jest": {
|
|
134
|
+
"preset": "@react-native/jest-preset",
|
|
135
|
+
"testEnvironmentOptions": {
|
|
136
|
+
"customExportConditions": [
|
|
137
|
+
"require",
|
|
138
|
+
"react-native",
|
|
139
|
+
"preeternal-react-native-godot-source"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"transformIgnorePatterns": [
|
|
143
|
+
"node_modules/(?!((jest-)?react-native|@react-native(-community)?|@react-navigation/.*|react-native-worklets)/)"
|
|
144
|
+
],
|
|
145
|
+
"modulePathIgnorePatterns": [
|
|
146
|
+
"<rootDir>/example/node_modules",
|
|
147
|
+
"<rootDir>/lib/"
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"prebuiltFiles": [
|
|
151
|
+
{
|
|
152
|
+
"name": "libgodot",
|
|
153
|
+
"filename": "libgodot-no-record.xcframework.zip",
|
|
154
|
+
"version": "4.7.2.preeternal.2",
|
|
155
|
+
"base_url": "https://github.com/Preeternal/libgodot/releases/download/",
|
|
156
|
+
"shasum": "e088cbbf952bc073ec79748239c6fb10284b587158794de9cb3a2d59587b9239",
|
|
157
|
+
"destination_base_dir": "ios/libs",
|
|
158
|
+
"env": "LIBGODOT_XCFRAMEWORK_PATH",
|
|
159
|
+
"no_unpack": "false",
|
|
160
|
+
"with_recording": {
|
|
161
|
+
"filename": "libgodot.xcframework.zip",
|
|
162
|
+
"version": "4.7.2.preeternal.1",
|
|
163
|
+
"shasum": "6bbf51634153ad9206352e36d069cbdf4e8a2a63e11e828a73b38e9a6adc5de5"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "libgodot-cpp",
|
|
168
|
+
"filename": "libgodot-cpp.xcframework.zip",
|
|
169
|
+
"version": "4.7.2.preeternal.2",
|
|
170
|
+
"base_url": "https://github.com/Preeternal/libgodot/releases/download/",
|
|
171
|
+
"shasum": "06454281ae25121d086dded03c88037568152e0c97ccaea2d97c6f6cb1567a4b",
|
|
172
|
+
"destination_base_dir": "ios/libs",
|
|
173
|
+
"env": "LIBGODOT_CPP_XCFRAMEWORK_PATH",
|
|
174
|
+
"no_unpack": "false",
|
|
175
|
+
"with_recording": {
|
|
176
|
+
"version": "4.7.2.preeternal.1",
|
|
177
|
+
"shasum": "a6a7f0737c9cd5eb981098fe253f794df27aafd14835f6889da3536de92d550e"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "libgodot-android",
|
|
182
|
+
"filename": "libgodot-android-no-record.zip",
|
|
183
|
+
"version": "4.7.2.preeternal.2",
|
|
184
|
+
"base_url": "https://github.com/Preeternal/libgodot/releases/download/",
|
|
185
|
+
"shasum": "409d6395bd60b68c9b42e5695d41f21a6dd8c618ecb671edd00b978c706fb3a1",
|
|
186
|
+
"destination_base_dir": "android/libs",
|
|
187
|
+
"env": "LIBGODOT_ANDROID_PATH",
|
|
188
|
+
"no_unpack": "false",
|
|
189
|
+
"maven_version": "4.7.2.preeternal.2",
|
|
190
|
+
"with_recording": {
|
|
191
|
+
"filename": "libgodot-android.zip",
|
|
192
|
+
"version": "4.7.2.preeternal.1",
|
|
193
|
+
"shasum": "e5b94be7fe7f74ce2f147f90ccb2c28a972a91638734d6518807593c15d2c7db",
|
|
194
|
+
"maven_version": "4.7.2.preeternal.1-SNAPSHOT"
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "libgodot-cpp-android",
|
|
199
|
+
"filename": "godot-cpp-android.zip",
|
|
200
|
+
"version": "4.7.2.preeternal.2",
|
|
201
|
+
"base_url": "https://github.com/Preeternal/libgodot/releases/download/",
|
|
202
|
+
"shasum": "f8a596f023b65eabf0afb0b88f699d5ac52ca301a6e61e6ca8e1db1d681d2c48",
|
|
203
|
+
"destination_base_dir": "android/libs",
|
|
204
|
+
"env": "LIBGODOT_CPP_ANDROID_PATH",
|
|
205
|
+
"no_unpack": "false",
|
|
206
|
+
"with_recording": {
|
|
207
|
+
"version": "4.7.2.preeternal.1",
|
|
208
|
+
"shasum": "90966d0add089ebffe3baa3f4ea918d329e22fbc0b1a3c267d3c7ef7476f41cc"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"react-native-builder-bob": {
|
|
213
|
+
"source": "src",
|
|
214
|
+
"output": "lib",
|
|
215
|
+
"targets": [
|
|
216
|
+
[
|
|
217
|
+
"module",
|
|
218
|
+
{
|
|
219
|
+
"esm": true
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
[
|
|
223
|
+
"typescript",
|
|
224
|
+
{
|
|
225
|
+
"project": "tsconfig.build.json"
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
"workspaces": [
|
|
231
|
+
"example"
|
|
232
|
+
],
|
|
233
|
+
"engines": {
|
|
234
|
+
"node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >=25.0.0"
|
|
235
|
+
},
|
|
236
|
+
"packageManager": "yarn@4.18.1+sha512.b2e1e7524f654f2749d32b4ebcb4622473cb5bcbc485df2007e12a154e50162a4d795526768bc5f5b8f81717bfd79deb2472813d86fb5ae2eb551fa9c872b08f",
|
|
237
|
+
"commitlint": {
|
|
238
|
+
"extends": [
|
|
239
|
+
"@commitlint/config-conventional"
|
|
240
|
+
]
|
|
241
|
+
},
|
|
242
|
+
"dependenciesMeta": {
|
|
243
|
+
"lefthook": {
|
|
244
|
+
"built": true
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"release-it": {
|
|
248
|
+
"git": {
|
|
249
|
+
"commitMessage": "chore: release ${version}",
|
|
250
|
+
"tagName": "v${version}"
|
|
251
|
+
},
|
|
252
|
+
"npm": {
|
|
253
|
+
"publish": true
|
|
254
|
+
},
|
|
255
|
+
"github": {
|
|
256
|
+
"release": true
|
|
257
|
+
},
|
|
258
|
+
"plugins": {
|
|
259
|
+
"@release-it/conventional-changelog": {
|
|
260
|
+
"preset": {
|
|
261
|
+
"name": "angular"
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"create-react-native-library": {
|
|
267
|
+
"type": "turbo-module",
|
|
268
|
+
"languages": "kotlin-objc",
|
|
269
|
+
"tools": [
|
|
270
|
+
"jest",
|
|
271
|
+
"lefthook",
|
|
272
|
+
"release-it",
|
|
273
|
+
"eslint"
|
|
274
|
+
],
|
|
275
|
+
"version": "0.64.0"
|
|
276
|
+
},
|
|
277
|
+
"prettier": {
|
|
278
|
+
"quoteProps": "consistent",
|
|
279
|
+
"singleQuote": true,
|
|
280
|
+
"tabWidth": 2,
|
|
281
|
+
"trailingComma": "es5",
|
|
282
|
+
"useTabs": false
|
|
283
|
+
}
|
|
284
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
require "fileutils"
|
|
3
|
+
require "open3"
|
|
4
|
+
|
|
5
|
+
# ----------------------------------------------------------------------
|
|
6
|
+
# Helper: Returns the relative path to the pre‑built library directory.
|
|
7
|
+
#
|
|
8
|
+
# Parameters:
|
|
9
|
+
# lib_name (String) – The `name` field from an entry in the
|
|
10
|
+
# `prebuiltFiles` array of package.json.
|
|
11
|
+
#
|
|
12
|
+
# Returns:
|
|
13
|
+
# String – Relative path to the directory that contains the
|
|
14
|
+
# pre‑built framework for the given library, i.e.:
|
|
15
|
+
# <destination_base_dir>/<name>/<version>
|
|
16
|
+
#
|
|
17
|
+
# The function looks up the matching entry in `prebuiltFiles` and
|
|
18
|
+
# builds the path using its `destination_base_dir` and `version`.
|
|
19
|
+
# ----------------------------------------------------------------------
|
|
20
|
+
def prebuilt_path(lib_name)
|
|
21
|
+
# Load package.json (assumes this file lives in the same directory as the podspec)
|
|
22
|
+
package_path = File.join(__dir__, "package.json")
|
|
23
|
+
unless File.file?(package_path)
|
|
24
|
+
raise "Unable to locate package.json at #{package_path}"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
app_root = if defined?(Pod::Config)
|
|
28
|
+
Pod::Config.instance.installation_root.to_s
|
|
29
|
+
else
|
|
30
|
+
Dir.pwd
|
|
31
|
+
end
|
|
32
|
+
node = ENV.fetch("NODE_BINARY", "node")
|
|
33
|
+
output, error, status = Open3.capture3(
|
|
34
|
+
node, File.join(__dir__, "scripts/prebuilt-config.js"), "--app-root", app_root
|
|
35
|
+
)
|
|
36
|
+
raise "[RTNGodot] Unable to select LibGodot: #{error}" unless status.success?
|
|
37
|
+
selection = JSON.parse(output)
|
|
38
|
+
entry = selection["prebuiltFiles"]&.find { |e| e["name"] == lib_name }
|
|
39
|
+
|
|
40
|
+
unless entry
|
|
41
|
+
raise "Prebuilt entry not found for library '#{lib_name}'. Ensure it exists in package.json."
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Build the relative path: <destination_base_dir>/<name>/<version>
|
|
45
|
+
File.join(entry["destination_base_dir"], lib_name, entry["version"])
|
|
46
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
# Load the package.json once so we can reuse its data.
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
repository = package["repository"]
|
|
5
|
+
repository_url = repository.is_a?(Hash) ? repository["url"] : repository
|
|
6
|
+
|
|
7
|
+
# Load the helper that computes the pre‑built path.
|
|
8
|
+
require_relative "./prebuilt-utils.rb"
|
|
9
|
+
|
|
10
|
+
Pod::Spec.new do |s|
|
|
11
|
+
s.name = "react-native-godot"
|
|
12
|
+
s.version = package["version"]
|
|
13
|
+
s.summary = package["description"]
|
|
14
|
+
s.description = package["description"]
|
|
15
|
+
s.homepage = package["homepage"]
|
|
16
|
+
s.license = package["license"]
|
|
17
|
+
s.platforms = { :ios => "15.0" }
|
|
18
|
+
s.author = package["author"]
|
|
19
|
+
s.source = { :git => repository_url, :tag => "v#{s.version}" }
|
|
20
|
+
s.frameworks = 'AVFAudio'
|
|
21
|
+
|
|
22
|
+
# Vendored frameworks are taken from the pre‑built location.
|
|
23
|
+
# Using the helper ensures the path stays in sync with package.json.
|
|
24
|
+
s.vendored_frameworks = [
|
|
25
|
+
File.join(prebuilt_path("libgodot"), "libgodot.xcframework"),
|
|
26
|
+
File.join(prebuilt_path("libgodot-cpp"), "libgodot-cpp.xcframework")
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
s.weak_frameworks = 'libgodot'
|
|
30
|
+
|
|
31
|
+
s.source_files = ["ios/**/*.{h,hpp,cpp,m,mm,swift}"]
|
|
32
|
+
s.header_mappings_dir = 'ios'
|
|
33
|
+
|
|
34
|
+
s.subspec 'Cpp' do |cs|
|
|
35
|
+
cs.source_files = ["cpp/**/*.{h,hpp,c,cpp,inc}"]
|
|
36
|
+
cs.header_mappings_dir = 'cpp'
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
install_modules_dependencies(s)
|
|
40
|
+
s.dependency 'RNWorklets'
|
|
41
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
// Keep React Native's SwiftPM autolinker aligned with Package.swift.
|
|
3
|
+
spm: {
|
|
4
|
+
name: 'ReactNativeGodot',
|
|
5
|
+
autolinkingPlugin: './scripts/spm-autolinking-plugin.js',
|
|
6
|
+
},
|
|
7
|
+
dependency: {
|
|
8
|
+
platforms: {
|
|
9
|
+
android: {
|
|
10
|
+
// Subdirectory paths in Android-autolinking.cmake are generated based on these:
|
|
11
|
+
// Paths given are relative to the ./android folder:
|
|
12
|
+
cmakeListsPath: './build/generated/source/codegen/jni/CMakeLists.txt',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|