Skip to content

Commit 759cd45

Browse files
fix gradle and cmake for Windows local PG 0.71 builds (#577)
* fix gradle and cmake for windows local PG 0.71 builds * fix APK permissions * Update Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt Co-authored-by: Ryan Tremblay <[email protected]> * up RN version * Fix too many files copied to assembler directory * missing build dep * no libturbomodulejsijni for 0.71 * msbuild version * msbuild version * indentation * yaml * expected files * turbo module x64 --------- Co-authored-by: Ryan Tremblay <[email protected]>
1 parent f511002 commit 759cd45

File tree

5 files changed

+106
-173
lines changed

5 files changed

+106
-173
lines changed

.github/workflows/publish_preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
release-version: ${{ github.event.inputs.release_version }}
8181

8282
package:
83-
needs: [build-typescript, build-android-ios-064, build-android-ios-065, build-android-ios-069, build-android-ios-070, build-windows-064, build-windows-065, build-windows-069, build-windows-070]
83+
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]
8484
runs-on: macos-latest
8585
steps:
8686
- name: Checkout Repo

.github/workflows/testVersion.yml

Lines changed: 80 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -17,94 +17,102 @@ on:
1717
required: true
1818
type: string
1919
default: '0-71'
20+
BJS_Version:
21+
description: 'Babylon.js version'
22+
required: true
23+
type: string
24+
default: '6.0'
2025

2126
jobs:
2227
build-windows:
2328
runs-on: windows-2019
2429
steps:
25-
- name: Checkout Repo
26-
uses: actions/[email protected]
27-
- name: Add msbuild to PATH
28-
uses: microsoft/setup-msbuild@v1.1
29-
- name: Build Playground Windows x64
30-
run: |
31-
npx react-native init Playground --version ${{ github.event.inputs.RN_Version }}
32-
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
33-
cd Playground
34-
npx react-native-windows-init --overwrite
35-
npm install @babylonjs/core
36-
npm install @babylonjs/loaders
37-
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
38-
npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
39-
npm install @react-native-community/slider
40-
#npm install react-native-permissions@3.0.0
41-
npx react-native autolink-windows
42-
msbuild.exe /r "./windows/Playground.sln"
43-
msbuild.exe /p:Configuration="Release" /p:Platform="x64" /m "./windows/Playground.sln"
30+
- name: Checkout Repo
31+
uses: actions/[email protected]
32+
- name: Setup MSBuild
33+
uses: microsoft/setup-msbuild@v1.0.2
34+
- name: Build Playground Windows x64
35+
run: |
36+
npx react-native init Playground --version ${{ github.event.inputs.RN_Version }}
37+
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
38+
cd Playground
39+
npx react-native-windows-init --overwrite
40+
npm install @babylonjs/core@${{ github.event.inputs.BJS_Version }}
41+
npm install @babylonjs/loaders@${{ github.event.inputs.BJS_Version }}
42+
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
43+
npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
44+
npm install @react-native-community/slider
45+
# npm install react-native-permissions
46+
npx react-native autolink-windows
47+
msbuild.exe /r "./windows/Playground.sln"
48+
msbuild.exe /p:Configuration="Release" /p:Platform="x64" /m "./windows/Playground.sln"
4449
45-
- name: Upload UWP x64
46-
uses: actions/upload-artifact@v2
47-
with:
48-
name: 'WindowsAppx'
49-
path: Playground/windows/AppPackages/Playground/Playground_1.0.0.0_x64_Test/Playground_1.0.0.0_x64.appx
50+
- name: Upload UWP x64
51+
uses: actions/upload-artifact@v2
52+
with:
53+
name: 'WindowsAppx'
54+
path: Playground/windows/AppPackages/Playground/Playground_1.0.0.0_x64_Test/ #Playground_1.0.0.0_x64.appx
5055

5156
build-android:
5257
runs-on: ubuntu-latest
5358
steps:
54-
- name: Checkout Repo
55-
uses: actions/[email protected]
56-
- name: Build Playground Android
57-
run: |
58-
npm uninstall -g react-native-cli @react-native-community/cli
59-
npx react-native init Playground --version "${{ github.event.inputs.RN_Version }}" --verbose
60-
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
61-
cd Playground
62-
npm install @babylonjs/core
63-
npm install @babylonjs/loaders
64-
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
65-
npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
66-
npm install @react-native-community/slider
67-
cd android
68-
./gradlew app:assembleRelease --stacktrace --info
59+
- name: Checkout Repo
60+
uses: actions/[email protected]
61+
- name: Build Playground Android
62+
run: |
63+
npm uninstall -g react-native-cli @react-native-community/cli
64+
npx react-native init Playground --version "${{ github.event.inputs.RN_Version }}" --verbose
65+
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
66+
cp Apps/Playground/0.71/android/app/src/main/AndroidManifest.xml ./Playground/android/app/src/main/
67+
cd Playground
68+
npm install @babylonjs/core@${{ github.event.inputs.BJS_Version }}
69+
npm install @babylonjs/loaders@${{ github.event.inputs.BJS_Version }}
70+
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
71+
npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
72+
npm install @react-native-community/slider
73+
npm install react-native-permissions
74+
cd android
75+
./gradlew app:assembleRelease --stacktrace --info
6976
70-
- name: Upload APK
71-
uses: actions/upload-artifact@v2
72-
with:
73-
name: 'AndroidAPK'
74-
path: Playground/android/app/build/outputs/apk/release/app-release.apk
77+
- name: Upload APK
78+
uses: actions/upload-artifact@v2
79+
with:
80+
name: 'AndroidAPK'
81+
path: Playground/android/app/build/outputs/apk/release/app-release.apk
7582

