mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
e4d0153a67
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33729 This PR addresses [this comment](https://www.internalfb.com/diff/D35820848?dst_version_fbid=496290878846487&transaction_fbid=355967423221044). It makes the CodeGen to the `outputDir` as base directory for the codegen. Finally, it updates the unit tests accordingly. ## Changelog [iOS][Changed] - use `outputDir` as base directory for the codegen and remove the possibility to customize the intermediate path. The generated code requires specific paths in the `#include` directive. Reviewed By: cortinico, dmitryrykun Differential Revision: D35935282 fbshipit-source-id: a9ad4e296efb042cf34b20db5eebb59614beb5f6
62 lines
1.4 KiB
JavaScript
62 lines
1.4 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const yargs = require('yargs');
|
|
const executor = require('./codegen/generate-specs-cli-executor');
|
|
|
|
const argv = yargs
|
|
.option('p', {
|
|
alias: 'platform',
|
|
describe: 'Platform to generate native code artifacts for.',
|
|
})
|
|
.option('s', {
|
|
alias: 'schemaPath',
|
|
describe: 'The path to the schema file.',
|
|
})
|
|
.option('o', {
|
|
alias: 'outputDir',
|
|
describe:
|
|
'Path to the root directory where native code source files should be saved.',
|
|
})
|
|
.option('n', {
|
|
alias: 'libraryName',
|
|
describe: 'Name of specs library.',
|
|
default: 'FBReactNativeSpec',
|
|
})
|
|
.option('j', {
|
|
alias: 'javaPackageName',
|
|
describe: 'Name of Java package.',
|
|
default: 'com.facebook.fbreact.specs',
|
|
})
|
|
.option('t', {
|
|
alias: 'libraryType',
|
|
describe: 'all, components, or modules.',
|
|
default: 'all',
|
|
})
|
|
.usage('Usage: $0 <args>')
|
|
.demandOption(
|
|
['platform', 'schemaPath', 'outputDir'],
|
|
'Please provide platform, schema path, and output directory.',
|
|
).argv;
|
|
|
|
function main() {
|
|
executor.execute(
|
|
argv.platform,
|
|
argv.schemaPath,
|
|
argv.outputDir,
|
|
argv.libraryName,
|
|
argv.javaPackageName,
|
|
argv.libraryType,
|
|
);
|
|
}
|
|
|
|
main();
|