forked from microsoft/rushstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicTasks.ts
More file actions
37 lines (32 loc) · 1.15 KB
/
BasicTasks.ts
File metadata and controls
37 lines (32 loc) · 1.15 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 * as path from 'path';
import * as child_process from 'child_process';
import { BuildContext } from './BuildContext';
import { FileSystem } from '@microsoft/node-core-library';
export class BasicTasks {
/**
* Build task: Cleans all the temporary files
*/
public static doClean(buildContext: BuildContext): void {
const foldersToClean: string[] = [
'temp',
'lib',
'dist'
];
for (const folderToClean of foldersToClean) {
const fullPath: string = path.join(buildContext.projectFolder, folderToClean);
console.log(`[clean]: Cleaning "${fullPath}"`);
FileSystem.ensureEmptyFolder(fullPath);
}
}
/**
* Build task: Runs the typescript compiler
*/
public static doBuild(buildContext: BuildContext): void {
console.log(`[clean]: Starting`);
const tscPath: string = path.join(buildContext.projectFolder, 'node_modules/.bin/rush-tsc');
child_process.execSync(tscPath, { stdio: 'inherit' });
console.log(`[clean]: Finished`);
}
}