Skip to content

build: move release packages to constants #4818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified scripts/release/deploy-screenshot-functions.sh
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions tools/gulp/constants.ts → tools/gulp/build-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export const HTML_MINIFIER_OPTIONS = {
removeAttributeQuotes: false
};

/** Packages that will be published to NPM by the release task. */
export const RELEASE_PACKAGES = [
'cdk',
'material',
];

export const LICENSE_BANNER = `/**
* @license Angular Material v${MATERIAL_VERSION}
* Copyright (c) 2017 Google, Inc. https://material.angular.io/
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/packaging/build-bundles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {join} from 'path';
import {ScriptTarget, ModuleKind} from 'typescript';
import {DIST_BUNDLES} from '../constants';
import {DIST_BUNDLES} from '../build-config';
import {uglifyJsFile} from './minify-sources';
import {createRollupBundle} from './rollup-helpers';
import {remapSourcemap} from './sourcemap-remap';
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/packaging/build-release.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {join} from 'path';
import {DIST_BUNDLES, DIST_ROOT, SOURCE_ROOT, PROJECT_ROOT} from '../constants';
import {DIST_BUNDLES, DIST_ROOT, SOURCE_ROOT, PROJECT_ROOT} from '../build-config';
import {copyFiles} from '../util/copy-files';
import {addPureAnnotationsToFile} from './pure-annotations';
import {updatePackageVersion} from './package-versions';
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/packaging/build-tasks-gulp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {task, watch} from 'gulp';
import {join} from 'path';
import {main as tsc} from '@angular/tsc-wrapped';
import {SOURCE_ROOT, DIST_ROOT} from '../constants';
import {SOURCE_ROOT, DIST_ROOT} from '../build-config';
import {sequenceTask, sassBuildTask, copyTask, triggerLivereload} from '../util/task_helpers';
import {composeRelease} from './build-release';
import {buildPackageBundles} from './build-bundles';
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/packaging/package-versions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {writeFileSync} from 'fs';
import {join} from 'path';
import {MATERIAL_VERSION} from '../constants';
import {MATERIAL_VERSION} from '../build-config';

/** Updates the `package.json` file of the specified package. Replaces the version placeholder. */
export function updatePackageVersion(packageDir: string) {
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/packaging/rollup-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {LICENSE_BANNER} from '../constants';
import {LICENSE_BANNER} from '../build-config';

// There are no type definitions available for these imports.
const rollup = require('rollup');
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/packaging/typings-reexport.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {writeFileSync} from 'fs';
import {LICENSE_BANNER} from '../constants';
import {LICENSE_BANNER} from '../build-config';
import {join} from 'path';

/** Create a typing file that links to the bundled definitions of NGC. */
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/aot.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {task} from 'gulp';
import {copySync} from 'fs-extra';
import {DIST_DEMOAPP, DIST_RELEASES} from '../constants';
import {DIST_DEMOAPP, DIST_RELEASES} from '../build-config';
import {sequenceTask, execNodeTask} from '../util/task_helpers';
import {join} from 'path';

Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/clean.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {task} from 'gulp';
import {DIST_ROOT} from '../constants';
import {DIST_ROOT} from '../build-config';
import {cleanTask} from '../util/task_helpers';


Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/coverage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {task} from 'gulp';
import {existsSync} from 'fs-extra';
import {COVERAGE_RESULT_FILE} from '../constants';
import {COVERAGE_RESULT_FILE} from '../build-config';
import {spawnSync} from 'child_process';
import {isTravisMasterBuild} from '../util/travis-ci';
import {openFirebaseDashboardApp} from '../util/firebase';
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/development.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {task, watch} from 'gulp';
import {DIST_ROOT, SOURCE_ROOT, PROJECT_ROOT, DIST_BUNDLES, DIST_MATERIAL} from '../constants';
import {DIST_ROOT, SOURCE_ROOT, PROJECT_ROOT, DIST_BUNDLES, DIST_MATERIAL} from '../build-config';
import {
sassBuildTask, tsBuildTask, copyTask, buildAppTask, sequenceTask, triggerLivereload,
serverTask
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/docs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {task, src, dest} from 'gulp';
import {Dgeni} from 'dgeni';
import * as path from 'path';
import {DIST_ROOT, HTML_MINIFIER_OPTIONS, SOURCE_ROOT} from '../constants';
import {DIST_ROOT, HTML_MINIFIER_OPTIONS, SOURCE_ROOT} from '../build-config';

// There are no type definitions available for these imports.
const markdown = require('gulp-markdown');
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {task, watch} from 'gulp';
import * as path from 'path';

import {SOURCE_ROOT, DIST_E2EAPP, PROJECT_ROOT} from '../constants';
import {SOURCE_ROOT, DIST_E2EAPP, PROJECT_ROOT} from '../build-config';
import {
tsBuildTask, copyTask, buildAppTask, execNodeTask, sequenceTask, serverTask
} from '../util/task_helpers';
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/lint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {task} from 'gulp';
import {execNodeTask} from '../util/task_helpers';
import {DIST_MATERIAL, DIST_CDK} from '../constants';
import {DIST_MATERIAL, DIST_CDK} from '../build-config';

/** Glob that matches all SCSS or CSS files that should be linted. */
const stylesGlob = '+(tools|src)/**/*.+(css|scss)';
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/material-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {join} from 'path';
import {writeFileSync} from 'fs';
import {Bundler} from 'scss-bundle';
import {sequenceTask} from '../util/task_helpers';
import {COMPONENTS_DIR, DIST_MATERIAL, DIST_RELEASES} from '../constants';
import {COMPONENTS_DIR, DIST_MATERIAL, DIST_RELEASES} from '../build-config';
import {composeRelease} from '../packaging/build-release';

// There are no type definitions available for these imports.
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/payload.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {task} from 'gulp';
import {join} from 'path';
import {statSync} from 'fs';
import {DIST_ROOT} from '../constants';
import {DIST_ROOT} from '../build-config';
import {spawnSync} from 'child_process';
import {isTravisMasterBuild} from '../util/travis-ci';
import {openFirebaseDashboardApp} from '../util/firebase';
Expand Down
14 changes: 4 additions & 10 deletions tools/gulp/tasks/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@ import {existsSync, statSync} from 'fs-extra';
import {join} from 'path';
import {task} from 'gulp';
import {execTask, sequenceTask} from '../util/task_helpers';
import {DIST_RELEASES} from '../constants';
import {DIST_RELEASES, RELEASE_PACKAGES} from '../build-config';
import {yellow, green, red, grey} from 'chalk';
import * as minimist from 'minimist';

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

/** Packages that will be published to NPM. */
const releasePackages = [
'cdk',
'material',
];

/** Task that builds all releases that will be published. */
task(':publish:build-releases', sequenceTask(
'clean',
releasePackages.map(packageName => `${packageName}:build-release`)
RELEASE_PACKAGES.map(packageName => `${packageName}:build-release`)
));

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

if (releasePackages.length > 1) {
if (RELEASE_PACKAGES.length > 1) {
console.warn(red('Warning: Multiple packages will be released if proceeding.'));
}

// Iterate over every declared release package and publish it on NPM.
for (const packageName of releasePackages) {
for (const packageName of RELEASE_PACKAGES) {
await _execNpmPublish(label, packageName);
}

Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/unit-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {join} from 'path';
import {task, watch} from 'gulp';
import {PROJECT_ROOT, SOURCE_ROOT} from '../constants';
import {PROJECT_ROOT, SOURCE_ROOT} from '../build-config';
import {sequenceTask} from '../util/task_helpers';

// There are no type definitions available for these imports.
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/util/github.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {MATERIAL_VERSION} from '../constants';
import {MATERIAL_VERSION} from '../build-config';

const request = require('request');

Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/util/task_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as child_process from 'child_process';
import * as fs from 'fs';
import * as gulp from 'gulp';
import * as path from 'path';
import {PROJECT_ROOT} from '../constants';
import {PROJECT_ROOT} from '../build-config';

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