Skip to content

Commit 73f8516

Browse files
fix paths
1 parent 15152ab commit 73f8516

File tree

3 files changed

+34
-46
lines changed

3 files changed

+34
-46
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
working-directory: ./Modules
133133

134134
- name: CMake BabylonNative
135-
run: cmake -G "Visual Studio 16 2019" -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0.19041.0 -DCMAKE_UNITY_BUILD=true -D CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM=10.0.19041.0 -A x64 ./../../../react-native-windows/windows
135+
run: cmake -G "Visual Studio 16 2019" -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0.19041.0 -DCMAKE_UNITY_BUILD=true -D CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM=10.0.19041.0 -A x64 ./../../../react-native/windows
136136
working-directory: ./Modules/@babylonjs/react-native/Build/uwp_x64
137137

138138
- name: Nuget restore

Modules/@babylonjs/react-native/windows/BabylonReactNative/BabylonReactNative.vcxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
</PropertyGroup>
2121
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2222
<PropertyGroup Label="ReactNativeWindowsProps">
23-
<!-- First try and resolve react-native-windows package at a relative location when installing the @babylonjs/react-native package in your project -->
24-
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == '' And Exists('$(ProjectDir)..\..\..\..\..\node_modules\react-native-windows\package.json')">$(ProjectDir)\..\..\..\..\..\node_modules\react-native-windows\</ReactNativeWindowsDir>
25-
<!-- Else try and resolve react-native-windows package in the Apps\Playground\node_modules folder relative to the BabylonNative.vcxproj location in the github repo -->
26-
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == '' And Exists('$(SolutionDir)..\node_modules\react-native-windows\package.json')">$(SolutionDir)\..\node_modules\react-native-windows\</ReactNativeWindowsDir>
27-
<!-- If all else failes, try and resolve react-native-windows package using the Playground app node_modules -->
28-
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == '' And Exists('$(ProjectDir)..\..\..\..\..\Apps\Playground\node_modules\react-native-windows\package.json')">$(ProjectDir)\..\..\..\..\..\Apps\Playground\node_modules\react-native-windows\</ReactNativeWindowsDir>
23+
<!-- First try and resolve react-native package at a relative location when installing the @babylonjs/react-native package in your project -->
24+
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == '' And Exists('$(ProjectDir)..\..\..\..\..\node_modules\react-native\package.json')">$(ProjectDir)\..\..\..\..\..\node_modules\react-native\</ReactNativeWindowsDir>
25+
<!-- Else try and resolve react-native package in the Apps\Playground\node_modules folder relative to the BabylonNative.vcxproj location in the github repo -->
26+
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == '' And Exists('$(SolutionDir)..\node_modules\react-native\package.json')">$(SolutionDir)\..\node_modules\react-native\</ReactNativeWindowsDir>
27+
<!-- If all else failes, try and resolve react-native package using the Playground app node_modules -->
28+
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == '' And Exists('$(ProjectDir)..\..\..\..\..\Apps\Playground\node_modules\react-native\package.json')">$(ProjectDir)\..\..\..\..\..\Apps\Playground\node_modules\react-native\</ReactNativeWindowsDir>
2929
</PropertyGroup>
3030
<PropertyGroup Label="BabylonReactNativeProps">
3131
<BabylonReactNativeDir Condition="'$(BabylonReactNativeDir)' == '' And Exists('$(ProjectDir)\..\..\..\react-native')">$(ProjectDir)..\..\..\react-native\</BabylonReactNativeDir>
@@ -295,7 +295,7 @@
295295
</ImportGroup>
296296
<Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
297297
<PropertyGroup>
298-
<ErrorText>This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is {0}.</ErrorText>
298+
<ErrorText>This project references targets in your node_modules\react-native folder that are missing. The missing file is {0}.</ErrorText>
299299
</PropertyGroup>
300300
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props'))" />
301301
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets'))" />
@@ -308,7 +308,7 @@
308308
</Target>
309309
<Target Name="EnsureBabylonReactNative" BeforeTargets="PrepareForBuild">
310310
<PropertyGroup>
311-
<ErrorText>This project is missing BabylonNative static libs. These libs are either distributed with the @babylonjs/react-native-windows npm package or are found through submodule reference</ErrorText>
311+
<ErrorText>This project is missing BabylonNative static libs. These libs are either distributed with the @babylonjs/react-native npm package or are found through submodule reference</ErrorText>
312312
</PropertyGroup>
313313
<Error Condition="!Exists('$(BabylonNativeBuildDir)') And !Exists('$(BabylonNativeLibsDir)')" Text="$(ErrorText)" />
314314
</Target>

