Skip to content

Commit

Permalink
feat: add ns prepare as an option (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
rob4226 authored Aug 25, 2021
1 parent cdbbd51 commit 9c58bed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/nx/src/builders/build/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export function runBuilder(options: BuildBuilderSchema, context: ExecutorContext
} else {
if (isBuild) {
nsOptions.push('build');
} else if (options.prepare) {
nsOptions.push('prepare');
} else {
if (options.debug === false) {
nsOptions.push('run');
Expand Down Expand Up @@ -156,7 +158,7 @@ export function runBuilder(options: BuildBuilderSchema, context: ExecutorContext
nsOptions.push('--copy-to');
nsOptions.push(options.copyTo);
}

if (fileReplacements.length) {
// console.log('fileReplacements:', fileReplacements);
nsOptions.push('--env.replace');
Expand Down
4 changes: 3 additions & 1 deletion packages/nx/src/builders/build/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export interface BuildBuilderSchema extends JsonObject {
production?: boolean;
platform?: 'ios' | 'android';
copyTo?: string;
/** For running `ns prepare <platform>` */
prepare:? boolean;

// ios only
provision?: string;
Expand All @@ -23,4 +25,4 @@ export interface BuildBuilderSchema extends JsonObject {
keyStorePassword?: string;
keyStoreAlias?: string;
keyStoreAliasPassword?: string;
}
}
7 changes: 6 additions & 1 deletion packages/nx/src/builders/build/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
"type": "string",
"description": "When building, copy the package to this location."
},
"prepare:": {
"type": "boolean",
"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.",
"default": false
},
"provision": {
"type": "string",
"description": "(iOS Only) When building, use this provision profile name."
Expand Down Expand Up @@ -89,4 +94,4 @@
}
},
"required": []
}
}

0 comments on commit 9c58bed

Please sign in to comment.