Skip to content

Commit a323249

Browse files
birdofpreyrufacebook-github-bot
authored andcommittedAug 22, 2023
A fix in Codegen for Windows build host (#36542)
Summary: Android builds with new arch fail on Windows build host (#36475). This tiny correction fixes generation of `schema.json` (without it codegen failed to find any files, and generated empty schema). Unfortunately, does not fixes the issue with Windows host entirely, as builds still fail later (on ninja build step). ## Changelog: [Android] [Fixed] - A bug fix for Android builds with new arch on Windows host. Pull Request resolved: #36542 Reviewed By: NickGerleman Differential Revision: D48563587 Pulled By: cortinico fbshipit-source-id: acd510308ce9768fb17d3a33c7927de3237748ac
1 parent 57b86f7 commit a323249

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎packages/react-native-codegen/src/cli/combine/combine-js-to-schema-cli.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,22 @@
1414
const combine = require('./combine-js-to-schema');
1515
const fs = require('fs');
1616
const glob = require('glob');
17+
const path = require('path');
1718
const {parseArgs, filterJSFile} = require('./combine-utils');
1819

1920
const {platform, outfile, fileList} = parseArgs(process.argv);
2021

2122
const allFiles = [];
2223
fileList.forEach(file => {
2324
if (fs.lstatSync(file).isDirectory()) {
25+
const filePattern = path.sep === '\\' ? file.replace(/\\/g, '/') : file;
2426
const dirFiles = glob
25-
.sync(`${file}/**/*.{js,ts,tsx}`, {
27+
.sync(`${filePattern}/**/*.{js,ts,tsx}`, {
2628
nodir: true,
29+
// TODO: This will remove the need of slash substitution above for Windows,
30+
// but it requires glob@v9+; with the package currenlty relying on
31+
// glob@7.1.1; and flow-typed repo not having definitions for glob@9+.
32+
// windowsPathsNoEscape: true,
2733
})
2834
.filter(element => filterJSFile(element, platform));
2935
allFiles.push(...dirFiles);

0 commit comments

Comments
 (0)
Please sign in to comment.