diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTask.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTask.kt index ba2eeb2ffd1687..ea4dfcb0b9a99e 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTask.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTask.kt @@ -33,6 +33,7 @@ abstract class GenerateCodegenSchemaTask : Exec() { val jsInputFiles = project.fileTree(jsRootDir) { it.include("**/*.js") + it.include("**/*.ts") it.exclude("**/generated/source/codegen/**/*") } diff --git a/packages/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTaskTest.kt b/packages/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTaskTest.kt index 68af7866b0470c..a70995560f6e32 100644 --- a/packages/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTaskTest.kt +++ b/packages/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTaskTest.kt @@ -29,15 +29,16 @@ class GenerateCodegenSchemaTaskTest { val jsRootDir = tempFolder.newFolder("js").apply { File(this, "file.js").createNewFile() + File(this, "file.ts").createNewFile() File(this, "ignore.txt").createNewFile() } val task = createTestTask { it.jsRootDir.set(jsRootDir) } assertEquals(jsRootDir, task.jsInputFiles.dir) - assertEquals(setOf("**/*.js"), task.jsInputFiles.includes) - assertEquals(1, task.jsInputFiles.files.size) - assertEquals(setOf(File(jsRootDir, "file.js")), task.jsInputFiles.files) + assertEquals(setOf("**/*.js", "**/*.ts"), task.jsInputFiles.includes) + assertEquals(2, task.jsInputFiles.files.size) + assertEquals(setOf(File(jsRootDir, "file.js"), File(jsRootDir, "file.ts")), task.jsInputFiles.files) } @Test