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:
parent
4f45212303
commit
b7272e33cd
@ -78,6 +78,11 @@
|
|||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Run packager server in interactive mode.",
|
"description": "Run packager server in interactive mode.",
|
||||||
"default": true
|
"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"
|
"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"
|
||||||
|
|||||||
@ -115,6 +115,10 @@ function createRunAndroidOptions(options) {
|
|||||||
if (!v) {
|
if (!v) {
|
||||||
acc.push(`--no-jetifier`);
|
acc.push(`--no-jetifier`);
|
||||||
}
|
}
|
||||||
|
} else if (k === 'activeArchOnly') {
|
||||||
|
if (v) {
|
||||||
|
acc.push(`--active-arch-only`);
|
||||||
|
}
|
||||||
} else if (v && !nxOrStartOptions.includes(k)) {
|
} else if (v && !nxOrStartOptions.includes(k)) {
|
||||||
acc.push(`--${k}`, v);
|
acc.push(`--${k}`, v);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,4 +13,5 @@ export interface ReactNativeRunAndroidOptions {
|
|||||||
packager: boolean; // default is true
|
packager: boolean; // default is true
|
||||||
resetCache: boolean; // default is false
|
resetCache: boolean; // default is false
|
||||||
interactive: boolean; // default is true
|
interactive: boolean; // default is true
|
||||||
|
activeArchOnly?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -75,6 +75,11 @@
|
|||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Run packager server in interactive mode.",
|
"description": "Run packager server in interactive mode.",
|
||||||
"default": true
|
"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"
|
"examplesFile": "../../../docs/run-android-examples.md"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user