Skip to content

Commit 971df74

Browse files
authored
fix(Windows): Don't hard-code paths to project files (#227)
Of all 0.63 versions, only 0.63.2 currently works as the project file has hard-coded paths to `.targets` files.
1 parent 0cdd8ff commit 971df74

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

windows/test-app.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,17 @@ function generateSolution(destPath, noAutolink) {
260260
projectFilesDestPath
261261
);
262262

263+
const { version: rnWindowsVersion } = JSON.parse(
264+
fs.readFileSync(path.join(rnWindowsPath, "package.json"), {
265+
encoding: "utf8",
266+
})
267+
);
268+
263269
const projectFilesReplacements = {
264270
"\\$\\(BundleDirContentPaths\\)": bundleDirContent,
265271
"\\$\\(BundleFileContentPaths\\)": bundleFileContent,
272+
"packages\\\\Microsoft\\.ReactNative\\.0\\.63\\.2\\\\build\\\\native\\\\Microsoft\\.ReactNative\\.targets": `packages\\Microsoft.ReactNative.${rnWindowsVersion}\\build\\native\\Microsoft.ReactNative.targets`,
273+
"packages\\\\Microsoft\\.ReactNative\\.Cxx\\.0\\.63\\.2\\\\build\\\\native\\\\Microsoft\\.ReactNative\\.Cxx\\.targets": `packages\\Microsoft.ReactNative.Cxx.${rnWindowsVersion}\\build\\native\\Microsoft.ReactNative.Cxx.targets`,
266274
};
267275

268276
const copyTasks = [

0 commit comments

Comments
 (0)