Implement filtering for platform specific spec files

Summary:
This diff helps the library maintainer to keep their spec file platform specific if some specs make no sense in one platform or in the other.

We are filtering the spec files when we need to create the Schema.

The diff modifies also the call sites in the `scripts` (for iOS) and in the `gradle-plugin` (for Android).

It also adds tests for the new functions in the CLI.

The change is completely additive and it should not change any pre-existing behaviour.

## Changelog
[General][Added] - Add support for platform-specific specs

Reviewed By: cortinico

Differential Revision: D40008581

fbshipit-source-id: b7fcf6d38f85fe10e4e00002d3c6f2910abdbe35
This commit is contained in:
Riccardo Cipolleschi authored and Facebook GitHub Bot committed 2022-10-07 03:21:17 -07:00
1 parent 00b795642a
commit 7680bdeb4f
10 files changed
+397 -27

No files matched your search

@@ -319,7 +319,7 @@ function generateSchema(tmpDir, library, node, codegenCliPath) {
'cli',
'combine',
'combine-js-to-schema-cli.js',
)} ${pathToSchema} ${pathToJavaScriptSources}`,
)} --platform ios ${pathToSchema} ${pathToJavaScriptSources}`,
);
console.log(`[Codegen] Generated schema: ${pathToSchema}`);
return pathToSchema;