@nrwl/react-native 15.9.0-beta.9 → 15.9.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/executors.json +20 -0
- package/migrations.json +19 -0
- package/package.json +9 -9
- package/src/executors/build-android/build-android.impl.d.ts +2 -2
- package/src/executors/build-android/build-android.impl.js +31 -21
- package/src/executors/build-android/build-android.impl.js.map +1 -1
- package/src/executors/build-android/build-android.impl.ts +55 -28
- package/src/executors/build-android/schema.d.ts +27 -1
- package/src/executors/build-android/schema.json +79 -3
- package/src/executors/build-ios/build-ios.impl.d.ts +6 -0
- package/src/executors/build-ios/build-ios.impl.js +77 -0
- package/src/executors/build-ios/build-ios.impl.js.map +1 -0
- package/src/executors/build-ios/build-ios.impl.ts +118 -0
- package/src/executors/build-ios/compat.d.ts +2 -0
- package/src/executors/build-ios/compat.js +6 -0
- package/src/executors/build-ios/compat.js.map +1 -0
- package/src/executors/build-ios/schema.d.ts +22 -0
- package/src/executors/build-ios/schema.json +106 -0
- package/src/executors/bundle/schema.json +19 -1
- package/src/executors/pod-install/compat.d.ts +2 -0
- package/src/executors/pod-install/compat.js +6 -0
- package/src/executors/pod-install/compat.js.map +1 -0
- package/src/executors/pod-install/pod-install.impl.d.ts +6 -0
- package/src/executors/pod-install/pod-install.impl.js +15 -0
- package/src/executors/pod-install/pod-install.impl.js.map +1 -0
- package/src/executors/pod-install/pod-install.impl.ts +21 -0
- package/src/executors/pod-install/schema.d.ts +3 -0
- package/src/executors/pod-install/schema.json +18 -0
- package/src/executors/run-android/run-android.impl.js +5 -28
- package/src/executors/run-android/run-android.impl.js.map +1 -1
- package/src/executors/run-android/run-android.impl.ts +10 -27
- package/src/executors/run-android/schema.d.ts +18 -11
- package/src/executors/run-android/schema.json +59 -24
- package/src/executors/run-ios/run-ios.impl.js +7 -20
- package/src/executors/run-ios/run-ios.impl.js.map +1 -1
- package/src/executors/run-ios/run-ios.impl.ts +18 -21
- package/src/executors/run-ios/schema.d.ts +11 -13
- package/src/executors/run-ios/schema.json +61 -32
- package/src/executors/start/schema.d.ts +2 -0
- package/src/generators/application/application.spec.ts +15 -2
- package/src/generators/application/lib/add-detox.js +1 -1
- package/src/generators/application/lib/add-detox.js.map +1 -1
- package/src/generators/application/lib/add-project.js +11 -0
- package/src/generators/application/lib/add-project.js.map +1 -1
- package/src/generators/init/init.js +1 -1
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/library/library.spec.ts +2 -2
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts +1 -1
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js +1 -0
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js.map +1 -1
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +75 -71
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts +1 -1
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts +37 -37
- package/src/migrations/update-15-0-0/add-babel-inputs.js +2 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.js.map +1 -1
- package/src/migrations/update-15-9-1/add-build-ios-target.d.ts +5 -0
- package/src/migrations/update-15-9-1/add-build-ios-target.js +34 -0
- package/src/migrations/update-15-9-1/add-build-ios-target.js.map +1 -0
- package/src/migrations/update-15-9-1/add-build-ios-target.spec.ts +36 -0
- package/src/utils/add-jest.js +1 -0
- package/src/utils/add-jest.js.map +1 -1
- package/src/utils/get-cli-options.d.ts +8 -0
- package/src/utils/get-cli-options.js +31 -0
- package/src/utils/get-cli-options.js.map +1 -0
- package/src/utils/pod-install-task.d.ts +2 -2
- package/src/utils/pod-install-task.js +12 -3
- package/src/utils/pod-install-task.js.map +1 -1
- package/src/utils/symlink-task.d.ts +1 -1
- package/src/utils/symlink-task.js +2 -2
- package/src/utils/versions.d.ts +2 -2
- package/src/utils/versions.js +2 -2
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { ChildProcess, fork } from 'child_process';
|
|
4
|
+
import { platform } from 'os';
|
|
5
|
+
|
|
6
|
+
import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink';
|
|
7
|
+
import {
|
|
8
|
+
displayNewlyAddedDepsMessage,
|
|
9
|
+
syncDeps,
|
|
10
|
+
} from '../sync-deps/sync-deps.impl';
|
|
11
|
+
import { podInstall } from '../../utils/pod-install-task';
|
|
12
|
+
import { ReactNativeBuildIosOptions } from './schema';
|
|
13
|
+
import { runCliStart } from '../start/start.impl';
|
|
14
|
+
import { getCliOptions } from '../../utils/get-cli-options';
|
|
15
|
+
|
|
16
|
+
export interface ReactNativeBuildIosOutput {
|
|
17
|
+
success: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let childProcess: ChildProcess;
|
|
21
|
+
|
|
22
|
+
export default async function* runIosExecutor(
|
|
23
|
+
options: ReactNativeBuildIosOptions,
|
|
24
|
+
context: ExecutorContext
|
|
25
|
+
): AsyncGenerator<ReactNativeBuildIosOutput> {
|
|
26
|
+
if (platform() !== 'darwin') {
|
|
27
|
+
throw new Error(`The run-ios build requires Mac to run`);
|
|
28
|
+
}
|
|
29
|
+
const projectRoot =
|
|
30
|
+
context.projectsConfigurations.projects[context.projectName].root;
|
|
31
|
+
ensureNodeModulesSymlink(context.root, projectRoot);
|
|
32
|
+
if (options.sync) {
|
|
33
|
+
displayNewlyAddedDepsMessage(
|
|
34
|
+
context.projectName,
|
|
35
|
+
await syncDeps(
|
|
36
|
+
context.projectName,
|
|
37
|
+
projectRoot,
|
|
38
|
+
context.root,
|
|
39
|
+
context.projectGraph
|
|
40
|
+
)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (options.install) {
|
|
45
|
+
await podInstall(
|
|
46
|
+
join(context.root, projectRoot, 'ios'),
|
|
47
|
+
options.buildFolder
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
const tasks = [runCliBuildIOS(context.root, projectRoot, options)];
|
|
53
|
+
if (options.packager && options.mode !== 'Release') {
|
|
54
|
+
tasks.push(
|
|
55
|
+
runCliStart(context.root, projectRoot, {
|
|
56
|
+
port: options.port,
|
|
57
|
+
resetCache: options.resetCache,
|
|
58
|
+
interactive: options.interactive,
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
await Promise.all(tasks);
|
|
64
|
+
|
|
65
|
+
yield { success: true };
|
|
66
|
+
} finally {
|
|
67
|
+
if (childProcess) {
|
|
68
|
+
childProcess.kill();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function runCliBuildIOS(
|
|
74
|
+
workspaceRoot: string,
|
|
75
|
+
projectRoot: string,
|
|
76
|
+
options: ReactNativeBuildIosOptions
|
|
77
|
+
) {
|
|
78
|
+
return new Promise((resolve, reject) => {
|
|
79
|
+
/**
|
|
80
|
+
* Call the react native cli with option `--no-packager`
|
|
81
|
+
* Not passing '--packager' due to cli will launch start command from the project root
|
|
82
|
+
*/
|
|
83
|
+
childProcess = fork(
|
|
84
|
+
join(workspaceRoot, './node_modules/react-native/cli.js'),
|
|
85
|
+
['run-ios', ...createBuildIOSOptions(options), '--no-packager'],
|
|
86
|
+
{
|
|
87
|
+
cwd: join(workspaceRoot, projectRoot),
|
|
88
|
+
env: { ...process.env, RCT_METRO_PORT: options.port.toString() },
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// Ensure the child process is killed when the parent exits
|
|
93
|
+
process.on('exit', () => childProcess.kill());
|
|
94
|
+
process.on('SIGTERM', () => childProcess.kill());
|
|
95
|
+
|
|
96
|
+
childProcess.on('error', (err) => {
|
|
97
|
+
reject(err);
|
|
98
|
+
});
|
|
99
|
+
childProcess.on('exit', (code) => {
|
|
100
|
+
if (code === 0) {
|
|
101
|
+
resolve(code);
|
|
102
|
+
} else {
|
|
103
|
+
reject(code);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const nxOptions = ['sync', 'install', 'packager'];
|
|
110
|
+
const startOptions = ['port', 'resetCache'];
|
|
111
|
+
|
|
112
|
+
function createBuildIOSOptions(options: ReactNativeBuildIosOptions) {
|
|
113
|
+
return getCliOptions<ReactNativeBuildIosOptions>(
|
|
114
|
+
options,
|
|
115
|
+
[...nxOptions, ...startOptions],
|
|
116
|
+
['buildFolder']
|
|
117
|
+
);
|
|
118
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
+
const build_ios_impl_1 = require("./build-ios.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(build_ios_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/build-ios/compat.ts"],"names":[],"mappings":";;AAAA,yCAAiD;AAEjD,qDAAgD;AAEhD,kBAAe,IAAA,0BAAiB,EAAC,wBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// options from https://github.com/react-native-community/cli/blob/main/packages/cli-platform-ios/src/commands/buildIOS/index.ts
|
|
2
|
+
|
|
3
|
+
import { ReactNativeStartOptions } from '../start/schema';
|
|
4
|
+
|
|
5
|
+
export interface ReactNativeBuildIosOptions extends ReactNativeStartOptions {
|
|
6
|
+
// react native options
|
|
7
|
+
simulator?: string;
|
|
8
|
+
mode: string; // default if 'Debug'
|
|
9
|
+
scheme?: string;
|
|
10
|
+
device?: string;
|
|
11
|
+
udid?: string;
|
|
12
|
+
verbose?: boolean;
|
|
13
|
+
port: number; // default is 8081
|
|
14
|
+
xcconfig?: string;
|
|
15
|
+
buildFolder?: string;
|
|
16
|
+
extraParams?: string;
|
|
17
|
+
|
|
18
|
+
// nx options
|
|
19
|
+
packager: boolean; // default is true
|
|
20
|
+
install: boolean; // default is true
|
|
21
|
+
sync: boolean; // default is true
|
|
22
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"title": "React Native Build iOS executor",
|
|
6
|
+
"description": "Build iOS app.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"presets": [
|
|
9
|
+
{
|
|
10
|
+
"name": "Build iOS for a simulator",
|
|
11
|
+
"keys": ["simulator"]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "Build iOS for a device",
|
|
15
|
+
"keys": ["device"]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "Build iOS for a device with udid",
|
|
19
|
+
"keys": ["udid"]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "Run `pod install` before building iOS app",
|
|
23
|
+
"keys": ["install"]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"simulator": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: \"iPhone 6 (10.0)\"",
|
|
30
|
+
"examples": [
|
|
31
|
+
"iPhone 14",
|
|
32
|
+
"iPhone 13",
|
|
33
|
+
"iPhone 12",
|
|
34
|
+
"iPhone 11",
|
|
35
|
+
"iPhone X"
|
|
36
|
+
],
|
|
37
|
+
"x-priority": "important"
|
|
38
|
+
},
|
|
39
|
+
"mode": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Explicitly set the scheme configuration to use",
|
|
42
|
+
"default": "Debug",
|
|
43
|
+
"examples": ["Debug", "Release"],
|
|
44
|
+
"x-priority": "important"
|
|
45
|
+
},
|
|
46
|
+
"schema": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "Explicitly set Xcode scheme to use"
|
|
49
|
+
},
|
|
50
|
+
"device": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "Explicitly set device to use by name. The value is not required if you have a single device connected."
|
|
53
|
+
},
|
|
54
|
+
"udid": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Explicitly set device to use by udid"
|
|
57
|
+
},
|
|
58
|
+
"verbose": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"description": "Do not use xcbeautify or xcpretty even if installed"
|
|
61
|
+
},
|
|
62
|
+
"port": {
|
|
63
|
+
"type": "number",
|
|
64
|
+
"description": "The port where the packager server is listening on.",
|
|
65
|
+
"default": 8081
|
|
66
|
+
},
|
|
67
|
+
"xcconfig": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"description": "Explicitly set xcconfig to use"
|
|
70
|
+
},
|
|
71
|
+
"buildFolder": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\". Relative to ios directory",
|
|
74
|
+
"default": "./build"
|
|
75
|
+
},
|
|
76
|
+
"interactive": {
|
|
77
|
+
"type": "boolean",
|
|
78
|
+
"description": "Explicitly select which scheme and configuration to use before running a build"
|
|
79
|
+
},
|
|
80
|
+
"extraParams": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"description": "Custom params that will be passed to xcodebuild command."
|
|
83
|
+
},
|
|
84
|
+
"install": {
|
|
85
|
+
"type": "boolean",
|
|
86
|
+
"description": "Runs `pod install` for native modules before building iOS app."
|
|
87
|
+
},
|
|
88
|
+
"sync": {
|
|
89
|
+
"type": "boolean",
|
|
90
|
+
"description": "Syncs npm dependencies to `package.json` (for React Native autolink).",
|
|
91
|
+
"default": true
|
|
92
|
+
},
|
|
93
|
+
"resetCache": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"description": "Resets metro cache.",
|
|
96
|
+
"default": false
|
|
97
|
+
},
|
|
98
|
+
"packager": {
|
|
99
|
+
"type": "boolean",
|
|
100
|
+
"description": "Launch packager while building",
|
|
101
|
+
"default": true
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"required": [],
|
|
105
|
+
"examplesFile": "../../../docs/build-ios-examples.md"
|
|
106
|
+
}
|
|
@@ -7,6 +7,24 @@
|
|
|
7
7
|
"title": "Offline JS Bundle for React Native",
|
|
8
8
|
"description": "JS Bundle target options.",
|
|
9
9
|
"type": "object",
|
|
10
|
+
"presets": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Bundle for a specific platform",
|
|
13
|
+
"keys": ["platform"]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "Bundle a development build",
|
|
17
|
+
"keys": ["dev"]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "Bundle to a specific output path",
|
|
21
|
+
"keys": ["bundleOutput"]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "Bundle without global cache",
|
|
25
|
+
"keys": ["resetCache"]
|
|
26
|
+
}
|
|
27
|
+
],
|
|
10
28
|
"properties": {
|
|
11
29
|
"entryFile": {
|
|
12
30
|
"type": "string",
|
|
@@ -65,7 +83,7 @@
|
|
|
65
83
|
},
|
|
66
84
|
"readGlobalCache": {
|
|
67
85
|
"type": "boolean",
|
|
68
|
-
"description": "
|
|
86
|
+
"description": "Try to fetch transformed JS code from the global cache, if configured.",
|
|
69
87
|
"default": false
|
|
70
88
|
}
|
|
71
89
|
},
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
+
const pod_install_impl_1 = require("./pod-install.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(pod_install_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/pod-install/compat.ts"],"names":[],"mappings":";;AAAA,yCAAiD;AAEjD,yDAA4C;AAE5C,kBAAe,IAAA,0BAAiB,EAAC,0BAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
+
import { ReactNativePodInstallOptions } from './schema';
|
|
3
|
+
export interface ReactNativePodInstallOutput {
|
|
4
|
+
success: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default function podInstall(options: ReactNativePodInstallOptions, context: ExecutorContext): AsyncGenerator<ReactNativePodInstallOutput>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const pod_install_task_1 = require("../../utils/pod-install-task");
|
|
6
|
+
function podInstall(options, context) {
|
|
7
|
+
return tslib_1.__asyncGenerator(this, arguments, function* podInstall_1() {
|
|
8
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
9
|
+
const iosDirectory = (0, path_1.join)(context.root, projectRoot, 'ios');
|
|
10
|
+
yield tslib_1.__await((0, pod_install_task_1.runPodInstall)(iosDirectory, true, options.buildFolder)());
|
|
11
|
+
yield yield tslib_1.__await({ success: true });
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.default = podInstall;
|
|
15
|
+
//# sourceMappingURL=pod-install.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pod-install.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/pod-install/pod-install.impl.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAG5B,mEAA6D;AAO7D,SAA+B,UAAU,CACvC,OAAqC,EACrC,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QACpE,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QAC5D,sBAAM,IAAA,gCAAa,EAAC,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,CAAA,CAAC;QAE/D,4BAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA,CAAC;IAC1B,CAAC;CAAA;AAVD,6BAUC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { ExecutorContext } from '@nrwl/devkit';
|
|
3
|
+
|
|
4
|
+
import { runPodInstall } from '../../utils/pod-install-task';
|
|
5
|
+
import { ReactNativePodInstallOptions } from './schema';
|
|
6
|
+
|
|
7
|
+
export interface ReactNativePodInstallOutput {
|
|
8
|
+
success: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default async function* podInstall(
|
|
12
|
+
options: ReactNativePodInstallOptions,
|
|
13
|
+
context: ExecutorContext
|
|
14
|
+
): AsyncGenerator<ReactNativePodInstallOutput> {
|
|
15
|
+
const projectRoot =
|
|
16
|
+
context.projectsConfigurations.projects[context.projectName].root;
|
|
17
|
+
const iosDirectory = join(context.root, projectRoot, 'ios');
|
|
18
|
+
await runPodInstall(iosDirectory, true, options.buildFolder)();
|
|
19
|
+
|
|
20
|
+
yield { success: true };
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"$id": "NxReactNativePodInstall",
|
|
6
|
+
"$schema": "http://json-schema.org/schema",
|
|
7
|
+
"title": "Run Pod Install for React Native iOS Project",
|
|
8
|
+
"description": "Run `pod install` for React Native iOS Project.",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"buildFolder": {
|
|
12
|
+
"description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\". Relative to ios directory",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"default": "./build"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": ["buildFolder"]
|
|
18
|
+
}
|
|
@@ -7,6 +7,7 @@ const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-s
|
|
|
7
7
|
const sync_deps_impl_1 = require("../sync-deps/sync-deps.impl");
|
|
8
8
|
const start_impl_1 = require("../start/start.impl");
|
|
9
9
|
const chmod_android_gradle_files_1 = require("../../utils/chmod-android-gradle-files");
|
|
10
|
+
const get_cli_options_1 = require("../../utils/get-cli-options");
|
|
10
11
|
let childProcess;
|
|
11
12
|
function runAndroidExecutor(options, context) {
|
|
12
13
|
return tslib_1.__asyncGenerator(this, arguments, function* runAndroidExecutor_1() {
|
|
@@ -62,34 +63,10 @@ function runCliRunAndroid(workspaceRoot, projectRoot, options) {
|
|
|
62
63
|
});
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
'packager',
|
|
69
|
-
'port',
|
|
70
|
-
'resetCache',
|
|
71
|
-
'interactive',
|
|
72
|
-
];
|
|
66
|
+
const nxOptions = ['sync', 'packager'];
|
|
67
|
+
const startOptions = ['port', 'resetCache'];
|
|
68
|
+
const deprecatedOptions = ['variant', 'jetifier'];
|
|
73
69
|
function createRunAndroidOptions(options) {
|
|
74
|
-
return
|
|
75
|
-
const v = options[k];
|
|
76
|
-
if (k === 'mainActivity') {
|
|
77
|
-
acc.push(`--main-activity`, v);
|
|
78
|
-
}
|
|
79
|
-
else if (k === 'jetifier') {
|
|
80
|
-
if (!v) {
|
|
81
|
-
acc.push(`--no-jetifier`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
else if (k === 'activeArchOnly') {
|
|
85
|
-
if (v) {
|
|
86
|
-
acc.push(`--active-arch-only`);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else if (v && !nxOrStartOptions.includes(k)) {
|
|
90
|
-
acc.push(`--${k}`, v);
|
|
91
|
-
}
|
|
92
|
-
return acc;
|
|
93
|
-
}, []);
|
|
70
|
+
return (0, get_cli_options_1.getCliOptions)(options, [...nxOptions, ...startOptions, ...deprecatedOptions], ['appId', 'appIdSuffix']);
|
|
94
71
|
}
|
|
95
72
|
//# sourceMappingURL=run-android.impl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-android.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/run-android/run-android.impl.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAC5B,iDAAmD;AAEnD,yFAAmF;AACnF,gEAGqC;
|
|
1
|
+
{"version":3,"file":"run-android.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/run-android/run-android.impl.ts"],"names":[],"mappings":"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"}
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
displayNewlyAddedDepsMessage,
|
|
8
8
|
syncDeps,
|
|
9
9
|
} from '../sync-deps/sync-deps.impl';
|
|
10
|
-
import { chmodSync } from 'fs';
|
|
11
10
|
import { ReactNativeRunAndroidOptions } from './schema';
|
|
12
11
|
import { runCliStart } from '../start/start.impl';
|
|
13
12
|
import { chmodAndroidGradlewFiles } from '../../utils/chmod-android-gradle-files';
|
|
13
|
+
import { getCliOptions } from '../../utils/get-cli-options';
|
|
14
14
|
|
|
15
15
|
export interface ReactNativeRunAndroidOutput {
|
|
16
16
|
success: boolean;
|
|
@@ -97,31 +97,14 @@ function runCliRunAndroid(
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
'packager',
|
|
104
|
-
'port',
|
|
105
|
-
'resetCache',
|
|
106
|
-
'interactive',
|
|
107
|
-
];
|
|
100
|
+
const nxOptions = ['sync', 'packager'];
|
|
101
|
+
const startOptions = ['port', 'resetCache'];
|
|
102
|
+
const deprecatedOptions = ['variant', 'jetifier'];
|
|
108
103
|
|
|
109
|
-
function createRunAndroidOptions(options) {
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (!v) {
|
|
116
|
-
acc.push(`--no-jetifier`);
|
|
117
|
-
}
|
|
118
|
-
} else if (k === 'activeArchOnly') {
|
|
119
|
-
if (v) {
|
|
120
|
-
acc.push(`--active-arch-only`);
|
|
121
|
-
}
|
|
122
|
-
} else if (v && !nxOrStartOptions.includes(k)) {
|
|
123
|
-
acc.push(`--${k}`, v);
|
|
124
|
-
}
|
|
125
|
-
return acc;
|
|
126
|
-
}, []);
|
|
104
|
+
function createRunAndroidOptions(options: ReactNativeRunAndroidOptions) {
|
|
105
|
+
return getCliOptions<ReactNativeRunAndroidOptions>(
|
|
106
|
+
options,
|
|
107
|
+
[...nxOptions, ...startOptions, ...deprecatedOptions],
|
|
108
|
+
['appId', 'appIdSuffix']
|
|
109
|
+
);
|
|
127
110
|
}
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ReactNativeBuildAndroidOptions } from '../build-android/schema';
|
|
2
|
+
import { ReactNativeStartOptions } from '../start/schema';
|
|
3
|
+
|
|
4
|
+
// part of options from https://github.com/react-native-community/cli/blob/main/packages/cli-platform-android/src/commands/runAndroid/index.ts
|
|
5
|
+
export interface ReactNativeRunAndroidOptions
|
|
6
|
+
extends ReactNativeBuildAndroidOptions {
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated use mode instead
|
|
9
|
+
*/
|
|
3
10
|
variant: string;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated no longer supported in react native cli
|
|
13
|
+
* https://github.com/react-native-community/cli/commit/7c003f2b1d9d80ec5c167614ba533a004272c685
|
|
14
|
+
*/
|
|
15
|
+
jetifier: boolean;
|
|
16
|
+
|
|
17
|
+
// react native options
|
|
4
18
|
appId: string;
|
|
5
19
|
appIdSuffix: string;
|
|
6
20
|
mainActiviy: string;
|
|
7
21
|
deviceId: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
sync: boolean;
|
|
11
|
-
port: number;
|
|
12
|
-
terminal?: string;
|
|
13
|
-
packager: boolean; // default is true
|
|
14
|
-
resetCache: boolean; // default is false
|
|
15
|
-
interactive: boolean; // default is true
|
|
16
|
-
activeArchOnly?: boolean;
|
|
22
|
+
listDevices?: boolean;
|
|
23
|
+
binaryPath?: string;
|
|
17
24
|
}
|