Skip to content

Commit 5c6a685

Browse files
devversiontinayuangao
authored andcommitted
build: move release packages to constants (#4818)
* build: move release packages to constants * Moves the list of packages that should be released to the constants file. * Sets the executable bit flag on the `deploy-screenshot-functions.sh` script * Rename constants to build config
1 parent 2103907 commit 5c6a685

21 files changed

+28
-28
lines changed

scripts/release/deploy-screenshot-functions.sh

100644100755
File mode changed.

tools/gulp/constants.ts renamed to tools/gulp/build-config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ export const HTML_MINIFIER_OPTIONS = {
2929
removeAttributeQuotes: false
3030
};
3131

32+
/** Packages that will be published to NPM by the release task. */
33+
export const RELEASE_PACKAGES = [
34+
'cdk',
35+
'material',
36+
];
37+
3238
export const LICENSE_BANNER = `/**
3339
* @license Angular Material v${MATERIAL_VERSION}
3440
* Copyright (c) 2017 Google, Inc. https://material.angular.io/

tools/gulp/packaging/build-bundles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {join} from 'path';
22
import {ScriptTarget, ModuleKind} from 'typescript';
3-
import {DIST_BUNDLES} from '../constants';
3+
import {DIST_BUNDLES} from '../build-config';
44
import {uglifyJsFile} from './minify-sources';
55
import {createRollupBundle} from './rollup-helpers';
66
import {remapSourcemap} from './sourcemap-remap';

tools/gulp/packaging/build-release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {join} from 'path';
2-
import {DIST_BUNDLES, DIST_ROOT, SOURCE_ROOT, PROJECT_ROOT} from '../constants';
2+
import {DIST_BUNDLES, DIST_ROOT, SOURCE_ROOT, PROJECT_ROOT} from '../build-config';
33
import {copyFiles} from '../util/copy-files';
44
import {addPureAnnotationsToFile} from './pure-annotations';
55
import {updatePackageVersion} from './package-versions';

tools/gulp/packaging/build-tasks-gulp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {task, watch} from 'gulp';
22
import {join} from 'path';
33
import {main as tsc} from '@angular/tsc-wrapped';
4-
import {SOURCE_ROOT, DIST_ROOT} from '../constants';
4+
import {SOURCE_ROOT, DIST_ROOT} from '../build-config';
55
import {sequenceTask, sassBuildTask, copyTask, triggerLivereload} from '../util/task_helpers';
66
import {composeRelease} from './build-release';
77
import {buildPackageBundles} from './build-bundles';

tools/gulp/packaging/package-versions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {writeFileSync} from 'fs';
22
import {join} from 'path';
3-
import {MATERIAL_VERSION} from '../constants';
3+
import {MATERIAL_VERSION} from '../build-config';
44

55
/** Updates the `package.json` file of the specified package. Replaces the version placeholder. */
66
export function updatePackageVersion(packageDir: string) {

tools/gulp/packaging/rollup-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {LICENSE_BANNER} from '../constants';
1+
import {LICENSE_BANNER} from '../build-config';
22

33
// There are no type definitions available for these imports.
44
const rollup = require('rollup');

tools/gulp/packaging/typings-reexport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {writeFileSync} from 'fs';
2-
import {LICENSE_BANNER} from '../constants';
2+
import {LICENSE_BANNER} from '../build-config';
33
import {join} from 'path';
44

55
/** Create a typing file that links to the bundled definitions of NGC. */

tools/gulp/tasks/aot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {task} from 'gulp';
22
import {copySync} from 'fs-extra';
3-
import {DIST_DEMOAPP, DIST_RELEASES} from '../constants';
3+
import {DIST_DEMOAPP, DIST_RELEASES} from '../build-config';
44
import {sequenceTask, execNodeTask} from '../util/task_helpers';
55
import {join} from 'path';
66

tools/gulp/tasks/clean.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {task} from 'gulp';
2-
import {DIST_ROOT} from '../constants';
2+
import {DIST_ROOT} from '../build-config';
33
import {cleanTask} from '../util/task_helpers';
44

55

tools/gulp/tasks/coverage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {task} from 'gulp';
22
import {existsSync} from 'fs-extra';
3-
import {COVERAGE_RESULT_FILE} from '../constants';
3+
import {COVERAGE_RESULT_FILE} from '../build-config';
44
import {spawnSync} from 'child_process';
55
import {isTravisMasterBuild} from '../util/travis-ci';
66
import {openFirebaseDashboardApp} from '../util/firebase';

tools/gulp/tasks/development.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {task, watch} from 'gulp';
2-
import {DIST_ROOT, SOURCE_ROOT, PROJECT_ROOT, DIST_BUNDLES, DIST_MATERIAL} from '../constants';
2+
import {DIST_ROOT, SOURCE_ROOT, PROJECT_ROOT, DIST_BUNDLES, DIST_MATERIAL} from '../build-config';
33
import {
44
sassBuildTask, tsBuildTask, copyTask, buildAppTask, sequenceTask, triggerLivereload,
55
serverTask

tools/gulp/tasks/docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {task, src, dest} from 'gulp';
22
import {Dgeni} from 'dgeni';
33
import * as path from 'path';
4-
import {DIST_ROOT, HTML_MINIFIER_OPTIONS, SOURCE_ROOT} from '../constants';
4+
import {DIST_ROOT, HTML_MINIFIER_OPTIONS, SOURCE_ROOT} from '../build-config';
55

66
// There are no type definitions available for these imports.
77
const markdown = require('gulp-markdown');

tools/gulp/tasks/e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {task, watch} from 'gulp';
22
import * as path from 'path';
33

4-
import {SOURCE_ROOT, DIST_E2EAPP, PROJECT_ROOT} from '../constants';
4+
import {SOURCE_ROOT, DIST_E2EAPP, PROJECT_ROOT} from '../build-config';
55
import {
66
tsBuildTask, copyTask, buildAppTask, execNodeTask, sequenceTask, serverTask
77
} from '../util/task_helpers';

tools/gulp/tasks/lint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {task} from 'gulp';
22
import {execNodeTask} from '../util/task_helpers';
3-
import {DIST_MATERIAL, DIST_CDK} from '../constants';
3+
import {DIST_MATERIAL, DIST_CDK} from '../build-config';
44

55
/** Glob that matches all SCSS or CSS files that should be linted. */
66
const stylesGlob = '+(tools|src)/**/*.+(css|scss)';

tools/gulp/tasks/material-release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {join} from 'path';
33
import {writeFileSync} from 'fs';
44
import {Bundler} from 'scss-bundle';
55
import {sequenceTask} from '../util/task_helpers';
6-
import {COMPONENTS_DIR, DIST_MATERIAL, DIST_RELEASES} from '../constants';
6+
import {COMPONENTS_DIR, DIST_MATERIAL, DIST_RELEASES} from '../build-config';
77
import {composeRelease} from '../packaging/build-release';
88

99
// There are no type definitions available for these imports.

tools/gulp/tasks/payload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {task} from 'gulp';
22
import {join} from 'path';
33
import {statSync} from 'fs';
4-
import {DIST_ROOT} from '../constants';
4+
import {DIST_ROOT} from '../build-config';
55
import {spawnSync} from 'child_process';
66
import {isTravisMasterBuild} from '../util/travis-ci';
77
import {openFirebaseDashboardApp} from '../util/firebase';

tools/gulp/tasks/publish.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,17 @@ import {existsSync, statSync} from 'fs-extra';
33
import {join} from 'path';
44
import {task} from 'gulp';
55
import {execTask, sequenceTask} from '../util/task_helpers';
6-
import {DIST_RELEASES} from '../constants';
6+
import {DIST_RELEASES, RELEASE_PACKAGES} from '../build-config';
77
import {yellow, green, red, grey} from 'chalk';
88
import * as minimist from 'minimist';
99

1010
/** Parse command-line arguments for release task. */
1111
const argv = minimist(process.argv.slice(3));
1212

13-
/** Packages that will be published to NPM. */
14-
const releasePackages = [
15-
'cdk',
16-
'material',
17-
];
18-
1913
/** Task that builds all releases that will be published. */
2014
task(':publish:build-releases', sequenceTask(
2115
'clean',
22-
releasePackages.map(packageName => `${packageName}:build-release`)
16+
RELEASE_PACKAGES.map(packageName => `${packageName}:build-release`)
2317
));
2418

2519
/** Make sure we're logged in. */
@@ -89,12 +83,12 @@ task(':publish', async () => {
8983
}
9084
console.log('');
9185

92-
if (releasePackages.length > 1) {
86+
if (RELEASE_PACKAGES.length > 1) {
9387
console.warn(red('Warning: Multiple packages will be released if proceeding.'));
9488
}
9589

9690
// Iterate over every declared release package and publish it on NPM.
97-
for (const packageName of releasePackages) {
91+
for (const packageName of RELEASE_PACKAGES) {
9892
await _execNpmPublish(label, packageName);
9993
}
10094

tools/gulp/tasks/unit-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {join} from 'path';
22
import {task, watch} from 'gulp';
3-
import {PROJECT_ROOT, SOURCE_ROOT} from '../constants';
3+
import {PROJECT_ROOT, SOURCE_ROOT} from '../build-config';
44
import {sequenceTask} from '../util/task_helpers';
55

66
// There are no type definitions available for these imports.

tools/gulp/util/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {MATERIAL_VERSION} from '../constants';
1+
import {MATERIAL_VERSION} from '../build-config';
22

33
const request = require('request');
44

tools/gulp/util/task_helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as child_process from 'child_process';
22
import * as fs from 'fs';
33
import * as gulp from 'gulp';
44
import * as path from 'path';
5-
import {PROJECT_ROOT} from '../constants';
5+
import {PROJECT_ROOT} from '../build-config';
66

77
/* Those imports lack typings. */
88
const gulpClean = require('gulp-clean');

0 commit comments

Comments
 (0)