Skip to content

Commit

Permalink
A fix in Codegen for Windows build host (#36542)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
birdofpreyru authored and facebook-github-bot committed Aug 22, 2023
1 parent 57b86f7 commit a323249
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@
const combine = require('./combine-js-to-schema');
const fs = require('fs');
const glob = require('glob');
const path = require('path');
const {parseArgs, filterJSFile} = require('./combine-utils');

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

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

0 comments on commit a323249

Please sign in to comment.