Skip to content

Commit b97ab67

Browse files
committed
refactor(commands): turn .run commands into tasks
1 parent 7edac2b commit b97ab67

14 files changed

+582
-572
lines changed

packages/angular-cli/commands/build.run.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/angular-cli/commands/build.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { BuildOptions } from '../models/webpack-config';
1+
import { BuildOptions } from '../models/build-options';
2+
import { Version } from '../upgrade/version';
23

34
const Command = require('../ember-cli/lib/models/command');
45

@@ -22,7 +23,7 @@ export const BaseBuildCommandOptions: any = [
2223
{ name: 'i18n-file', type: String },
2324
{ name: 'i18n-format', type: String },
2425
{ name: 'locale', type: String },
25-
{ name: 'extract-css', type: Boolean, aliases: ['ec']},
26+
{ name: 'extract-css', type: Boolean, aliases: ['ec'] },
2627
{
2728
name: 'output-hashing',
2829
type: String,
@@ -46,7 +47,19 @@ const BuildCommand = Command.extend({
4647
]),
4748

4849
run: function (commandOptions: BuildTaskOptions) {
49-
return require('./build.run').default.call(this, commandOptions);
50+
const project = this.project;
51+
52+
// Check angular version.
53+
Version.assertAngularVersionIs2_3_1OrHigher(project.root);
54+
55+
const BuildTask = require('../tasks/build').default;
56+
57+
const buildTask = new BuildTask({
58+
cliProject: project,
59+
ui: this.ui,
60+
});
61+
62+
return buildTask.run(commandOptions);
5063
}
5164
});
5265

packages/angular-cli/commands/github-pages-deploy.run.ts

Lines changed: 0 additions & 272 deletions
This file was deleted.

0 commit comments

Comments
 (0)