7683
build-ios:
7784
runs-on: macos-latest
7885
steps:
79-
- name: Checkout Repo
80-
uses: actions/[email protected]
81-
- name: Clone iOS Toolchain
82-
run: |
83-
git clone https://github.com/leetal/ios-cmake.git
84-
- name: Build Playground iOS
85-
run: |
86-
brew install node
87-
brew install watchman
88-
npm uninstall -g react-native-cli @react-native-community/cli
89-
npx react-native init Playground --version "${{ github.event.inputs.RN_Version }}" --verbose --skip-install
90-
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
91-
cd Playground
92-
yarn install
93-
npm install @babylonjs/core
94-
npm install @babylonjs/loaders
95-
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
96-
npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
97-
npm install @react-native-community/slider
98-
cd ios
99-
pod install
100-
#xcodebuild -sdk iphoneos -configuration Release -workspace Playground.xcworkspace -scheme Playground build CODE_SIGNING_ALLOWED=NO
101-
xcodebuild -sdk iphonesimulator -arch x86_64 -configuration Release -workspace Playground.xcworkspace -scheme Playground build CODE_SIGNING_ALLOWED=NO -archivePath ./playgroundSimulator.xcarchive archive
86+
- name: Checkout Repo
87+
uses: actions/[email protected]
88+
- name: Clone iOS Toolchain
89+
run: |
90+
git clone https://github.com/leetal/ios-cmake.git
91+
- name: Build Playground iOS
92+
run: |
93+
brew install node
94+
brew install watchman
95+
npm uninstall -g react-native-cli @react-native-community/cli
96+
npx react-native init Playground --version "${{ github.event.inputs.RN_Version }}" --verbose --skip-install
97+
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
98+
cd Playground
99+
yarn install
100+
npm install @babylonjs/core@${{ github.event.inputs.BJS_Version }}
101+
npm install @babylonjs/loaders@${{ github.event.inputs.BJS_Version }}
102+
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
103+
npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
104+
npm install @react-native-community/slider
105+
npm install react-native-permissions
106+
cd ios
107+
pod install
108+
#xcodebuild -sdk iphoneos -configuration Release -workspace Playground.xcworkspace -scheme Playground build CODE_SIGNING_ALLOWED=NO
109+
xcodebuild -sdk iphonesimulator -arch x86_64 -configuration Release -workspace Playground.xcworkspace -scheme Playground build CODE_SIGNING_ALLOWED=NO -archivePath ./playgroundSimulator.xcarchive archive
102110
103-
- name: Upload iOS App
104-
uses: actions/upload-artifact@v2
105-
with:
106-
name: 'iOSApp'
107-
path: Playground/ios/playgroundSimulator.xcarchive
111+
- name: Upload iOS App
112+
uses: actions/upload-artifact@v2
113+
with:
114+
name: 'iOSApp'
115+
path: Playground/ios/playgroundSimulator.xcarchive
108116

109117
# test jobs not working
110118
# test-android:

Apps/Playground/0.71/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@babylonjs/playground-shared": "file:../playground-shared",
2222
"@react-native-community/slider": "^4.2.2",
2323
"react": "18.2.0",
24-
"react-native": "0.71.0",
24+
"react-native": "0.71.7",
2525
"react-native-permissions": "^3.6.1",
2626
"react-native-windows": "0.71.1"
2727
},

Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ if (EXISTS "${TURBOMODULE_DIR}/CMakeLists.txt")
6969
endif(CCACHE_FOUND)
7070

7171
set(BUILD_DIR ${PROJECT_BUILD_DIR})
72-
if(CMAKE_HOST_WIN32)
73-
string(REPLACE "\\" "/" BUILD_DIR ${BUILD_DIR})
72+
# When building on Windows, PROJECT_BUILD_DIR might be empty. If it is, then the build breaks because of string replace
73+
if(CMAKE_HOST_WIN32 AND NOT "${PROJECT_BUILD_DIR}" STREQUAL "")
74+
string(REPLACE "\\" "/" BUILD_DIR ${BUILD_DIR})
7475
endif()
7576

7677
target_include_directories(BabylonNative

0 commit comments

Comments
 (0)