forked from microsoft/rushstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildAction.ts
More file actions
37 lines (31 loc) · 1.09 KB
/
BuildAction.ts
File metadata and controls
37 lines (31 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { CommandLineAction } from '@microsoft/ts-command-line';
import { RushStackCommandLine } from './RushStackCommandLine';
import { BasicTasks } from '../logic/BasicTasks';
import { BuildContext } from '../logic/BuildContext';
export class BuildAction extends CommandLineAction {
constructor(parser: RushStackCommandLine) {
super({
actionName: 'build',
summary: 'Build the current project',
documentation: ''
});
}
protected onDefineParameters(): void { // override
this.defineFlagParameter({
parameterLongName: '--production',
description: 'used for production builds'
});
this.defineFlagParameter({
parameterLongName: '--no-color',
description: ''
});
}
protected onExecute(): Promise<void> { // override
const buildContext: BuildContext = new BuildContext();
BasicTasks.doClean(buildContext);
BasicTasks.doBuild(buildContext);
return Promise.resolve();
}
}