Skip to content

Commit

Permalink
Fix forward: Filtering platform in codegen (#34897)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #34897

This [commit](7680bde) added the possibility to create Codegen specs that are platform specific.
However, it also modifies how the codegen is invoked and we need to publish a new version of the `react-native-codegen` package on NPM before we can use that feature.

## Changelog:
[General][Fixed] - Remove usage of the codegen spec filtering until we publish a new version of the codegen.

Reviewed By: robhogan

Differential Revision: D40176447

fbshipit-source-id: 20be630dec3dcd7efb9fd510c6cf9f2c161f906a
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Oct 7, 2022
1 parent 6552d47 commit ae3dd54
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ abstract class GenerateCodegenSchemaTask : Exec() {
}

internal fun setupCommandLine() {
// TODO: restore the --platform android parameters as soon as we publish the codegen package.
commandLine(
windowsAwareCommandLine(
*nodeExecutableAndArgs.get().toTypedArray(),
Expand All @@ -69,8 +70,8 @@ abstract class GenerateCodegenSchemaTask : Exec() {
.get()
.asFile
.absolutePath,
"--platform",
"android",
// "--platform",
// "android",
generatedSchemaFile.get().asFile.absolutePath,
jsRootDir.asFile.get().absolutePath,
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ class GenerateCodegenSchemaTaskTest {
}

task.setupCommandLine()

// TODO: restore the --platform android parameters as soon as we publish the codegen package.
assertEquals(
listOf(
"--verbose",
File(codegenDir, "lib/cli/combine/combine-js-to-schema-cli.js").toString(),
"--platform",
"android",
// "--platform",
// "android",
File(outputDir, "schema.json").toString(),
jsRootDir.toString(),
),
Expand Down
3 changes: 2 additions & 1 deletion scripts/codegen/generate-artifacts-executor.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ function generateSchema(tmpDir, library, node, codegenCliPath) {

console.log(`\n\n[Codegen] >>>>> Processing ${library.config.name}`);
// Generate one schema for the entire library...
// TODO: restore the `--platform ios` parameters as soon as we publish the codegen package.
executeNodeScript(
node,
`${path.join(
Expand All @@ -319,7 +320,7 @@ function generateSchema(tmpDir, library, node, codegenCliPath) {
'cli',
'combine',
'combine-js-to-schema-cli.js',
)} --platform ios ${pathToSchema} ${pathToJavaScriptSources}`,
)} ${pathToSchema} ${pathToJavaScriptSources}`,
);
console.log(`[Codegen] Generated schema: ${pathToSchema}`);
return pathToSchema;
Expand Down

0 comments on commit ae3dd54

Please sign in to comment.