Skip to content

Commit ab7b4d4

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Restore Filtering platform in codegen (#35028)
Summary: Pull Request resolved: #35028 **This Diff require a bump in the react-native-codegen (including this [commit](7680bde)) to work** This diff sets up iOS and Android to pass their platform to the codegen so that we can have platform-specific specs. ## Changelog [General][Added] - Enable platform-specific Codegen Specs Reviewed By: cortinico Differential Revision: D40516395 fbshipit-source-id: 0624f0bfb93c90f78131a605a4847e780783bbaf
1 parent a2166b2 commit ab7b4d4

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTask.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ abstract class GenerateCodegenSchemaTask : Exec() {
6363
}
6464

6565
internal fun setupCommandLine() {
66-
// TODO: restore the --platform android parameters as soon as we publish the codegen package.
6766
commandLine(
6867
windowsAwareCommandLine(
6968
*nodeExecutableAndArgs.get().toTypedArray(),
@@ -72,8 +71,8 @@ abstract class GenerateCodegenSchemaTask : Exec() {
7271
.get()
7372
.asFile
7473
.absolutePath,
75-
// "--platform",
76-
// "android",
74+
"--platform",
75+
"android",
7776
generatedSchemaFile.get().asFile.absolutePath,
7877
jsRootDir.asFile.get().absolutePath,
7978
))

packages/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTaskTest.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ class GenerateCodegenSchemaTaskTest {
144144
}
145145

146146
task.setupCommandLine()
147-
// TODO: restore the --platform android parameters as soon as we publish the codegen package.
147+
148148
assertEquals(
149149
listOf(
150150
"--verbose",
151151
File(codegenDir, "lib/cli/combine/combine-js-to-schema-cli.js").toString(),
152-
// "--platform",
153-
// "android",
152+
"--platform",
153+
"android",
154154
File(outputDir, "schema.json").toString(),
155155
jsRootDir.toString(),
156156
),

scripts/codegen/generate-artifacts-executor.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ function generateSchema(tmpDir, library, node, codegenCliPath) {
311311

312312
console.log(`\n\n[Codegen] >>>>> Processing ${library.config.name}`);
313313
// Generate one schema for the entire library...
314-
// TODO: restore the `--platform ios` parameters as soon as we publish the codegen package.
315314
executeNodeScript(
316315
node,
317316
`${path.join(
@@ -320,7 +319,7 @@ function generateSchema(tmpDir, library, node, codegenCliPath) {
320319
'cli',
321320
'combine',
322321
'combine-js-to-schema-cli.js',
323-
)} ${pathToSchema} ${pathToJavaScriptSources}`,
322+
)} --platform ios ${pathToSchema} ${pathToJavaScriptSources}`,
324323
);
325324
console.log(`[Codegen] Generated schema: ${pathToSchema}`);
326325
return pathToSchema;

0 commit comments

Comments
 (0)