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

Co-authored-by: Stefano Formicola <stefano.formicola@cloudacademy.com>
This commit is contained in:
Stefano Formicola 2023-02-17 20:28:19 +01:00 committed by GitHub
parent 4f45212303
commit b7272e33cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 0 deletions

View File

@ -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"

View File

@ -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);
}

View File

@ -13,4 +13,5 @@ export interface ReactNativeRunAndroidOptions {
packager: boolean; // default is true
resetCache: boolean; // default is false
interactive: boolean; // default is true
activeArchOnly?: boolean;
}

View File

@ -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"