Skip to content

Commit 9c58bed

Browse files
authored
feat: add ns prepare as an option (#34)
1 parent cdbbd51 commit 9c58bed

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

packages/nx/src/builders/build/builder.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ export function runBuilder(options: BuildBuilderSchema, context: ExecutorContext
9292
} else {
9393
if (isBuild) {
9494
nsOptions.push('build');
95+
} else if (options.prepare) {
96+
nsOptions.push('prepare');
9597
} else {
9698
if (options.debug === false) {
9799
nsOptions.push('run');
@@ -156,7 +158,7 @@ export function runBuilder(options: BuildBuilderSchema, context: ExecutorContext
156158
nsOptions.push('--copy-to');
157159
nsOptions.push(options.copyTo);
158160
}
159-
161+
160162
if (fileReplacements.length) {
161163
// console.log('fileReplacements:', fileReplacements);
162164
nsOptions.push('--env.replace');

packages/nx/src/builders/build/schema.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export interface BuildBuilderSchema extends JsonObject {
1313
production?: boolean;
1414
platform?: 'ios' | 'android';
1515
copyTo?: string;
16+
/** For running `ns prepare <platform>` */
17+
prepare:? boolean;
1618

1719
// ios only
1820
provision?: string;
@@ -23,4 +25,4 @@ export interface BuildBuilderSchema extends JsonObject {
2325
keyStorePassword?: string;
2426
keyStoreAlias?: string;
2527
keyStoreAliasPassword?: string;
26-
}
28+
}

packages/nx/src/builders/build/schema.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
"type": "string",
5858
"description": "When building, copy the package to this location."
5959
},
60+
"prepare:": {
61+
"type": "boolean",
62+
"description": "Starts a Webpack compilation and prepares the app's App_Resources and the plugins platforms directories. The output is generated in a subdirectory for the selected target platform in the platforms directory. This lets you build the project for the selected platform.",
63+
"default": false
64+
},
6065
"provision": {
6166
"type": "string",
6267
"description": "(iOS Only) When building, use this provision profile name."
@@ -89,4 +94,4 @@
8994
}
9095
},
9196
"required": []
92-
}
97+
}

0 commit comments

Comments
 (0)