Package/gulpfile.js

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,7 @@ const buildTypeScript = async () => {
7979

8080
const makeXCodeProj = async () => {
8181
shelljs.mkdir('-p', 'iOS/Build');
82-
exec(`cmake -B Build -G Xcode ${cmakeBasekitBuildDefinition} -DBUILD_RNAPP_DIR=Playground/Playground`, 'iOS');
83-
};
84-
85-
const makeXCodeProjRNTA = async () => {
86-
shelljs.mkdir('-p', 'iOS/Build');
87-
exec(`cmake -B Build -G Xcode ${cmakeBasekitBuildDefinition} -DBUILD_RNAPP_DIR=BRNPlayground`, 'iOS');
82+
exec(`cmake -B Build -G Xcode ${cmakeBasekitBuildDefinition} -DBUILD_RNAPP_DIR=Playground`, 'iOS');
8883
};
8984

9085
const buildIphoneOS = async () => {
@@ -95,20 +90,14 @@ const buildIphoneSimulator = async () => {
9590
exec('xcodebuild -sdk iphonesimulator -arch x86_64 -configuration Release -project ReactNativeBabylon.xcodeproj -scheme BabylonNative build CODE_SIGNING_ALLOWED=NO', 'iOS/Build');
9691
};
9792

98-
9993
const buildAndroid = async () => {
10094
const basekitBuildProp = basekitBuild ? "-PBASEKIT_BUILD=1" : "";
101-
exec(`./gradlew babylonjs_react-native:assembleRelease --stacktrace --info ${basekitBuildProp}`, '../Apps/Playground/Playground/android');
102-
};
103-
104-
const buildAndroidRNTA = async () => {
105-
const basekitBuildProp = basekitBuild ? "-PBASEKIT_BUILD=1" : "";
106-
exec(`./gradlew babylonjs_react-native:assembleRelease --stacktrace --info ${basekitBuildProp}`, '../Apps/BRNPlayground/android');
95+
exec(`./gradlew babylonjs_react-native:assembleRelease --stacktrace --info ${basekitBuildProp}`, '../Apps/Playground/android');
10796
};
10897

10998
const makeUWPProjectPlatform = async (name, arch) => {
11099
shelljs.mkdir('-p', `./../Modules/@babylonjs/react-native/Build/uwp_${name}`);
111-
exec(`cmake -G "Visual Studio 16 2019" -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0 -DCMAKE_UNITY_BUILD=true ${cmakeBasekitBuildDefinition} -A ${arch} ./../../../react-native-windows/windows`, `./../Modules/@babylonjs/react-native/Build/uwp_${name}`);
100+
exec(`cmake -G "Visual Studio 16 2019" -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0 -DCMAKE_UNITY_BUILD=true ${cmakeBasekitBuildDefinition} -A ${arch} ./../../../react-native/windows`, `./../Modules/@babylonjs/react-native/Build/uwp_${name}`);
112101
};
113102

114103
const makeUWPProjectx86 = async () => makeUWPProjectPlatform('x86', 'Win32');
@@ -122,27 +111,27 @@ const makeUWPProject = gulp.parallel(
122111
);
123112

124113
const buildUWPx86Debug = async () => {
125-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\Build.bat -Platform Win32 -Configuration Debug');
114+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\Build.bat -Platform Win32 -Configuration Debug');
126115
}
127116

128117
const buildUWPx86Release = async () => {
129-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\Build.bat -Platform Win32 -Configuration Release');
118+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\Build.bat -Platform Win32 -Configuration Release');
130119
}
131120

132121
const buildUWPx64Debug = async () => {
133-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\Build.bat -Platform x64 -Configuration Debug');
122+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\Build.bat -Platform x64 -Configuration Debug');
134123
}
135124

136125
const buildUWPx64Release = async () => {
137-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\Build.bat -Platform x64 -Configuration Release');
126+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\Build.bat -Platform x64 -Configuration Release');
138127
}
139128

140129
const buildUWPARM64Debug = async () => {
141-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\Build.bat -Platform ARM64 -Configuration Debug');
130+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\Build.bat -Platform ARM64 -Configuration Debug');
142131
}
143132

144133
const buildUWPARM64Release = async () => {
145-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\Build.bat -Platform ARM64 -Configuration Release');
134+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\Build.bat -Platform ARM64 -Configuration Release');
146135
}
147136

148137
const buildUWPProject = gulp.parallel(
@@ -159,27 +148,27 @@ const nugetRestoreUWPPlayground = async () => {
159148
}
160149

161150
const buildUWPPlaygroundx86Debug = async () => {
162-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\BuildPlayground.bat -Platform x86 -Configuration Debug');
151+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\BuildPlayground.bat -Platform x86 -Configuration Debug');
163152
}
164153

165154
const buildUWPPlaygroundx86Release = async () => {
166-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\BuildPlayground.bat -Platform x86 -Configuration Release');
155+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\BuildPlayground.bat -Platform x86 -Configuration Release');
167156
}
168157

169158
const buildUWPPlaygroundx64Debug = async () => {
170-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\BuildPlayground.bat -Platform x64 -Configuration Debug');
159+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\BuildPlayground.bat -Platform x64 -Configuration Debug');
171160
}
172161

173162
const buildUWPPlaygroundx64Release = async () => {
174-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\BuildPlayground.bat -Platform x64 -Configuration Release');
163+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\BuildPlayground.bat -Platform x64 -Configuration Release');
175164
}
176165

177166
const buildUWPPlaygroundARM64Debug = async () => {
178-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\BuildPlayground.bat -Platform ARM64 -Configuration Debug');
167+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\BuildPlayground.bat -Platform ARM64 -Configuration Debug');
179168
}
180169

181170
const buildUWPPlaygroundARM64Release = async () => {
182-
exec('.\\..\\Modules\\@babylonjs\\react-native-windows\\windows\\scripts\\BuildPlayground.bat -Platform ARM64 -Configuration Release');
171+
exec('.\\..\\Modules\\@babylonjs\\react-native\\windows\\scripts\\BuildPlayground.bat -Platform ARM64 -Configuration Release');
183172
}
184173

185174
const buildUWPPlayground = gulp.parallel(
@@ -352,10 +341,10 @@ const createUWPDirectories = async () => {
352341
}
353342

354343
const copyCommonFilesUWP = () => {
355-
return gulp.src('../Modules/@babylonjs/react-native-windows/package.json')
356-
.pipe(gulp.src('../Modules/@babylonjs/react-native-windows/README.md'))
344+
return gulp.src('../Modules/@babylonjs/react-native/package.json')
345+
.pipe(gulp.src('../Modules/@babylonjs/react-native/README.md'))
357346
.pipe(gulp.src('../NOTICE.html'))
358-
.pipe(gulp.src('../Modules/@babylonjs/react-native-windows/*.ts*'))
347+
.pipe(gulp.src('../Modules/@babylonjs/react-native/*.ts*'))
359348
.pipe(gulp.dest(`${assembledWindowsDir}`));
360349
}
361350

@@ -396,7 +385,7 @@ const copyARM64ReleaseUWPFiles = () => {
396385
}
397386

398387
const copyVCXProjUWPFiles = () => {
399-
const uwpFilesDir = '../Modules/@babylonjs/react-native-windows/windows/BabylonReactNative';
388+
const uwpFilesDir = '../Modules/@babylonjs/react-native/windows/BabylonReactNative';
400389
return gulp.src([`${uwpFilesDir}/*.*`, `!${uwpFilesDir}/*.pfx`])
401390
.pipe(gulp.dest(`${assembledWindowsDir}/windows/BabylonReactNative`));
402391
}
@@ -630,7 +619,7 @@ const patchPackageVersion = async () => {
630619
if (releaseVersionIndex != -1 || versionIndex != -1) {
631620

632621
const packageJsonPath = '../Modules/@babylonjs/react-native/package.json';
633-
const packageJsonPathWindows = '../Modules/@babylonjs/react-native-windows/package.json';
622+
const packageJsonPathWindows = '../Modules/@babylonjs/react-native/package.json';
634623
const packageJsonPathiOSAndroid = '../Modules/@babylonjs/react-native-iosandroid/package.json';
635624
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath));
636625
const packageJsonWindows = JSON.parse(fs.readFileSync(packageJsonPathWindows));
@@ -666,12 +655,12 @@ const patchPackageVersion = async () => {
666655
delete packageJsonWindows['peerDependencies']['react-native-permissions'];
667656
} else {
668657
packageJsoniOSAndroid["name"] = "@babylonjs/react-native-iosandroid" + packageNamePostfix;
669-
packageJsonWindows["name"] = "@babylonjs/react-native-windows" + packageNamePostfix;
658+
packageJsonWindows["name"] = "@babylonjs/react-native" + packageNamePostfix;
670659
}
671660
packageJson.peerDependencies['react-native'] = peerDep;
672661
packageJsoniOSAndroid.peerDependencies['react-native'] = peerDep;
673662
packageJsonWindows.peerDependencies['react-native'] = peerDep;
674-
packageJsonWindows.peerDependencies['react-native-windows'] = peerDep;
663+
packageJsonWindows.peerDependencies['react-native'] = peerDep;
675664
}
676665
}
677666
// release version
@@ -828,8 +817,8 @@ const buildBabylonNativeSourceTree = async () => {
828817

829818
const copyFiles = gulp.parallel(copyIOSAndroidCommonFiles, copyIOSFiles, copyAndroidFiles);
830819

831-
const buildIOS = gulp.series(makeXCodeProj, buildIphoneOS, buildIphoneSimulator);
832-
const buildIOSRNTA = gulp.series(makeXCodeProjRNTA, createXCFrameworks);
820+
//const buildIOS = gulp.series(makeXCodeProj, buildIphoneOS, buildIphoneSimulator);
821+
const buildIOS = gulp.series(makeXCodeProj, createXCFrameworks);
833822
const buildTS = gulp.series(patchPackageVersion, copyCommonFiles, copySharedFiles, buildTypeScript, validateAssembled);
834823
const buildIOSAndroid = gulp.series(patchPackageVersion, buildIOS, buildAndroid, createIOSUniversalLibs, copyFiles, validateAssemblediOSAndroid);
835824
const build = gulp.series(buildIOSAndroid, switchToBaseKit, buildIOSAndroid);
@@ -839,10 +828,9 @@ const pack = gulp.series(rebuild, createPackage);
839828
exports.validateAssembled = validateAssembled;
840829
exports.validateAssemblediOSAndroid = validateAssemblediOSAndroid;
841830

831+
//exports.buildIOS = buildIOS;
842832
exports.buildIOS = buildIOS;
843-
exports.buildIOSRNTA = buildIOSRNTA;
844833
exports.buildAndroid = buildAndroid;
845-
exports.buildAndroidRNTA = buildAndroidRNTA;
846834
exports.createIOSUniversalLibs = createIOSUniversalLibs;
847835
exports.createXCFrameworks = createXCFrameworks;
848836
exports.copyFiles = copyFiles;

0 commit comments

Comments
 (0)