Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react-native): run-android support --active-arch-only flag #15050

Merged
merged 2 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@
"type": "boolean",
"description": "Run packager server in interactive mode.",
"default": true
},
"activeArchOnly": {
"type": "boolean",
"description": "Builds only for the active architecture (e.g. x86_64, arm64-v8a).",
"default": false
}
},
"examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-android\": {\n \"executor\": \"@nrwl/react-native:run-android\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:run-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Run on a specific device/simulator\" %}\nTo see all the avaiable emulators, run command:\n\n```bash\nemulator -list-avds\n```\n\nThe `deviceId` option allows you to launch your android app in a specific device/simulator:\n\n```json\n \"run-android\": {\n \"executor\": \"@nrwl/react-native:run-android\",\n \"options\": {\n \"deviceId\": \"Pixel_5_API_30\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Run the debug/release app\" %}\nThe `variant` option allows to specify the build variant, such as `debug` or `release`.\n\n```json\n \"run-android\": {\n \"executor\": \"@nrwl/react-native:run-android\",\n \"options\": {\n \"variant\": \"release\"\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ function createRunAndroidOptions(options) {
if (!v) {
acc.push(`--no-jetifier`);
}
} else if (k === 'activeArchOnly') {
if (v) {
acc.push(`--active-arch-only`);
}
} else if (v && !nxOrStartOptions.includes(k)) {
acc.push(`--${k}`, v);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export interface ReactNativeRunAndroidOptions {
packager: boolean; // default is true
resetCache: boolean; // default is false
interactive: boolean; // default is true
activeArchOnly?: boolean;
}
5 changes: 5 additions & 0 deletions packages/react-native/src/executors/run-android/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
"type": "boolean",
"description": "Run packager server in interactive mode.",
"default": true
},
"activeArchOnly": {
"type": "boolean",
"description": "Builds only for the active architecture (e.g. x86_64, arm64-v8a).",
"default": false
}
},
"examplesFile": "../../../docs/run-android-examples.md"
Expand Down