From 73de5ac8925741dbe74795f8921eb0dcb99c2664 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Wed, 18 Oct 2023 15:54:20 +0200 Subject: [PATCH 01/23] append_release action --- .github/workflows/add_artifact_urls.yml | 21 ----- .github/workflows/append_release.yml | 119 ++++++++++++++++++++++++ .github/workflows/publish_preview.yml | 6 ++ 3 files changed, 125 insertions(+), 21 deletions(-) delete mode 100644 .github/workflows/add_artifact_urls.yml create mode 100644 .github/workflows/append_release.yml diff --git a/.github/workflows/add_artifact_urls.yml b/.github/workflows/add_artifact_urls.yml deleted file mode 100644 index aa3320c89..000000000 --- a/.github/workflows/add_artifact_urls.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: add artifact links to pull request and related issues -on: - workflow_run: - workflows: ['PR Build'] - types: [completed] - -jobs: - artifacts-url-comments: - name: add artifact links to pull request and related issues job - runs-on: windows-2019 - steps: - - name: add artifact links to pull request and related issues step - uses: tonyhallett/artifacts-url-comments@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - prefix: Here are the build results - suffix: Artifacts will only be retained for 90 days. - format: name - addTo: pull - continue-on-error: true diff --git a/.github/workflows/append_release.yml b/.github/workflows/append_release.yml new file mode 100644 index 000000000..ba807fc84 --- /dev/null +++ b/.github/workflows/append_release.yml @@ -0,0 +1,119 @@ +name: 'Append Release' + +on: + workflow_call: + inputs: + release-name: + required: true + type: string +jobs: + Build: + runs-on: ubuntu-latest + steps: + - name: Download Assembled Folder + uses: actions/download-artifact@v2 + with: + name: 'Assembled' + path: Package/react-native + - name: Compress Package react-native + uses: a7ul/tar-action@v1.1.3 + id: compress + with: + command: c + cwd: ./ + files: Package/react-native + outPath: react-native.tar.gz + + - name: Download Assembled-BaseKit-iOSAndroid 0.69 Folder + uses: actions/download-artifact@v2 + with: + name: 'Assembled-BaseKit-iOSAndroid0.69' + path: Package/iOSAndroid0.69 + - name: Compress Package iOSAndroid0.69 + uses: a7ul/tar-action@v1.1.3 + id: compress + with: + command: c + cwd: ./ + files: Package/iOSAndroid0.69 + outPath: iOSAndroid0.69.tar.gz + + - name: Download Assembled-BaseKit-iOSAndroid 0.70 Folder + uses: actions/download-artifact@v2 + with: + name: 'Assembled-BaseKit-iOSAndroid0.70' + path: Package/iOSAndroid0.70 + - name: Compress Package iOSAndroid0.70 + uses: a7ul/tar-action@v1.1.3 + id: compress + with: + command: c + cwd: ./ + files: Package/iOSAndroid0.70 + outPath: iOSAndroid0.70.tar.gz + + - name: Download Assembled-BaseKit-iOSAndroid 0.71 Folder + uses: actions/download-artifact@v2 + with: + name: 'Assembled-BaseKit-iOSAndroid0.71' + path: Package/iOSAndroid0.71 + - name: Compress Package iOSAndroid0.71 + uses: a7ul/tar-action@v1.1.3 + id: compress + with: + command: c + cwd: ./ + files: Package/iOSAndroid0.71 + outPath: iOSAndroid0.71.tar.gz + + - name: Download Assembled-BaseKit-Windows 0.69 Folder + uses: actions/download-artifact@v2 + with: + name: 'Assembled-BaseKit-Windows0.69' + path: Package/Windows0.69 + - name: Compress Package Windows0.69 + uses: a7ul/tar-action@v1.1.3 + id: compress + with: + command: c + cwd: ./ + files: Package/Windows0.69 + outPath: Windows0.69.tar.gz + + - name: Download Assembled-BaseKit-Windows 0.70 Folder + uses: actions/download-artifact@v2 + with: + name: 'Assembled-BaseKit-Windows0.70' + path: Package/Windows0.70 + - name: Compress Package Windows0.70 + uses: a7ul/tar-action@v1.1.3 + id: compress + with: + command: c + cwd: ./ + files: Package/Windows0.70 + outPath: Windows0.70.tar.gz + + - name: Download Assembled-BaseKit-Windows 0.71 Folder + uses: actions/download-artifact@v2 + with: + name: 'Assembled-BaseKit-Windows0.71' + path: Package/Windows0.71 + - name: Compress Package Windows0.71 + uses: a7ul/tar-action@v1.1.3 + id: compress + with: + command: c + cwd: ./ + files: Package/Windows0.71 + outPath: Windows0.71.tar.gz + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: ReleasePackage.tar.gz + tag_name: ${{ inputs.release-name }} + name: ${{ inputs.release-name }} + body: "Release for ${{ inputs.release-name }}" + draft: false + prerelease: false diff --git a/.github/workflows/publish_preview.yml b/.github/workflows/publish_preview.yml index 6203abc0f..43ae88d4b 100644 --- a/.github/workflows/publish_preview.yml +++ b/.github/workflows/publish_preview.yml @@ -84,6 +84,12 @@ jobs: with: release-version: ${{ github.event.inputs.release_version }} + append-release: + needs: [build-typescript, build-android-ios-064, build-android-ios-065, build-android-ios-069, build-android-ios-070, build-android-ios-071, build-windows-064, build-windows-065, build-windows-069, build-windows-070, build-windows-071] + uses: ./.github/workflows/append_release.yml + with: + release-name: ${{ github.event.inputs.release_version }} + package: needs: [build-typescript, build-android-ios-064, build-android-ios-065, build-android-ios-069, build-android-ios-070, build-android-ios-071, build-windows-064, build-windows-065, build-windows-069, build-windows-070, build-windows-071] runs-on: macos-latest From 069dcb49d8028416d1ae78c30911615f426e3186 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Wed, 18 Oct 2023 15:59:00 +0200 Subject: [PATCH 02/23] compress id must be unique --- .github/workflows/append_release.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/append_release.yml b/.github/workflows/append_release.yml index ba807fc84..66fb1e01d 100644 --- a/.github/workflows/append_release.yml +++ b/.github/workflows/append_release.yml @@ -17,7 +17,7 @@ jobs: path: Package/react-native - name: Compress Package react-native uses: a7ul/tar-action@v1.1.3 - id: compress + id: compressreact-native with: command: c cwd: ./ @@ -31,7 +31,7 @@ jobs: path: Package/iOSAndroid0.69 - name: Compress Package iOSAndroid0.69 uses: a7ul/tar-action@v1.1.3 - id: compress + id: compressiosandroid069 with: command: c cwd: ./ @@ -45,7 +45,7 @@ jobs: path: Package/iOSAndroid0.70 - name: Compress Package iOSAndroid0.70 uses: a7ul/tar-action@v1.1.3 - id: compress + id: compressiosandroid070 with: command: c cwd: ./ @@ -59,7 +59,7 @@ jobs: path: Package/iOSAndroid0.71 - name: Compress Package iOSAndroid0.71 uses: a7ul/tar-action@v1.1.3 - id: compress + id: compressiosandroid071 with: command: c cwd: ./ @@ -73,7 +73,7 @@ jobs: path: Package/Windows0.69 - name: Compress Package Windows0.69 uses: a7ul/tar-action@v1.1.3 - id: compress + id: compresswindows069 with: command: c cwd: ./ @@ -87,7 +87,7 @@ jobs: path: Package/Windows0.70 - name: Compress Package Windows0.70 uses: a7ul/tar-action@v1.1.3 - id: compress + id: compresswindows070 with: command: c cwd: ./ @@ -101,7 +101,7 @@ jobs: path: Package/Windows0.71 - name: Compress Package Windows0.71 uses: a7ul/tar-action@v1.1.3 - id: compress + id: compresswindows071 with: command: c cwd: ./ @@ -111,7 +111,14 @@ jobs: - name: Release uses: softprops/action-gh-release@v1 with: - files: ReleasePackage.tar.gz + files: | + react-native.tar.gz + Windows0.69.tar.gz + Windows0.70.tar.gz + Windows0.71.tar.gz + iOSAndroid0.69.tar.gz + iOSAndroid0.70.tar.gz + iOSAndroid0.71.tar.gz tag_name: ${{ inputs.release-name }} name: ${{ inputs.release-name }} body: "Release for ${{ inputs.release-name }}" From 3cc8a96c61939785128e232d61042a6c1eed4444 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Fri, 20 Oct 2023 12:04:57 +0200 Subject: [PATCH 03/23] reduce folder depth for tgz --- .github/workflows/append_release.yml | 43 ++++++++++++++++++--------- .github/workflows/publish_preview.yml | 2 +- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/.github/workflows/append_release.yml b/.github/workflows/append_release.yml index 66fb1e01d..b6b4d09d9 100644 --- a/.github/workflows/append_release.yml +++ b/.github/workflows/append_release.yml @@ -20,8 +20,8 @@ jobs: id: compressreact-native with: command: c - cwd: ./ - files: Package/react-native + cwd: Package/react-native/ + files: . outPath: react-native.tar.gz - name: Download Assembled-BaseKit-iOSAndroid 0.69 Folder @@ -34,8 +34,11 @@ jobs: id: compressiosandroid069 with: command: c - cwd: ./ - files: Package/iOSAndroid0.69 + cwd: Package/iOSAndroid0.69/ + files: | + android + ios + react-native-babylon.podspec outPath: iOSAndroid0.69.tar.gz - name: Download Assembled-BaseKit-iOSAndroid 0.70 Folder @@ -48,8 +51,11 @@ jobs: id: compressiosandroid070 with: command: c - cwd: ./ - files: Package/iOSAndroid0.70 + cwd: Package/iOSAndroid0.70/ + files: | + android + ios + react-native-babylon.podspec outPath: iOSAndroid0.70.tar.gz - name: Download Assembled-BaseKit-iOSAndroid 0.71 Folder @@ -62,8 +68,11 @@ jobs: id: compressiosandroid071 with: command: c - cwd: ./ - files: Package/iOSAndroid0.71 + cwd: Package/iOSAndroid0.71/ + files: | + android + ios + react-native-babylon.podspec outPath: iOSAndroid0.71.tar.gz - name: Download Assembled-BaseKit-Windows 0.69 Folder @@ -76,8 +85,10 @@ jobs: id: compresswindows069 with: command: c - cwd: ./ - files: Package/Windows0.69 + cwd: Package/Windows0.69/ + files: | + windows + index.ts outPath: Windows0.69.tar.gz - name: Download Assembled-BaseKit-Windows 0.70 Folder @@ -90,8 +101,10 @@ jobs: id: compresswindows070 with: command: c - cwd: ./ - files: Package/Windows0.70 + cwd: Package/Windows0.70/ + files: | + windows + index.ts outPath: Windows0.70.tar.gz - name: Download Assembled-BaseKit-Windows 0.71 Folder @@ -104,8 +117,10 @@ jobs: id: compresswindows071 with: command: c - cwd: ./ - files: Package/Windows0.71 + cwd: Package/Windows0.71/ + files: | + windows + index.ts outPath: Windows0.71.tar.gz - name: Release diff --git a/.github/workflows/publish_preview.yml b/.github/workflows/publish_preview.yml index 43ae88d4b..7606d82b0 100644 --- a/.github/workflows/publish_preview.yml +++ b/.github/workflows/publish_preview.yml @@ -85,7 +85,7 @@ jobs: release-version: ${{ github.event.inputs.release_version }} append-release: - needs: [build-typescript, build-android-ios-064, build-android-ios-065, build-android-ios-069, build-android-ios-070, build-android-ios-071, build-windows-064, build-windows-065, build-windows-069, build-windows-070, build-windows-071] + needs: [build-typescript, build-android-ios-069, build-android-ios-070, build-android-ios-071, build-windows-069, build-windows-070, build-windows-071] uses: ./.github/workflows/append_release.yml with: release-name: ${{ github.event.inputs.release_version }} From 9405bafe3e357d698c3d3a84f934ead497a408fc Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Fri, 20 Oct 2023 15:13:53 +0200 Subject: [PATCH 04/23] react-native-basekit --- .github/workflows/append_release.yml | 33 ++++- .github/workflows/publish_preview.yml | 8 ++ .../react-native-basekit/.gitattributes | 1 + .../react-native-basekit/.gitignore | 51 ++++++++ .../react-native-basekit/.npmignore | 60 +++++++++ .../@babylonjs/react-native-basekit/README.md | 116 ++++++++++++++++++ .../react-native-basekit/package.json | 58 +++++++++ .../react-native-basekit/scripts/install.js | 87 +++++++++++++ 8 files changed, 413 insertions(+), 1 deletion(-) create mode 100644 Modules/@babylonjs/react-native-basekit/.gitattributes create mode 100644 Modules/@babylonjs/react-native-basekit/.gitignore create mode 100644 Modules/@babylonjs/react-native-basekit/.npmignore create mode 100644 Modules/@babylonjs/react-native-basekit/README.md create mode 100644 Modules/@babylonjs/react-native-basekit/package.json create mode 100644 Modules/@babylonjs/react-native-basekit/scripts/install.js diff --git a/.github/workflows/append_release.yml b/.github/workflows/append_release.yml index b6b4d09d9..8b425f78e 100644 --- a/.github/workflows/append_release.yml +++ b/.github/workflows/append_release.yml @@ -21,7 +21,38 @@ jobs: with: command: c cwd: Package/react-native/ - files: . + files: | # all files except package.json and readme.md + BabylonModule.d.ts + BabylonModule.js + BabylonModule.js.map + EngineHook.d.ts + EngineHook.js + EngineHook.js.map + EngineView.d.ts + EngineView.js + EngineView.js.map + FontFace.d.ts + FontFace.js + FontFace.js.map + index.d.ts + index.js + index.js.map + NativeCapture.d.ts + NativeCapture.js + NativeCapture.js.map + NativeEngineHook.d.ts + NativeEngineHook.js + NativeEngineHook.js.map + NativeEngineView.d.ts + NativeEngineView.js + NativeEngineView.js.map + ReactNativeEngine.d.ts + ReactNativeEngine.js + ReactNativeEngine.js.map + shared + VersionValidation.d.ts + VersionValidation.js + VersionValidation.js.map outPath: react-native.tar.gz - name: Download Assembled-BaseKit-iOSAndroid 0.69 Folder diff --git a/.github/workflows/publish_preview.yml b/.github/workflows/publish_preview.yml index 7606d82b0..b455d3900 100644 --- a/.github/workflows/publish_preview.yml +++ b/.github/workflows/publish_preview.yml @@ -315,5 +315,13 @@ jobs: npm version --no-git-tag-version ${{ github.event.inputs.release_version }} npm publish --access public --tag ${{ github.event.inputs.NPM_tag }} ${{ github.event.inputs.NPM_publish_arg }} working-directory: ./Package/Assembled-BaseKit-Windows0.71 + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +# ROOT Basekit package + - name: Version & Publish Package @babylonjs/react-native-basekit + run: | + npm version --no-git-tag-version ${{ github.event.inputs.release_version }} + npm publish --access public --tag ${{ github.event.inputs.NPM_tag }} ${{ github.event.inputs.NPM_publish_arg }} + working-directory: ./Modules/@babylonjs/react-native-basekit env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/Modules/@babylonjs/react-native-basekit/.gitattributes b/Modules/@babylonjs/react-native-basekit/.gitattributes new file mode 100644 index 000000000..d42ff1835 --- /dev/null +++ b/Modules/@babylonjs/react-native-basekit/.gitattributes @@ -0,0 +1 @@ +*.pbxproj -text diff --git a/Modules/@babylonjs/react-native-basekit/.gitignore b/Modules/@babylonjs/react-native-basekit/.gitignore new file mode 100644 index 000000000..1de26d81c --- /dev/null +++ b/Modules/@babylonjs/react-native-basekit/.gitignore @@ -0,0 +1,51 @@ +# OSX +# +.DS_Store + +# node.js +# +node_modules/ +npm-debug.log +yarn-error.log + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml + +# BUCK +buck-out/ +\.buckd/ +*.keystore + +# CMake +CMakeFiles +CMakeScripts +CMakeCache.txt +cmake_install.cmake +ReactNativeBabylon.xcodeproj +*.tgz +jsi \ No newline at end of file diff --git a/Modules/@babylonjs/react-native-basekit/.npmignore b/Modules/@babylonjs/react-native-basekit/.npmignore new file mode 100644 index 000000000..673b6c072 --- /dev/null +++ b/Modules/@babylonjs/react-native-basekit/.npmignore @@ -0,0 +1,60 @@ +# OSX +# +.DS_Store + +# node.js +# +node_modules/ +npm-debug.log +yarn-error.log + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml + +# BUCK +buck-out/ +\.buckd/ +*.keystore + +# CMake +CMakeFiles +CMakeScripts +CMakeCache.txt +cmake_install.cmake +ReactNativeBabylon.xcodeproj +*.tgz + +# Package-specific ignores +#submodules/BabylonNative/Apps +submodules/BabylonNative/Dependencies/bgfx.cmake/bgfx/examples/* +!submodules/BabylonNative/Dependencies/bgfx.cmake/bgfx/examples/common +submodules/BabylonNative/Dependencies/glslang/Test +submodules/BabylonNative/Dependencies/xr/Dependencies/arcore-android-sdk/media +submodules/BabylonNative/Dependencies/xr/Dependencies/arcore-android-sdk/tools +submodules/BabylonNative/Dependencies/xr/Dependencies/arcore-android-sdk/assets +submodules/BabylonNative/Dependencies/xr/Dependencies/arcore-android-sdk/samples diff --git a/Modules/@babylonjs/react-native-basekit/README.md b/Modules/@babylonjs/react-native-basekit/README.md new file mode 100644 index 000000000..127697552 --- /dev/null +++ b/Modules/@babylonjs/react-native-basekit/README.md @@ -0,0 +1,116 @@ +# Babylon React Native + +## Usage + +This quick overview will help you understand the constructs provided by Babylon React Native and how to use them in a React Native application. + +### Dependencies + +This package has several **peer dependencies**. If these dependencies are unmet, `npm install` will emit warnings. Be sure to add these dependencies to your project. + +The `react-native-permissions` dependency is required for XR capabilities of Babylon.js (to request camera permissions automatically). Be sure to follow the `react-native-permissions` [instructions](https://github.com/react-native-community/react-native-permissions#setup) to update your `Podfile` and `Info.plist` (iOS) and/or `AndroidManifest.xml` (Android). + +### Android Configuration + +The minimum Android SDK version is 18. This must be set as `minSdkVersion` in the consuming project's `build.gradle` file. + +### iOS Configuration + +The minimum deployment target version is 12. This must be set as `iOS Deployment Target` in the consuming project's `project.pbxproj`, and must also be set as `platform` in the consuming project's `podfile`. + +### Platform Native Packages + +Babylon React Native platform native packages must also be installed for the platforms and React Native versions being targeted. This is only needed for ***apps*** using Babylon React Native, not for ***libraries (React Native packages)*** building on top of Babylon React Native. + +| | React Native 0.63 - 0.64 | React Native 0.65 - 0.66 | React Native 0.69 | React Native 0.70 | +| ------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| Android | [@babylonjs/react-native-iosandroid-0-64](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-64) | [@babylonjs/react-native-iosandroid-0-65](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-65) | [@babylonjs/react-native-iosandroid-0-69](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-69) | [@babylonjs/react-native-iosandroid-0-70](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-70) | +| iOS | [@babylonjs/react-native-iosandroid-0-64](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-64) | [@babylonjs/react-native-iosandroid-0-65](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-65) | [@babylonjs/react-native-iosandroid-0-69](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-69) | [@babylonjs/react-native-iosandroid-0-70](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-70) | +| Windows | [@babylonjs/react-native-windows-0-64](https://www.npmjs.com/package/@babylonjs/react-native-windows-0-64) | [@babylonjs/react-native-windows-0-65](https://www.npmjs.com/package/@babylonjs/react-native-windows-0-65) | [@babylonjs/react-native-windows-0-69](https://www.npmjs.com/package/@babylonjs/react-native-windows-0-69) | [@babylonjs/react-native-windows-0-70](https://www.npmjs.com/package/@babylonjs/react-native-windows-0-70) | + +### `useEngine` + +`useEngine` is a **custom React hook** that manages the lifecycle of a Babylon engine instance in the context of an owning React component. `useEngine` creates an engine instance **asynchronously** which is used to create and configure scenes. Typically scene initialization code should exist in a `useEffect` triggered by an `engine` state change. For example: + +```tsx +import { useEngine } from '@babylonjs/react-native'; +import { Engine, Scene } from '@babylonjs/core'; + +const MyComponent: FunctionComponent = (props: MyComponentProps) => { + const engine = useEngine(); + + useEffect(() => { + if (engine) { + const scene = new Scene(engine); + // Setup the scene! + } + }, [engine]); + + return ( + <> + + ); +} +``` + +### `EngineView` + +`EngineView` is a **custom React Native view** that presents a `camera` from a Babylon `scene`. A `camera` therefore is assigned to the `EngineView`. For example: + +```tsx +import { useEngine, EngineView } from '@babylonjs/react-native'; +import { Engine, Scene, Camera } from '@babylonjs/core'; + +const MyComponent: FunctionComponent = (props: MyComponentProps) => { + const engine = useEngine(); + const [camera, setCamera] = useState(); + + useEffect(() => { + if (engine) { + const scene = new Scene(engine); + scene.createDefaultCamera(true); + setCamera(scene.activeCamera!); + // Setup the scene! + } + }, [engine]); + + return ( + <> + + + ); +} +``` + +Also the `EngineView` has a boolean `isTransparent` flag which defines whether the background of the scene should be transparent or not. + +e.g. + +```tsx + +``` +To configure anti-aliasing, a property called `antiAliasing` can be changed to a value of 0 or 1 (disable anti-aliasing, default), 2, 4, 8 or 16 (anti-aliasing samples). + +e.g. + +```tsx + +``` + +Note: Currently only one `EngineView` can be active at any given time. Multi-view will be supported in a future release. + +The Android specific `androidView` property can help set the type of the view used for rendering. Depending on user needs and performance, refer to the table below. [`TextureView`](https://developer.android.com/reference/android/view/TextureView) can be inserted anywhere in the view hierarchy, but is less efficient. [`SurfaceView`](https://developer.android.com/reference/android/view/SurfaceView) can only be full above or fully below the rest of the UI, but is more efficient. + +| isTransparent | androidView | Description | +| ----------- | ------------------------ | ----------- | +| False | TextureView | Opaque TextureView. +| False | SurfaceView | Simple surfaceView (default when no `androidView` set with `isTransparent=false`). +| False | SurfaceViewZTopMost | SurfaceView with [ZTopMost](https://developer.android.com/reference/android/view/SurfaceView#setZOrderOnTop(boolean)) set to `true`. +| False | SurfaceViewZMediaOverlay | SurfaceView with [ZMediaOverlay](https://developer.android.com/reference/android/view/SurfaceView#setZOrderMediaOverlay(boolean)) set to `true`. +| True | TextureView | Transparent TextureView. +| True | SurfaceView | SurfaceView will stay opaque +| True | SurfaceViewZTopMost | SurfaceView with [ZTopMost](https://developer.android.com/reference/android/view/SurfaceView#setZOrderOnTop(boolean)) set to `true`. Transparent but top most. (default when no `androidView` set with `isTransparent=true`) +| True | SurfaceViewZMediaOverlay | SurfaceView with [ZMediaOverlay](https://developer.android.com/reference/android/view/SurfaceView#setZOrderMediaOverlay(boolean)) set to `true`. Only Transparent on top of other SurfaceViews. + +More infos on TextureView Vs SurfaceView performance here: +https://developer.android.com/reference/android/view/TextureView diff --git a/Modules/@babylonjs/react-native-basekit/package.json b/Modules/@babylonjs/react-native-basekit/package.json new file mode 100644 index 000000000..81893b93f --- /dev/null +++ b/Modules/@babylonjs/react-native-basekit/package.json @@ -0,0 +1,58 @@ +{ + "name": "@babylonjs/react-native-basekit", + "title": "React Native Babylon Basekit", + "version": "0.0.1", + "description": "Babylon Native integration into React Native", + "main": "index.ts", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "install": "node scripts/install.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/babylonjs/BabylonReactNative.git", + "baseUrl": "https://github.com/babylonjs/BabylonReactNative" + }, + "keywords": [ + "react-native" + ], + "author": { + "name": "Your Name", + "email": "yourname@email.com" + }, + "homepage": "https://github.com/BabylonJS/BabylonReactNative#readme", + "license": "MIT", + "licenseFilename": "LICENSE", + "readmeFilename": "README.md", + "dependencies": { + "base-64": "^0.1.0", + "https": "^1.0.0", + "semver": "^7.3.2", + "tar": "^6.2.0", + "zlib": "^1.0.5" + }, + "peerDependencies": { + "@babylonjs/core": "^6.14.0", + "react": ">=16.13.1", + "react-native": ">=0.63.1" + }, + "devDependencies": { + "@babel/core": "^7.8.4", + "@babel/runtime": "^7.8.4", + "@babylonjs/core": "6.14.0", + "@rnw-scripts/eslint-config": "0.1.6", + "@rnw-scripts/ts-config": "0.1.0", + "@types/base-64": "^0.1.3", + "@types/jest": "^25.2.1", + "@types/react": "^16.9.32", + "@types/react-native": "^0.63.1", + "@types/react-native-permissions": "^2.0.0", + "@types/react-test-renderer": "^16.9.2", + "@types/semver": "^7.3.4", + "eslint": "7.12.0", + "just-scripts": "^0.44.7", + "metro-react-native-babel-preset": "^0.56.0", + "prettier": "1.19.1", + "typescript": "^4.3.5" + } +} diff --git a/Modules/@babylonjs/react-native-basekit/scripts/install.js b/Modules/@babylonjs/react-native-basekit/scripts/install.js new file mode 100644 index 000000000..d652ac620 --- /dev/null +++ b/Modules/@babylonjs/react-native-basekit/scripts/install.js @@ -0,0 +1,87 @@ +const https = require('https'); +const zlib = require('zlib'); +const tar = require('tar'); + +const downloadAndExtract = (url) => { + const options = { + followRedirects: true, // Follow HTTP 3xx redirects + }; + + https.get(url, options, (response) => { + if ([301, 302, 303, 307, 308].includes(response.statusCode)) { + // If the response is a redirect, recursively call downloadAndExtract with the new URL + downloadAndExtract(response.headers.location); + } else if (response.statusCode === 200) { + const gunzip = zlib.createGunzip(); + const untar = tar.extract({ cwd: process.cwd() }); // Extract to the current working directory + + response + .pipe(gunzip) // Unzip the response + .pipe(untar) // Extract the tar file + .on('finish', () => { + //done + }) + .on('error', (err) => { + console.error('Error extracting the tar.gz file:', err); + }); + } else { + console.error('Failed to download the file. Status code:', response.statusCode); + // thow ? + } + }) + .on('error', (err) => { + console.error('Error downloading the file:', err); + // thow ? + }); +}; + +function Install() { + // get Babylon React Native package version + const packageJsonPath = process.env.npm_package_json; + const packageJson = require(packageJsonPath); + if (!packageJson.version) { + console.err("Babylon React Native version not found"); + // throw + } + // get user project react-native version + const projectPackageJsonPath = process.env.npm_config_local_prefix + '/package.json'; + + // Read the project's package.json file + const projectPackageJson = require(projectPackageJsonPath); + // Check if the project's package.json has a 'react-native' dependency + if (projectPackageJson.dependencies && projectPackageJson.dependencies['react-native']) { + const reactNativeVersion = projectPackageJson.dependencies['react-native']; + console.log(`Detected React Native version: ${reactNativeVersion}`); + reactNativePostfix = ""; + if (reactNativeVersion >= '0.71') { + reactNativePostfix = "0.71"; + } else if (reactNativeVersion >= '0.70') { + reactNativePostfix = "0.70"; + } else if (reactNativeVersion >= '0.69') { + reactNativePostfix = "0.69"; + } else { + console.error("Unsupported react native version."); + // TODO: throw + } + console.log(`Downloading Babylon React Native version ${reactNativePostfix} from Package version ${packageJson.version}.`); + + const rootUrl = 'https://github.com/CedricGuillemet/BabylonReactNative-1/releases/download'; + const reactNative = `${rootUrl}/${packageJson.version}/react-native.tar.gz`; + const reactNativeiOSAndroid = `${rootUrl}/${packageJson.version}/iOSAndroid${reactNativePostfix}.tar.gz`; + const reactNativeiOSWindows = `${rootUrl}/${packageJson.version}/Windows${reactNativePostfix}.tar.gz`; + + // Start the download and extraction process + downloadAndExtract(reactNative); + downloadAndExtract(reactNativeiOSAndroid); + const reactNativeWindowsVersion = projectPackageJson.dependencies['react-native-windows']; + if (reactNativeWindowsVersion) { + console.log("react-native-windows detected."); + downloadAndExtract(reactNativeiOSWindows); + } + } else { + console.warn("No react-native version found for BabylonReactNative."); + //throw here ? + } +} + +Install(); \ No newline at end of file From 0a773ce1e5bc85b1ecc6b46e51e4b1d091f000ea Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Fri, 20 Oct 2023 18:07:54 +0200 Subject: [PATCH 05/23] configuration and error handling --- .../react-native-basekit/scripts/install.js | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/Modules/@babylonjs/react-native-basekit/scripts/install.js b/Modules/@babylonjs/react-native-basekit/scripts/install.js index d652ac620..2a23cc0ec 100644 --- a/Modules/@babylonjs/react-native-basekit/scripts/install.js +++ b/Modules/@babylonjs/react-native-basekit/scripts/install.js @@ -2,6 +2,26 @@ const https = require('https'); const zlib = require('zlib'); const tar = require('tar'); +function getArgument(name) { + const flags = process.argv.slice(2), index = flags.lastIndexOf(name); + + if (index === -1 || index + 1 >= flags.length) { + return null; + } + + return flags[index + 1]; +} + +function getBinaryUrl(package, binaryFilename) { + var site = getArgument('--brn-binary-site') || + process.env.BRN_BINARY_SITE || + process.env.npm_config_brn_binary_site || + (package.nodeBabylonConfig && package.nodeBabylonConfig.binarySite) || + 'https://github.com/CedricGuillemet/BabylonReactNative-1/releases/download'; + + return [site, /*'v' +*/ package.version, binaryFilename].join('/'); +} + const downloadAndExtract = (url) => { const options = { followRedirects: true, // Follow HTTP 3xx redirects @@ -23,15 +43,16 @@ const downloadAndExtract = (url) => { }) .on('error', (err) => { console.error('Error extracting the tar.gz file:', err); + process.exit(1); }); } else { console.error('Failed to download the file. Status code:', response.statusCode); - // thow ? + process.exit(1); } }) .on('error', (err) => { console.error('Error downloading the file:', err); - // thow ? + process.exit(1); }); }; @@ -41,7 +62,7 @@ function Install() { const packageJson = require(packageJsonPath); if (!packageJson.version) { console.err("Babylon React Native version not found"); - // throw + process.exit(1); } // get user project react-native version const projectPackageJsonPath = process.env.npm_config_local_prefix + '/package.json'; @@ -61,26 +82,27 @@ function Install() { reactNativePostfix = "0.69"; } else { console.error("Unsupported react native version."); - // TODO: throw + process.exit(1); } console.log(`Downloading Babylon React Native version ${reactNativePostfix} from Package version ${packageJson.version}.`); - const rootUrl = 'https://github.com/CedricGuillemet/BabylonReactNative-1/releases/download'; - const reactNative = `${rootUrl}/${packageJson.version}/react-native.tar.gz`; - const reactNativeiOSAndroid = `${rootUrl}/${packageJson.version}/iOSAndroid${reactNativePostfix}.tar.gz`; - const reactNativeiOSWindows = `${rootUrl}/${packageJson.version}/Windows${reactNativePostfix}.tar.gz`; + const reactNative = getBinaryUrl(packageJson, 'react-native.tar.gz'); + const reactNativeiOSAndroid = getBinaryUrl(packageJson, `iOSAndroid${reactNativePostfix}.tar.gz`); // Start the download and extraction process downloadAndExtract(reactNative); downloadAndExtract(reactNativeiOSAndroid); + + // check and download Windows binary if react-native-windows is found in project package const reactNativeWindowsVersion = projectPackageJson.dependencies['react-native-windows']; if (reactNativeWindowsVersion) { console.log("react-native-windows detected."); + const reactNativeiOSWindows = getBinaryUrl(packageJson, `Windows${reactNativePostfix}.tar.gz`); downloadAndExtract(reactNativeiOSWindows); } } else { - console.warn("No react-native version found for BabylonReactNative."); - //throw here ? + console.error("No react-native version found for BabylonReactNative."); + process.exit(1); } } From 160ef8fff10085d2d4de9dfc129534b2ad2332a9 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Mon, 23 Oct 2023 11:49:04 +0200 Subject: [PATCH 06/23] fix windows vcxproj --- Modules/@babylonjs/react-native-basekit/package.json | 4 ++-- .../windows/BabylonReactNative/BabylonReactNative.vcxproj | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Modules/@babylonjs/react-native-basekit/package.json b/Modules/@babylonjs/react-native-basekit/package.json index 81893b93f..8b97dbbdf 100644 --- a/Modules/@babylonjs/react-native-basekit/package.json +++ b/Modules/@babylonjs/react-native-basekit/package.json @@ -3,10 +3,10 @@ "title": "React Native Babylon Basekit", "version": "0.0.1", "description": "Babylon Native integration into React Native", - "main": "index.ts", + "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "install": "node scripts/install.js" + "postinstall": "node scripts/install.js" }, "repository": { "type": "git", diff --git a/Modules/@babylonjs/react-native-windows/windows/BabylonReactNative/BabylonReactNative.vcxproj b/Modules/@babylonjs/react-native-windows/windows/BabylonReactNative/BabylonReactNative.vcxproj index 1996b9061..46226bf3c 100644 --- a/Modules/@babylonjs/react-native-windows/windows/BabylonReactNative/BabylonReactNative.vcxproj +++ b/Modules/@babylonjs/react-native-windows/windows/BabylonReactNative/BabylonReactNative.vcxproj @@ -22,12 +22,15 @@ $(ProjectDir)\..\..\..\..\..\node_modules\react-native-windows\ + + $(ProjectDir)\..\..\..\..\..\node_modules\react-native-basekit\ $(SolutionDir)\..\node_modules\react-native-windows\ $(ProjectDir)\..\..\..\..\..\Apps\Playground\Playground\node_modules\react-native-windows\ + $(ProjectDir)..\..\..\react-native-basekit\ $(ProjectDir)..\..\..\react-native-iosandroid\ $(ProjectDir)..\..\..\react-native\ $(BabylonReactNativeDir)Build\ @@ -168,6 +171,7 @@ $(BabylonReactNativeDir)shared;%(AdditionalIncludeDirectories) $(BabylonNativeIOSAndroidProjDir)shared;%(AdditionalIncludeDirectories) + $(BabylonNativeBasekitProjDir)shared;%(AdditionalIncludeDirectories) %(IgnoreSpecificDefaultLibraries) From 6455983ecedb456ca0377ccc4553a59033a71107 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Tue, 24 Oct 2023 10:44:58 +0200 Subject: [PATCH 07/23] publish --- .github/workflows/publish.yml | 48 ++++++++++++------- .../react-native-basekit/package.json | 5 +- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c7e7695c9..b2a968077 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -68,6 +68,12 @@ jobs: with: release-version: ${GITHUB_REF/refs\/tags\//} + append-release: + needs: [build-typescript, build-android-ios-069, build-android-ios-070, build-android-ios-071, build-windows-069, build-windows-070, build-windows-071] + uses: ./.github/workflows/append_release.yml + with: + release-name: ${GITHUB_REF/refs\/tags\//} + package: needs: [build-typescript, build-android-ios-064, build-android-ios-065, build-android-ios-069, build-android-ios-070, build-android-ios-071, build-windows-064, build-windows-065, build-windows-069, build-windows-070, build-windows-071] runs-on: macos-latest @@ -175,7 +181,7 @@ jobs: - name: Version & Publish Package @babylonjs/react-native run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -183,35 +189,35 @@ jobs: - name: Version & Publish Package @babylonjs/react-native-iosandroid-0-64 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-iOSAndroid0.64 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-iosandroid-0-65 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-iOSAndroid0.65 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-iosandroid-0-69 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-iOSAndroid0.69 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-iosandroid-0-70 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-iOSAndroid0.70 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-iosandroid-0-71 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-iOSAndroid0.71 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -219,35 +225,35 @@ jobs: - name: Version & Publish Package @babylonjs/react-native-windows-0-64 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-Windows0.64 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-windows-0-65 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-Windows0.65 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-windows-0-69 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-Windows0.69 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-windows-0-70 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-Windows0.70 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-windows-0-71 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-Windows0.71 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -255,42 +261,50 @@ jobs: - name: Version & Publish Package @babylonjs/react-native-basekit-iosandroid-0-69 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-BaseKit-iOSAndroid0.69 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-basekit-iosandroid-0-70 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-BaseKit-iOSAndroid0.70 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-basekit-iosandroid-0-71 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-BaseKit-iOSAndroid0.71 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-basekit-windows-0-69 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-BaseKit-Windows0.69 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-basekit-windows-0-70 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-BaseKit-Windows0.70 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-basekit-windows-0-71 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public + npm publish --access public --dry-run working-directory: ./Package/Assembled-BaseKit-Windows0.71 + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +# ROOT Basekit package + - name: Version & Publish Package @babylonjs/react-native-basekit + run: | + npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} + npm publish --access public --dry-run + working-directory: ./Modules/@babylonjs/react-native-basekit env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/Modules/@babylonjs/react-native-basekit/package.json b/Modules/@babylonjs/react-native-basekit/package.json index 8b97dbbdf..91d777d84 100644 --- a/Modules/@babylonjs/react-native-basekit/package.json +++ b/Modules/@babylonjs/react-native-basekit/package.json @@ -1,7 +1,7 @@ { "name": "@babylonjs/react-native-basekit", "title": "React Native Babylon Basekit", - "version": "0.0.1", + "version": "2.0.2", "description": "Babylon Native integration into React Native", "main": "index.js", "scripts": { @@ -33,8 +33,9 @@ }, "peerDependencies": { "@babylonjs/core": "^6.14.0", + "@babylonjs/loaders": "^6.14.0", "react": ">=16.13.1", - "react-native": ">=0.63.1" + "react-native": ">=0.69.1" }, "devDependencies": { "@babel/core": "^7.8.4", From 6d72317a1c38d0100e1d4c50d61bcf0047cad601 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Tue, 24 Oct 2023 14:24:38 +0200 Subject: [PATCH 08/23] append_release for publishing check --- .github/workflows/append_release.yml | 17 +++++++++++++++++ .github/workflows/publish.yml | 7 ++++--- .github/workflows/publish_preview.yml | 1 + 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/append_release.yml b/.github/workflows/append_release.yml index 8b425f78e..93cff286a 100644 --- a/.github/workflows/append_release.yml +++ b/.github/workflows/append_release.yml @@ -6,6 +6,9 @@ on: release-name: required: true type: string + is-preview: + required: true + type: boolean jobs: Build: runs-on: ubuntu-latest @@ -170,3 +173,17 @@ jobs: body: "Release for ${{ inputs.release-name }}" draft: false prerelease: false + if: ${{ inputs.is-preview }} == true + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + react-native.tar.gz + Windows0.69.tar.gz + Windows0.70.tar.gz + Windows0.71.tar.gz + iOSAndroid0.69.tar.gz + iOSAndroid0.70.tar.gz + iOSAndroid0.71.tar.gz + if: ${{ inputs.is-preview }} == false \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b2a968077..a1aae2ac0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -73,6 +73,7 @@ jobs: uses: ./.github/workflows/append_release.yml with: release-name: ${GITHUB_REF/refs\/tags\//} + is-preview: false package: needs: [build-typescript, build-android-ios-064, build-android-ios-065, build-android-ios-069, build-android-ios-070, build-android-ios-071, build-windows-064, build-windows-065, build-windows-069, build-windows-070, build-windows-071] @@ -158,17 +159,17 @@ jobs: uses: actions/download-artifact@v2 with: name: 'Assembled-BaseKit-Windows0.69' - path: Package/Assembled-Windows0.69 + path: Package/Assembled-BaseKit-Windows0.69 - name: Download Assembled-BaseKit-Windows 0.70 Folder uses: actions/download-artifact@v2 with: name: 'Assembled-Windows0.70' - path: Package/Assembled-Windows0.70 + path: Package/Assembled-BaseKit-Windows0.70 - name: Download Assembled-BaseKit-Windows 0.71 Folder uses: actions/download-artifact@v2 with: name: 'Assembled-BaseKit-Windows0.71' - path: Package/Assembled-Windows0.71 + path: Package/Assembled-BaseKit-Windows0.71 - name: Display structure of downloaded Assembled and Assembled-Windows folders run: ls -R diff --git a/.github/workflows/publish_preview.yml b/.github/workflows/publish_preview.yml index b455d3900..b94534f48 100644 --- a/.github/workflows/publish_preview.yml +++ b/.github/workflows/publish_preview.yml @@ -89,6 +89,7 @@ jobs: uses: ./.github/workflows/append_release.yml with: release-name: ${{ github.event.inputs.release_version }} + is-preview: true package: needs: [build-typescript, build-android-ios-064, build-android-ios-065, build-android-ios-069, build-android-ios-070, build-android-ios-071, build-windows-064, build-windows-065, build-windows-069, build-windows-070, build-windows-071] From 009e40bce937bbcb31e6868c85e152fa380b4a31 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Tue, 24 Oct 2023 15:34:13 +0200 Subject: [PATCH 09/23] npm cache --- .../react-native-basekit/package.json | 1 + .../react-native-basekit/scripts/install.js | 107 ++++++++++++++---- 2 files changed, 87 insertions(+), 21 deletions(-) diff --git a/Modules/@babylonjs/react-native-basekit/package.json b/Modules/@babylonjs/react-native-basekit/package.json index 91d777d84..f670748a0 100644 --- a/Modules/@babylonjs/react-native-basekit/package.json +++ b/Modules/@babylonjs/react-native-basekit/package.json @@ -27,6 +27,7 @@ "dependencies": { "base-64": "^0.1.0", "https": "^1.0.0", + "path": "^0.12.7", "semver": "^7.3.2", "tar": "^6.2.0", "zlib": "^1.0.5" diff --git a/Modules/@babylonjs/react-native-basekit/scripts/install.js b/Modules/@babylonjs/react-native-basekit/scripts/install.js index 2a23cc0ec..6f365da15 100644 --- a/Modules/@babylonjs/react-native-basekit/scripts/install.js +++ b/Modules/@babylonjs/react-native-basekit/scripts/install.js @@ -1,6 +1,41 @@ const https = require('https'); const zlib = require('zlib'); const tar = require('tar'); +const path = require('path'); +const fs = require('fs'); + +function getCachePathCandidates() { + return [ + process.env.npm_config_sass_binary_cache, + process.env.npm_config_cache, + ].filter(function(_) { return _; }); +} + +function getCached(package, binaryFilename) { + return [getCachePathCandidates(), 'BabylonReactNative', package.version, binaryFilename].join('/'); +} + +function useCachedFile(filePath) { + if (fs.existsSync(filePath)) { + console.log(`Using cached file ${filePath}`); + const gunzip = zlib.createGunzip(); + const untar = tar.extract({ cwd: process.cwd() }); // Extract to the current working directory + + const sourceStream = fs.createReadStream(filePath); + sourceStream + .pipe(gunzip) // Decompress the .tar.gz file + .pipe(untar) // Extract the tar contents to the cwd + .on('error', (err) => { + console.error('Error extracting .tar.gz file:', err); + process.exit(1); + }) + .on('end', () => { + console.log('Extraction completed successfully.'); + }); + return true; + } + return false; +} function getArgument(name) { const flags = process.argv.slice(2), index = flags.lastIndexOf(name); @@ -19,32 +54,49 @@ function getBinaryUrl(package, binaryFilename) { (package.nodeBabylonConfig && package.nodeBabylonConfig.binarySite) || 'https://github.com/CedricGuillemet/BabylonReactNative-1/releases/download'; - return [site, /*'v' +*/ package.version, binaryFilename].join('/'); + return [site, package.version, binaryFilename].join('/'); } -const downloadAndExtract = (url) => { +const downloadExtractAndCache = (url, cachedFilePath) => { const options = { followRedirects: true, // Follow HTTP 3xx redirects }; https.get(url, options, (response) => { if ([301, 302, 303, 307, 308].includes(response.statusCode)) { - // If the response is a redirect, recursively call downloadAndExtract with the new URL - downloadAndExtract(response.headers.location); + // If the response is a redirect, recursively call downloadExtractAndCache with the new URL + downloadExtractAndCache(response.headers.location, cachedFilePath); } else if (response.statusCode === 200) { const gunzip = zlib.createGunzip(); const untar = tar.extract({ cwd: process.cwd() }); // Extract to the current working directory - response - .pipe(gunzip) // Unzip the response - .pipe(untar) // Extract the tar file - .on('finish', () => { - //done - }) - .on('error', (err) => { - console.error('Error extracting the tar.gz file:', err); - process.exit(1); + // create cache directory to store download file + try { + fs.mkdirSync(path.dirname(cachedFilePath), {recursive: true}); + } catch (err) { + console.error('Unable to create directory for cache', err); + process.exit(1); + } + + const chunks = []; + response.on('data', (chunk) =>{ + chunks.push(chunk); + }) + .on('end', (err) => { + const fileData = Buffer.concat(chunks); + fs.writeFile(cachedFilePath, fileData, (err) => { + if (err) { + console.error('Error writing BabylonReactNative cache file:', err); + process.exit(1); + } }); + }) + .pipe(gunzip) // Unzip the response + .pipe(untar) // Extract the tar file + .on('error', (err) => { + console.error('Error extracting the tar.gz file:', err); + process.exit(1); + }); } else { console.error('Failed to download the file. Status code:', response.statusCode); process.exit(1); @@ -84,21 +136,34 @@ function Install() { console.error("Unsupported react native version."); process.exit(1); } - console.log(`Downloading Babylon React Native version ${reactNativePostfix} from Package version ${packageJson.version}.`); + console.log(`Using Babylon React Native version ${reactNativePostfix} from Package version ${packageJson.version}.`); + + const jsArchive = 'react-native.tar.gz'; + const iosAndroidArchive = `iOSAndroid${reactNativePostfix}.tar.gz`; + const windowsArchive = `Windows${reactNativePostfix}.tar.gz`; - const reactNative = getBinaryUrl(packageJson, 'react-native.tar.gz'); - const reactNativeiOSAndroid = getBinaryUrl(packageJson, `iOSAndroid${reactNativePostfix}.tar.gz`); + const jsArchiveCachedPath = getCached(packageJson, jsArchive); + const iosAndroidArchiveCachedPath = getCached(packageJson, iosAndroidArchive); + const windowsArchiveCachedPath = getCached(packageJson, windowsArchive); - // Start the download and extraction process - downloadAndExtract(reactNative); - downloadAndExtract(reactNativeiOSAndroid); + if (!useCachedFile(jsArchiveCachedPath)) { + const reactNative = getBinaryUrl(packageJson, jsArchive); + downloadExtractAndCache(reactNative, jsArchiveCachedPath); + } + + if (!useCachedFile(iosAndroidArchiveCachedPath)) { + const reactNativeiOSAndroid = getBinaryUrl(packageJson, iosAndroidArchive); + downloadExtractAndCache(reactNativeiOSAndroid, iosAndroidArchiveCachedPath); + } // check and download Windows binary if react-native-windows is found in project package const reactNativeWindowsVersion = projectPackageJson.dependencies['react-native-windows']; if (reactNativeWindowsVersion) { console.log("react-native-windows detected."); - const reactNativeiOSWindows = getBinaryUrl(packageJson, `Windows${reactNativePostfix}.tar.gz`); - downloadAndExtract(reactNativeiOSWindows); + if (!useCachedFile(windowsArchiveCachedPath)) { + const reactNativeiOSWindows = getBinaryUrl(packageJson, windowsArchive); + downloadExtractAndCache(reactNativeiOSWindows, windowsArchiveCachedPath); + } } } else { console.error("No react-native version found for BabylonReactNative."); From 96c21bfd8f603b3555e50e479bd58db159305d92 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Tue, 24 Oct 2023 15:55:06 +0200 Subject: [PATCH 10/23] test append to release --- .github/workflows/append_release.yml | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/append_release.yml b/.github/workflows/append_release.yml index 93cff286a..63633e865 100644 --- a/.github/workflows/append_release.yml +++ b/.github/workflows/append_release.yml @@ -157,23 +157,23 @@ jobs: index.ts outPath: Windows0.71.tar.gz - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: | - react-native.tar.gz - Windows0.69.tar.gz - Windows0.70.tar.gz - Windows0.71.tar.gz - iOSAndroid0.69.tar.gz - iOSAndroid0.70.tar.gz - iOSAndroid0.71.tar.gz - tag_name: ${{ inputs.release-name }} - name: ${{ inputs.release-name }} - body: "Release for ${{ inputs.release-name }}" - draft: false - prerelease: false - if: ${{ inputs.is-preview }} == true +# - name: Release +# uses: softprops/action-gh-release@v1 +# with: +# files: | +# react-native.tar.gz +# Windows0.69.tar.gz +# Windows0.70.tar.gz +# Windows0.71.tar.gz +# iOSAndroid0.69.tar.gz +# iOSAndroid0.70.tar.gz +# iOSAndroid0.71.tar.gz +# tag_name: ${{ inputs.release-name }} +# name: ${{ inputs.release-name }} +# body: "Release for ${{ inputs.release-name }}" +# draft: false +# prerelease: false +# if: ${{ inputs.is-preview }} == true - name: Release uses: softprops/action-gh-release@v1 @@ -186,4 +186,4 @@ jobs: iOSAndroid0.69.tar.gz iOSAndroid0.70.tar.gz iOSAndroid0.71.tar.gz - if: ${{ inputs.is-preview }} == false \ No newline at end of file +# if: ${{ inputs.is-preview }} == false \ No newline at end of file From c2fa5802cd104060d2a75305b45aae5e628208f1 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Tue, 24 Oct 2023 17:37:22 +0200 Subject: [PATCH 11/23] preview parameter check --- .github/workflows/append_release.yml | 37 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/append_release.yml b/.github/workflows/append_release.yml index 63633e865..88b135c0b 100644 --- a/.github/workflows/append_release.yml +++ b/.github/workflows/append_release.yml @@ -157,25 +157,27 @@ jobs: index.ts outPath: Windows0.71.tar.gz -# - name: Release -# uses: softprops/action-gh-release@v1 -# with: -# files: | -# react-native.tar.gz -# Windows0.69.tar.gz -# Windows0.70.tar.gz -# Windows0.71.tar.gz -# iOSAndroid0.69.tar.gz -# iOSAndroid0.70.tar.gz -# iOSAndroid0.71.tar.gz -# tag_name: ${{ inputs.release-name }} -# name: ${{ inputs.release-name }} -# body: "Release for ${{ inputs.release-name }}" -# draft: false -# prerelease: false -# if: ${{ inputs.is-preview }} == true + - name: Preview Release + if: ${{ inputs.is-preview == 'true' }} + uses: softprops/action-gh-release@v1 + with: + files: | + react-native.tar.gz + Windows0.69.tar.gz + Windows0.70.tar.gz + Windows0.71.tar.gz + iOSAndroid0.69.tar.gz + iOSAndroid0.70.tar.gz + iOSAndroid0.71.tar.gz + tag_name: ${{ inputs.release-name }} + name: ${{ inputs.release-name }} + body: "Preview release for ${{ inputs.release-name }}" + draft: true + prerelease: true + if: ${{ inputs.is-preview }} == true - name: Release + if: ${{ inputs.is-preview == 'false' }} uses: softprops/action-gh-release@v1 with: files: | @@ -186,4 +188,3 @@ jobs: iOSAndroid0.69.tar.gz iOSAndroid0.70.tar.gz iOSAndroid0.71.tar.gz -# if: ${{ inputs.is-preview }} == false \ No newline at end of file From d56ae83544f83b84ad8482953aa88daf79e52a28 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Tue, 24 Oct 2023 17:42:07 +0200 Subject: [PATCH 12/23] breaking if --- .github/workflows/append_release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/append_release.yml b/.github/workflows/append_release.yml index 88b135c0b..4ac857bb2 100644 --- a/.github/workflows/append_release.yml +++ b/.github/workflows/append_release.yml @@ -174,7 +174,6 @@ jobs: body: "Preview release for ${{ inputs.release-name }}" draft: true prerelease: true - if: ${{ inputs.is-preview }} == true - name: Release if: ${{ inputs.is-preview == 'false' }} From cf0d89d91c1da0506358e072909578aa266af511 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Tue, 24 Oct 2023 19:05:19 +0200 Subject: [PATCH 13/23] testing boolean --- .github/workflows/append_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/append_release.yml b/.github/workflows/append_release.yml index 4ac857bb2..5a78808a7 100644 --- a/.github/workflows/append_release.yml +++ b/.github/workflows/append_release.yml @@ -158,7 +158,7 @@ jobs: outPath: Windows0.71.tar.gz - name: Preview Release - if: ${{ inputs.is-preview == 'true' }} + if: ${{ inputs.is-preview == true }} uses: softprops/action-gh-release@v1 with: files: | @@ -176,7 +176,7 @@ jobs: prerelease: true - name: Release - if: ${{ inputs.is-preview == 'false' }} + if: ${{ inputs.is-preview == false }} uses: softprops/action-gh-release@v1 with: files: | From af5ba6a41a71949d953bc134689b2d8c8cf8deef Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Wed, 25 Oct 2023 10:55:39 +0200 Subject: [PATCH 14/23] rework install script --- .../react-native-basekit/scripts/install.js | 262 +++++++++++------- 1 file changed, 156 insertions(+), 106 deletions(-) diff --git a/Modules/@babylonjs/react-native-basekit/scripts/install.js b/Modules/@babylonjs/react-native-basekit/scripts/install.js index 6f365da15..4367491d0 100644 --- a/Modules/@babylonjs/react-native-basekit/scripts/install.js +++ b/Modules/@babylonjs/react-native-basekit/scripts/install.js @@ -1,44 +1,52 @@ -const https = require('https'); -const zlib = require('zlib'); -const tar = require('tar'); -const path = require('path'); -const fs = require('fs'); +const https = require("https"); +const zlib = require("zlib"); +const tar = require("tar"); +const path = require("path"); +const fs = require("fs"); function getCachePathCandidates() { return [ - process.env.npm_config_sass_binary_cache, + process.env.npm_config_babylon_binary_cache, process.env.npm_config_cache, - ].filter(function(_) { return _; }); + ].filter(function(_) { + return _; + }); } function getCached(package, binaryFilename) { - return [getCachePathCandidates(), 'BabylonReactNative', package.version, binaryFilename].join('/'); + return [ + getCachePathCandidates(), + "BabylonReactNative", + package.version, + binaryFilename, + ].join("/"); } function useCachedFile(filePath) { - if (fs.existsSync(filePath)) { - console.log(`Using cached file ${filePath}`); - const gunzip = zlib.createGunzip(); - const untar = tar.extract({ cwd: process.cwd() }); // Extract to the current working directory - - const sourceStream = fs.createReadStream(filePath); - sourceStream - .pipe(gunzip) // Decompress the .tar.gz file - .pipe(untar) // Extract the tar contents to the cwd - .on('error', (err) => { - console.error('Error extracting .tar.gz file:', err); - process.exit(1); - }) - .on('end', () => { - console.log('Extraction completed successfully.'); - }); - return true; - } - return false; + return new Promise((resolve, reject) => { + if (fs.existsSync(filePath)) { + const gunzip = zlib.createGunzip(); + const untar = tar.extract({ cwd: process.cwd() }); // Extract to the current working directory + + const sourceStream = fs.createReadStream(filePath); + sourceStream + .pipe(gunzip) // Decompress the .tar.gz file + .pipe(untar) // Extract the tar contents to the cwd + .on("error", (err) => { + reject(err); + }) + .on("end", () => { + resolve(true); + }); + } else { + resolve(false); + } + }); } function getArgument(name) { - const flags = process.argv.slice(2), index = flags.lastIndexOf(name); + const flags = process.argv.slice(2), + index = flags.lastIndexOf(name); if (index === -1 || index + 1 >= flags.length) { return null; @@ -48,67 +56,93 @@ function getArgument(name) { } function getBinaryUrl(package, binaryFilename) { - var site = getArgument('--brn-binary-site') || - process.env.BRN_BINARY_SITE || - process.env.npm_config_brn_binary_site || - (package.nodeBabylonConfig && package.nodeBabylonConfig.binarySite) || - 'https://github.com/CedricGuillemet/BabylonReactNative-1/releases/download'; - - return [site, package.version, binaryFilename].join('/'); + var site = + getArgument("--brn-binary-site") || + process.env.BRN_BINARY_SITE || + process.env.npm_config_brn_binary_site || + (package.nodeBabylonConfig && package.nodeBabylonConfig.binarySite) || + "https://github.com/CedricGuillemet/BabylonReactNative-1/releases/download"; + + return [site, package.version, binaryFilename].join("/"); } -const downloadExtractAndCache = (url, cachedFilePath) => { +function downloadExtractAndCache(url, cachedFilePath, cb) { const options = { followRedirects: true, // Follow HTTP 3xx redirects }; - https.get(url, options, (response) => { - if ([301, 302, 303, 307, 308].includes(response.statusCode)) { - // If the response is a redirect, recursively call downloadExtractAndCache with the new URL - downloadExtractAndCache(response.headers.location, cachedFilePath); - } else if (response.statusCode === 200) { - const gunzip = zlib.createGunzip(); - const untar = tar.extract({ cwd: process.cwd() }); // Extract to the current working directory - - // create cache directory to store download file - try { - fs.mkdirSync(path.dirname(cachedFilePath), {recursive: true}); - } catch (err) { - console.error('Unable to create directory for cache', err); - process.exit(1); - } - - const chunks = []; - response.on('data', (chunk) =>{ - chunks.push(chunk); - }) - .on('end', (err) => { - const fileData = Buffer.concat(chunks); - fs.writeFile(cachedFilePath, fileData, (err) => { - if (err) { - console.error('Error writing BabylonReactNative cache file:', err); - process.exit(1); + https + .get(url, options, (response) => { + if ([301, 302, 303, 307, 308].includes(response.statusCode)) { + // If the response is a redirect, recursively call downloadExtractAndCache with the new URL + downloadExtractAndCache(response.headers.location, cachedFilePath, cb); + } else if (response.statusCode === 200) { + const gunzip = zlib.createGunzip(); + const untar = tar.extract({ cwd: process.cwd() }); // Extract to the current working directory + + // create cache directory to store download file + const dir = path.dirname(cachedFilePath); + try { + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); } + } catch (err) { + reject(err); + } + + var file = fs.createWriteStream(cachedFilePath); + + response + .pipe(gunzip) // Unzip the response + .pipe(untar) // Extract the tar file + .on("error", (err) => { + reject(err); + }); + response.pipe(file); + file.on("finish", () => { + file.close((err) => { + if (err) { + reject(err); + } else { + cb(); + } + }); // close() is async, call cb after close completes. }); + } else { + reject( + `Failed to download the file. Status code: ${response.statusCode}` + ); + } + }) + .on("error", (err) => { + cb(err); + }); +} + +function installZip(filePath, fileURL) { + return new Promise((resolve, reject) => { + useCachedFile(filePath) + .then((result) => { + if (result) { + resolve(true); + } else { + // File does not exist in cache + downloadExtractAndCache(fileURL, filePath, (err) => { + if (err) { + reject(err); + } else { + resolve(true); + } + }); + } }) - .pipe(gunzip) // Unzip the response - .pipe(untar) // Extract the tar file - .on('error', (err) => { - console.error('Error extracting the tar.gz file:', err); - process.exit(1); + .catch((err) => { + reject(err); }); - } else { - console.error('Failed to download the file. Status code:', response.statusCode); - process.exit(1); - } - }) - .on('error', (err) => { - console.error('Error downloading the file:', err); - process.exit(1); }); -}; +} -function Install() { +function install() { // get Babylon React Native package version const packageJsonPath = process.env.npm_package_json; const packageJson = require(packageJsonPath); @@ -117,58 +151,74 @@ function Install() { process.exit(1); } // get user project react-native version - const projectPackageJsonPath = process.env.npm_config_local_prefix + '/package.json'; + const projectPackageJsonPath = + process.env.npm_config_local_prefix + "/package.json"; // Read the project's package.json file const projectPackageJson = require(projectPackageJsonPath); // Check if the project's package.json has a 'react-native' dependency - if (projectPackageJson.dependencies && projectPackageJson.dependencies['react-native']) { - const reactNativeVersion = projectPackageJson.dependencies['react-native']; + if ( + projectPackageJson.dependencies && + projectPackageJson.dependencies["react-native"] + ) { + const reactNativeVersion = projectPackageJson.dependencies["react-native"]; console.log(`Detected React Native version: ${reactNativeVersion}`); reactNativePostfix = ""; - if (reactNativeVersion >= '0.71') { + if (reactNativeVersion >= "0.71") { reactNativePostfix = "0.71"; - } else if (reactNativeVersion >= '0.70') { + } else if (reactNativeVersion >= "0.70") { reactNativePostfix = "0.70"; - } else if (reactNativeVersion >= '0.69') { + } else if (reactNativeVersion >= "0.69") { reactNativePostfix = "0.69"; } else { console.error("Unsupported react native version."); process.exit(1); } - console.log(`Using Babylon React Native version ${reactNativePostfix} from Package version ${packageJson.version}.`); + console.log( + `Using Babylon React Native version ${reactNativePostfix} from Package version ${packageJson.version}.` + ); - const jsArchive = 'react-native.tar.gz'; + const jsArchive = "react-native.tar.gz"; const iosAndroidArchive = `iOSAndroid${reactNativePostfix}.tar.gz`; const windowsArchive = `Windows${reactNativePostfix}.tar.gz`; const jsArchiveCachedPath = getCached(packageJson, jsArchive); - const iosAndroidArchiveCachedPath = getCached(packageJson, iosAndroidArchive); + const iosAndroidArchiveCachedPath = getCached( + packageJson, + iosAndroidArchive + ); const windowsArchiveCachedPath = getCached(packageJson, windowsArchive); - if (!useCachedFile(jsArchiveCachedPath)) { - const reactNative = getBinaryUrl(packageJson, jsArchive); - downloadExtractAndCache(reactNative, jsArchiveCachedPath); - } - - if (!useCachedFile(iosAndroidArchiveCachedPath)) { - const reactNativeiOSAndroid = getBinaryUrl(packageJson, iosAndroidArchive); - downloadExtractAndCache(reactNativeiOSAndroid, iosAndroidArchiveCachedPath); - } - - // check and download Windows binary if react-native-windows is found in project package - const reactNativeWindowsVersion = projectPackageJson.dependencies['react-native-windows']; - if (reactNativeWindowsVersion) { - console.log("react-native-windows detected."); - if (!useCachedFile(windowsArchiveCachedPath)) { - const reactNativeiOSWindows = getBinaryUrl(packageJson, windowsArchive); - downloadExtractAndCache(reactNativeiOSWindows, windowsArchiveCachedPath); - } - } + const jsArchiveURL = getBinaryUrl(packageJson, jsArchive); + const iOSAndroidArchiveURL = getBinaryUrl(packageJson, iosAndroidArchive); + const windowsArchiveURL = getBinaryUrl(packageJson, windowsArchive); + + const reactNativeWindowsVersion = + projectPackageJson.dependencies["react-native-windows"]; + installZip(jsArchiveCachedPath, jsArchiveURL) + .then((result) => { + installZip(iosAndroidArchiveCachedPath, iOSAndroidArchiveURL) + .then((result) => { + if (reactNativeWindowsVersion) { + installZip(windowsArchiveCachedPath, windowsArchiveURL) + .then((result) => {}) + .catch((err) => { + reject(err); + }); + } + }) + .catch((err) => { + reject(err); + }); + }) + .catch((err) => { + console.error("Error install BabylonReactNative archive:", err); + process.exit(1); + }); } else { console.error("No react-native version found for BabylonReactNative."); process.exit(1); } } -Install(); \ No newline at end of file +install(); From 47bc45bbabb8ff086b456c4025d704eeeee5ec76 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Wed, 25 Oct 2023 11:35:25 +0200 Subject: [PATCH 15/23] set java 17 as java 18 is not compatible with android projects --- .github/workflows/bn_master_commit.yml | 6 ++++++ .github/workflows/ios_android.yml | 6 ++++++ .github/workflows/pr.yml | 6 ++++++ .github/workflows/test_version.yml | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/.github/workflows/bn_master_commit.yml b/.github/workflows/bn_master_commit.yml index 5549249a9..b61178c86 100644 --- a/.github/workflows/bn_master_commit.yml +++ b/.github/workflows/bn_master_commit.yml @@ -35,6 +35,12 @@ jobs: - name: NPM Install (Binary Package) run: npm install working-directory: ./Package + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + check-latest: true - name: Gulp (Android) run: npx gulp buildAndroid working-directory: ./Package diff --git a/.github/workflows/ios_android.yml b/.github/workflows/ios_android.yml index 996ecf749..f887e8384 100644 --- a/.github/workflows/ios_android.yml +++ b/.github/workflows/ios_android.yml @@ -33,6 +33,12 @@ jobs: run: brew install ninja - name: 'Select XCode ${{ inputs.xcode-version }}' run: sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-version }}.app/Contents/Developer + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + check-latest: true - name: NPM Install (Playground) run: npm install working-directory: ./Apps/Playground diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 305b1caaa..0bb4519fd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -33,6 +33,12 @@ jobs: - name: NPM Install (Binary Package) run: npm install working-directory: ./Package + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + check-latest: true - name: Gulp (Android) run: npx gulp buildAndroid working-directory: ./Package diff --git a/.github/workflows/test_version.yml b/.github/workflows/test_version.yml index 0f639e9d8..7554a9c83 100644 --- a/.github/workflows/test_version.yml +++ b/.github/workflows/test_version.yml @@ -66,6 +66,12 @@ jobs: uses: actions/setup-node@v3 with: node-version: 16 + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + check-latest: true - name: Build Playground Android run: | npm uninstall -g react-native-cli @react-native-community/cli From b857f1b0d450e0758c1d67897442caabfc797fa8 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Wed, 25 Oct 2023 14:57:43 +0200 Subject: [PATCH 16/23] Readme and version check --- .../@babylonjs/react-native-basekit/README.md | 16 ++++------------ .../react-native-basekit/scripts/install.js | 9 ++++++--- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Modules/@babylonjs/react-native-basekit/README.md b/Modules/@babylonjs/react-native-basekit/README.md index 127697552..5de186e4c 100644 --- a/Modules/@babylonjs/react-native-basekit/README.md +++ b/Modules/@babylonjs/react-native-basekit/README.md @@ -1,4 +1,4 @@ -# Babylon React Native +# Babylon React Native Basekit ## Usage @@ -8,8 +8,6 @@ This quick overview will help you understand the constructs provided by Babylon This package has several **peer dependencies**. If these dependencies are unmet, `npm install` will emit warnings. Be sure to add these dependencies to your project. -The `react-native-permissions` dependency is required for XR capabilities of Babylon.js (to request camera permissions automatically). Be sure to follow the `react-native-permissions` [instructions](https://github.com/react-native-community/react-native-permissions#setup) to update your `Podfile` and `Info.plist` (iOS) and/or `AndroidManifest.xml` (Android). - ### Android Configuration The minimum Android SDK version is 18. This must be set as `minSdkVersion` in the consuming project's `build.gradle` file. @@ -20,20 +18,14 @@ The minimum deployment target version is 12. This must be set as `iOS Deployment ### Platform Native Packages -Babylon React Native platform native packages must also be installed for the platforms and React Native versions being targeted. This is only needed for ***apps*** using Babylon React Native, not for ***libraries (React Native packages)*** building on top of Babylon React Native. - -| | React Native 0.63 - 0.64 | React Native 0.65 - 0.66 | React Native 0.69 | React Native 0.70 | -| ------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| Android | [@babylonjs/react-native-iosandroid-0-64](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-64) | [@babylonjs/react-native-iosandroid-0-65](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-65) | [@babylonjs/react-native-iosandroid-0-69](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-69) | [@babylonjs/react-native-iosandroid-0-70](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-70) | -| iOS | [@babylonjs/react-native-iosandroid-0-64](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-64) | [@babylonjs/react-native-iosandroid-0-65](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-65) | [@babylonjs/react-native-iosandroid-0-69](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-69) | [@babylonjs/react-native-iosandroid-0-70](https://www.npmjs.com/package/@babylonjs/react-native-iosandroid-0-70) | -| Windows | [@babylonjs/react-native-windows-0-64](https://www.npmjs.com/package/@babylonjs/react-native-windows-0-64) | [@babylonjs/react-native-windows-0-65](https://www.npmjs.com/package/@babylonjs/react-native-windows-0-65) | [@babylonjs/react-native-windows-0-69](https://www.npmjs.com/package/@babylonjs/react-native-windows-0-69) | [@babylonjs/react-native-windows-0-70](https://www.npmjs.com/package/@babylonjs/react-native-windows-0-70) | +Babylon React Native supports react-native from 0.69 to 0.71+. See project Github main readme for supported versions. ### `useEngine` `useEngine` is a **custom React hook** that manages the lifecycle of a Babylon engine instance in the context of an owning React component. `useEngine` creates an engine instance **asynchronously** which is used to create and configure scenes. Typically scene initialization code should exist in a `useEffect` triggered by an `engine` state change. For example: ```tsx -import { useEngine } from '@babylonjs/react-native'; +import { useEngine } from '@babylonjs/react-native-basekit'; import { Engine, Scene } from '@babylonjs/core'; const MyComponent: FunctionComponent = (props: MyComponentProps) => { @@ -58,7 +50,7 @@ const MyComponent: FunctionComponent = (props: MyComponentProp `EngineView` is a **custom React Native view** that presents a `camera` from a Babylon `scene`. A `camera` therefore is assigned to the `EngineView`. For example: ```tsx -import { useEngine, EngineView } from '@babylonjs/react-native'; +import { useEngine, EngineView } from '@babylonjs/react-native-basekit'; import { Engine, Scene, Camera } from '@babylonjs/core'; const MyComponent: FunctionComponent = (props: MyComponentProps) => { diff --git a/Modules/@babylonjs/react-native-basekit/scripts/install.js b/Modules/@babylonjs/react-native-basekit/scripts/install.js index 4367491d0..b3e68b164 100644 --- a/Modules/@babylonjs/react-native-basekit/scripts/install.js +++ b/Modules/@babylonjs/react-native-basekit/scripts/install.js @@ -163,12 +163,15 @@ function install() { ) { const reactNativeVersion = projectPackageJson.dependencies["react-native"]; console.log(`Detected React Native version: ${reactNativeVersion}`); + + const [_, packageMinor] = reactNativeVersion.split('.').map(Number); + reactNativePostfix = ""; - if (reactNativeVersion >= "0.71") { + if (packageMinor >= "71") { reactNativePostfix = "0.71"; - } else if (reactNativeVersion >= "0.70") { + } else if (packageMinor >= "70") { reactNativePostfix = "0.70"; - } else if (reactNativeVersion >= "0.69") { + } else if (packageMinor >= "69") { reactNativePostfix = "0.69"; } else { console.error("Unsupported react native version."); From 534eda4154f04d625210dd9adcdb615e9443c94b Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Wed, 25 Oct 2023 15:01:39 +0200 Subject: [PATCH 17/23] removed dry run for publish --- .github/workflows/publish.yml | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a1aae2ac0..4a8c0a098 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -182,7 +182,7 @@ jobs: - name: Version & Publish Package @babylonjs/react-native run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -190,35 +190,35 @@ jobs: - name: Version & Publish Package @babylonjs/react-native-iosandroid-0-64 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-iOSAndroid0.64 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-iosandroid-0-65 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-iOSAndroid0.65 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-iosandroid-0-69 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-iOSAndroid0.69 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-iosandroid-0-70 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-iOSAndroid0.70 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-iosandroid-0-71 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-iOSAndroid0.71 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -226,35 +226,35 @@ jobs: - name: Version & Publish Package @babylonjs/react-native-windows-0-64 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-Windows0.64 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-windows-0-65 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-Windows0.65 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-windows-0-69 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-Windows0.69 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-windows-0-70 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-Windows0.70 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-windows-0-71 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-Windows0.71 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -262,42 +262,42 @@ jobs: - name: Version & Publish Package @babylonjs/react-native-basekit-iosandroid-0-69 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-BaseKit-iOSAndroid0.69 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-basekit-iosandroid-0-70 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-BaseKit-iOSAndroid0.70 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-basekit-iosandroid-0-71 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-BaseKit-iOSAndroid0.71 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-basekit-windows-0-69 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-BaseKit-Windows0.69 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-basekit-windows-0-70 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-BaseKit-Windows0.70 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Version & Publish Package @babylonjs/react-native-basekit-windows-0-71 run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Package/Assembled-BaseKit-Windows0.71 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -305,7 +305,7 @@ jobs: - name: Version & Publish Package @babylonjs/react-native-basekit run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} - npm publish --access public --dry-run + npm publish --access public working-directory: ./Modules/@babylonjs/react-native-basekit env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file From 648c79f5abd5e604ad287f976278ce13f4eafe31 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Wed, 25 Oct 2023 15:30:18 +0200 Subject: [PATCH 18/23] installation configuration --- Modules/@babylonjs/react-native-basekit/README.md | 12 ++++++++++++ .../react-native-basekit/scripts/install.js | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Modules/@babylonjs/react-native-basekit/README.md b/Modules/@babylonjs/react-native-basekit/README.md index 5de186e4c..26cd60093 100644 --- a/Modules/@babylonjs/react-native-basekit/README.md +++ b/Modules/@babylonjs/react-native-basekit/README.md @@ -8,6 +8,18 @@ This quick overview will help you understand the constructs provided by Babylon This package has several **peer dependencies**. If these dependencies are unmet, `npm install` will emit warnings. Be sure to add these dependencies to your project. +### Installation Configuration + +Downloaded dependencies are cache by default in directory specifiec by `npm_config_cache`. It's possible to specify a new cache directory by setting `npm_config_babylon_binary_cache` environment variable. + +Also, it's possible to set the source of these downloaded dependencies. By default, it's using main Github repo releases: `https://github.com/BabylonJS/BabylonReactNative/releases/download`. +Other possibilities are: +- By command argument for `npm install` : `--brn-binary-site=https://mysite.com/downloads` +- By environment variable `export npm_config_brn_binary_site=https://mysite.com/downloads` +- By configuration in package.json: `nodeBabylonConfig: { binarySite: 'https://mysite.com/downloads'}` + +These case location must respect same hierarchy as the main Github repo releases. + ### Android Configuration The minimum Android SDK version is 18. This must be set as `minSdkVersion` in the consuming project's `build.gradle` file. diff --git a/Modules/@babylonjs/react-native-basekit/scripts/install.js b/Modules/@babylonjs/react-native-basekit/scripts/install.js index b3e68b164..ccf1655b4 100644 --- a/Modules/@babylonjs/react-native-basekit/scripts/install.js +++ b/Modules/@babylonjs/react-native-basekit/scripts/install.js @@ -61,7 +61,7 @@ function getBinaryUrl(package, binaryFilename) { process.env.BRN_BINARY_SITE || process.env.npm_config_brn_binary_site || (package.nodeBabylonConfig && package.nodeBabylonConfig.binarySite) || - "https://github.com/CedricGuillemet/BabylonReactNative-1/releases/download"; + "https://github.com/BabylonJS/BabylonReactNative/releases/download"; return [site, package.version, binaryFilename].join("/"); } From b75226464341091461ae60f81c541e40e07568b5 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Thu, 26 Oct 2023 11:30:38 +0200 Subject: [PATCH 19/23] basekit package version set to 0.0.1 --- Modules/@babylonjs/react-native-basekit/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/@babylonjs/react-native-basekit/package.json b/Modules/@babylonjs/react-native-basekit/package.json index f670748a0..6b332627b 100644 --- a/Modules/@babylonjs/react-native-basekit/package.json +++ b/Modules/@babylonjs/react-native-basekit/package.json @@ -1,7 +1,7 @@ { "name": "@babylonjs/react-native-basekit", "title": "React Native Babylon Basekit", - "version": "2.0.2", + "version": "0.0.1", "description": "Babylon Native integration into React Native", "main": "index.js", "scripts": { From ce9bc16ce8d3f07f98ffd2a058747d0f5409240e Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Fri, 27 Oct 2023 11:06:32 +0200 Subject: [PATCH 20/23] feedback --- .../@babylonjs/react-native-basekit/README.md | 7 +++---- .../react-native-basekit/scripts/install.js | 18 ++++++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Modules/@babylonjs/react-native-basekit/README.md b/Modules/@babylonjs/react-native-basekit/README.md index 26cd60093..7945af469 100644 --- a/Modules/@babylonjs/react-native-basekit/README.md +++ b/Modules/@babylonjs/react-native-basekit/README.md @@ -10,13 +10,12 @@ This package has several **peer dependencies**. If these dependencies are unmet, ### Installation Configuration -Downloaded dependencies are cache by default in directory specifiec by `npm_config_cache`. It's possible to specify a new cache directory by setting `npm_config_babylon_binary_cache` environment variable. +Downloaded dependencies are cached by default in directory specified by `npm_config_cache`. It's possible to specify a new cache directory by setting `npm_config_babylon_binary_cache` environment variable. Also, it's possible to set the source of these downloaded dependencies. By default, it's using main Github repo releases: `https://github.com/BabylonJS/BabylonReactNative/releases/download`. Other possibilities are: -- By command argument for `npm install` : `--brn-binary-site=https://mysite.com/downloads` -- By environment variable `export npm_config_brn_binary_site=https://mysite.com/downloads` -- By configuration in package.json: `nodeBabylonConfig: { binarySite: 'https://mysite.com/downloads'}` +- By command argument for `npm install --brn-binary-site https://mysite.com/downloads` +- By environment variable. on MacOS/Linux: `export npm_config_brn_binary_site=https://mysite.com/downloads` These case location must respect same hierarchy as the main Github repo releases. diff --git a/Modules/@babylonjs/react-native-basekit/scripts/install.js b/Modules/@babylonjs/react-native-basekit/scripts/install.js index ccf1655b4..c1b83140e 100644 --- a/Modules/@babylonjs/react-native-basekit/scripts/install.js +++ b/Modules/@babylonjs/react-native-basekit/scripts/install.js @@ -45,8 +45,8 @@ function useCachedFile(filePath) { } function getArgument(name) { - const flags = process.argv.slice(2), - index = flags.lastIndexOf(name); + const flags = process.argv.slice(2); + const index = flags.lastIndexOf(name); if (index === -1 || index + 1 >= flags.length) { return null; @@ -56,11 +56,10 @@ function getArgument(name) { } function getBinaryUrl(package, binaryFilename) { - var site = + const site = getArgument("--brn-binary-site") || process.env.BRN_BINARY_SITE || process.env.npm_config_brn_binary_site || - (package.nodeBabylonConfig && package.nodeBabylonConfig.binarySite) || "https://github.com/BabylonJS/BabylonReactNative/releases/download"; return [site, package.version, binaryFilename].join("/"); @@ -71,8 +70,7 @@ function downloadExtractAndCache(url, cachedFilePath, cb) { followRedirects: true, // Follow HTTP 3xx redirects }; - https - .get(url, options, (response) => { + https.get(url, options, (response) => { if ([301, 302, 303, 307, 308].includes(response.statusCode)) { // If the response is a redirect, recursively call downloadExtractAndCache with the new URL downloadExtractAndCache(response.headers.location, cachedFilePath, cb); @@ -87,7 +85,7 @@ function downloadExtractAndCache(url, cachedFilePath, cb) { fs.mkdirSync(dir, { recursive: true }); } } catch (err) { - reject(err); + cb(err); } var file = fs.createWriteStream(cachedFilePath); @@ -96,20 +94,20 @@ function downloadExtractAndCache(url, cachedFilePath, cb) { .pipe(gunzip) // Unzip the response .pipe(untar) // Extract the tar file .on("error", (err) => { - reject(err); + cb(err); }); response.pipe(file); file.on("finish", () => { file.close((err) => { if (err) { - reject(err); + cb(err); } else { cb(); } }); // close() is async, call cb after close completes. }); } else { - reject( + cb( `Failed to download the file. Status code: ${response.statusCode}` ); } From 386b67732abeca5e73ab34f60c1c80de3820160f Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Wed, 8 Nov 2023 11:04:11 +0100 Subject: [PATCH 21/23] tabs replaced with spaces --- .../windows/BabylonReactNative/BabylonReactNative.vcxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/@babylonjs/react-native-windows/windows/BabylonReactNative/BabylonReactNative.vcxproj b/Modules/@babylonjs/react-native-windows/windows/BabylonReactNative/BabylonReactNative.vcxproj index d925cac4e..4843178eb 100644 --- a/Modules/@babylonjs/react-native-windows/windows/BabylonReactNative/BabylonReactNative.vcxproj +++ b/Modules/@babylonjs/react-native-windows/windows/BabylonReactNative/BabylonReactNative.vcxproj @@ -22,15 +22,15 @@ $(ProjectDir)\..\..\..\..\..\node_modules\react-native-windows\ - - $(ProjectDir)\..\..\..\..\..\node_modules\react-native-basekit\ + + $(ProjectDir)\..\..\..\..\..\node_modules\react-native-basekit\ $(SolutionDir)\..\node_modules\react-native-windows\ $(ProjectDir)\..\..\..\..\..\Apps\Playground\Playground\node_modules\react-native-windows\ - $(ProjectDir)..\..\..\react-native-basekit\ + $(ProjectDir)..\..\..\react-native-basekit\ $(ProjectDir)..\..\..\react-native-iosandroid\ $(ProjectDir)..\..\..\react-native\ $(BabylonReactNativeDir)Build\ @@ -170,7 +170,7 @@ $(BabylonReactNativeDir)shared;%(AdditionalIncludeDirectories) $(BabylonNativeIOSAndroidProjDir)shared;%(AdditionalIncludeDirectories) - $(BabylonNativeBasekitProjDir)shared;%(AdditionalIncludeDirectories) + $(BabylonNativeBasekitProjDir)shared;%(AdditionalIncludeDirectories) %(IgnoreSpecificDefaultLibraries) From de255c66f8dab112e0c9b4fb88ad301db82e8eb7 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Wed, 8 Nov 2023 11:26:39 +0100 Subject: [PATCH 22/23] missing java setup --- .github/workflows/pr.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0bb4519fd..9caaa44ef 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -86,6 +86,12 @@ jobs: cmake-version: '3.26.3' - name: Setup Ninja run: brew install ninja + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + check-latest: true - name: NPM Install (Playground) run: npm install working-directory: ./Apps/Playground From 6b4b76d04fff6eb1320f80b209ed5aa05178093e Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Tue, 14 Nov 2023 17:48:40 +0100 Subject: [PATCH 23/23] tar command --- .github/workflows/append_release.yml | 41 ++-------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/.github/workflows/append_release.yml b/.github/workflows/append_release.yml index 5a78808a7..71cd9b042 100644 --- a/.github/workflows/append_release.yml +++ b/.github/workflows/append_release.yml @@ -18,45 +18,10 @@ jobs: with: name: 'Assembled' path: Package/react-native + - name: Compress Package react-native - uses: a7ul/tar-action@v1.1.3 - id: compressreact-native - with: - command: c - cwd: Package/react-native/ - files: | # all files except package.json and readme.md - BabylonModule.d.ts - BabylonModule.js - BabylonModule.js.map - EngineHook.d.ts - EngineHook.js - EngineHook.js.map - EngineView.d.ts - EngineView.js - EngineView.js.map - FontFace.d.ts - FontFace.js - FontFace.js.map - index.d.ts - index.js - index.js.map - NativeCapture.d.ts - NativeCapture.js - NativeCapture.js.map - NativeEngineHook.d.ts - NativeEngineHook.js - NativeEngineHook.js.map - NativeEngineView.d.ts - NativeEngineView.js - NativeEngineView.js.map - ReactNativeEngine.d.ts - ReactNativeEngine.js - ReactNativeEngine.js.map - shared - VersionValidation.d.ts - VersionValidation.js - VersionValidation.js.map - outPath: react-native.tar.gz + run: | + tar --exclude='readme.md' --exclude='package.json' -czvf react-native.tar.gz -C Package/react-native/ . - name: Download Assembled-BaseKit-iOSAndroid 0.69 Folder uses: actions/download-artifact@v2