Skip to content

Commit abcc6af

Browse files
authored
build: move from angular-cli to gulp (#948)
Fixed #1636.
1 parent b5e1e33 commit abcc6af

File tree

246 files changed

+780
-3520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+780
-3520
lines changed

.travis.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,11 @@ env:
2424
- BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB
2525
- ARCH=linux-x64
2626
- BROWSER_PROVIDER_READY_FILE=/tmp/angular-material2-build/readyfile
27-
# Token for tsd to increase github rate limit
28-
# See https://github.com/DefinitelyTyped/tsd#tsdrc
29-
# This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables
30-
# because those are not visible for pull requests, and those should also be reliable.
31-
# This SSO token belongs to github account angular-github-ratelimit-token which has no access
32-
# (password is in Valentine)
33-
- TSDRC='{"token":"ef474500309daea53d5991b3079159a29520a40b"}'
3427
# GITHUB_TOKEN_ANGULAR
3528
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
3629
matrix:
3730
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
3831
- MODE=lint
39-
- MODE=circular_deps
4032
- MODE=extract_metadata
4133
- MODE=e2e
4234
- MODE=saucelabs_required
@@ -51,13 +43,12 @@ matrix:
5143

5244
install:
5345
- npm install
54-
- npm run typings
5546

5647
before_script:
5748
- mkdir -p $LOGS_DIR
5849

5950
script:
60-
- ./scripts/ci/build-and-test.sh
51+
- ./scripts/ci/build-and-test.sh
6152

6253
cache:
6354
directories:

angular-cli-build.js

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

angular-cli.json

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

gulpfile.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
/**
3+
* Load the TypeScript compiler, then load the TypeScript gulpfile which simply loads all
4+
* the tasks. The tasks are really inside tools/gulp/tasks.
5+
*/
6+
7+
const path = require('path');
8+
9+
// Register TS compilation.
10+
require('ts-node').register({
11+
project: path.join(__dirname, 'tools/gulp')
12+
});
13+
14+
require('./tools/gulp/gulpfile');

package.json

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,12 @@
88
"url": "https://github.com/angular/material2.git"
99
},
1010
"scripts": {
11-
"ci:forbidden-identifiers": "node ./scripts/ci/forbidden-identifiers.js",
12-
"build": "ng build",
13-
"demo-app": "ng serve",
14-
"test": "karma start test/karma.conf.js",
15-
"tslint": "tslint -c tslint.json 'src/**/*.ts'",
16-
"stylelint": "stylelint 'src/**/*.scss' --config stylelint-config.json --syntax scss",
17-
"check-circular-deps": "madge --circular ./dist",
18-
"typings": "typings install --global",
19-
"postinstall": "npm run typings",
20-
"e2e": "protractor",
21-
"inline-resources": "node ./scripts/release/inline-resources.js ./dist/components",
11+
"build": "gulp build",
12+
"demo-app": "gulp serve:devapp",
13+
"test": "gulp test",
14+
"tslint": "gulp lint",
15+
"stylelint": "gulp lint",
16+
"e2e": "gulp e2e",
2217
"deploy": "firebase deploy",
2318
"webdriver-manager": "webdriver-manager"
2419
},
@@ -31,10 +26,10 @@
3126
"@angular/common": "2.0.0-rc.5",
3227
"@angular/compiler": "2.0.0-rc.5",
3328
"@angular/core": "2.0.0-rc.5",
29+
"@angular/forms": "0.3.0",
3430
"@angular/http": "2.0.0-rc.5",
3531
"@angular/platform-browser": "2.0.0-rc.5",
3632
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
37-
"@angular/forms": "0.3.0",
3833
"@angular/router": "3.0.0-rc.1",
3934
"core-js": "^2.4.0",
4035
"hammerjs": "^2.0.8",
@@ -44,29 +39,40 @@
4439
},
4540
"devDependencies": {
4641
"@angular/compiler-cli": "^0.4.1",
47-
"add-stream": "^1.0.0",
48-
"angular-cli": "^1.0.0-beta.9",
49-
"broccoli-autoprefixer": "^4.1.0",
50-
"broccoli-funnel": "^1.0.1",
51-
"broccoli-merge-trees": "^1.1.1",
42+
"@types/glob": "^5.0.29",
43+
"@types/gulp": "^3.8.29",
44+
"@types/hammerjs": "^2.0.30",
45+
"@types/jasmine": "^2.2.31",
46+
"@types/merge2": "0.0.28",
47+
"@types/node": "^6.0.34",
48+
"@types/run-sequence": "0.0.27",
5249
"browserstacktunnel-wrapper": "^1.4.2",
5350
"conventional-changelog": "^1.1.0",
54-
"ember-cli-inject-live-reload": "^1.4.0",
51+
"express": "^4.14.0",
5552
"firebase-tools": "^2.2.1",
5653
"fs-extra": "^0.26.5",
5754
"glob": "^6.0.4",
55+
"gulp": "^3.9.1",
56+
"gulp-clean": "^0.3.2",
57+
"gulp-sass": "^2.3.2",
58+
"gulp-server-livereload": "^1.8.2",
59+
"gulp-shell": "^0.5.2",
60+
"gulp-sourcemaps": "^1.6.0",
61+
"gulp-typescript": "^2.13.6",
5862
"jasmine-core": "^2.4.1",
59-
"js-yaml": "^3.5.2",
6063
"karma": "^1.1.1",
6164
"karma-browserstack-launcher": "^1.0.1",
6265
"karma-chrome-launcher": "^1.0.1",
6366
"karma-firefox-launcher": "^1.0.0",
6467
"karma-jasmine": "^1.0.2",
6568
"karma-sauce-launcher": "^1.0.0",
6669
"madge": "^0.6.0",
70+
"merge2": "^1.0.2",
6771
"node-sass": "^3.4.2",
6872
"protractor": "^3.3.0",
6973
"protractor-accessibility-plugin": "0.1.1",
74+
"resolve-bin": "^0.4.0",
75+
"run-sequence": "^1.2.2",
7076
"sass": "^0.5.0",
7177
"strip-ansi": "^3.0.0",
7278
"stylelint": "^6.9.0",

scripts/ci/build-and-test.sh

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,12 @@ start_tunnel
1414

1515
wait_for_tunnel
1616
if is_lint; then
17-
npm run tslint
18-
npm run ci:forbidden-identifiers
19-
npm run stylelint
20-
elif is_circular_deps_check; then
21-
# Build first because madge needs the JavaScript output.
22-
ng build
23-
npm run check-circular-deps
17+
$(npm bin)/gulp ci:lint
2418
elif is_e2e; then
25-
# Start up the e2e app. This will take some time.
26-
echo "Starting e2e app"
27-
MD_APP=e2e ng serve &
28-
sleep 1
29-
30-
# Wait until the dist/ directory is created, indicating that the e2e app is ready.
31-
# Use the presence of `button.js` to determine whether the compiled output is ready to be served.
32-
echo "Waiting for e2e app to start"
33-
while [ ! -f ./dist/components/button/button.js ]; do
34-
sleep 2
35-
echo -n ".."
36-
done
37-
38-
echo "\nInlining resources"
39-
npm run inline-resources
40-
41-
# Run the e2e tests on the served e2e app.
42-
echo "Starting e2e tests"
43-
ng e2e
19+
$(npm bin)/gulp ci:e2e
4420
elif is_extract_metadata; then
45-
# Run `tsc` first so that the directory structure in dist/ matches what ngc expects.
46-
./node_modules/.bin/tsc -p ./src/demo-app/
47-
./node_modules/.bin/ngc -p ./src/demo-app/
21+
$(npm bin)/gulp ci:extract-metadata
4822
else
49-
# Unit tests
50-
npm run build
51-
npm run inline-resources
52-
53-
karma start test/karma.conf.js --single-run --no-auto-watch --reporters='dots'
23+
$(npm bin)/gulp ci:test
5424
fi
5525
teardown_tunnel

scripts/ci/forbidden-identifiers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const blocked_statements = [
2929
];
3030

3131
const sourceFolders = ['./src', './e2e'];
32-
const scopePackages = ['src/core'].concat(glob('src/components/*'));
32+
const scopePackages = glob('src/lib/*');
3333
const blockedRegex = new RegExp(blocked_statements.join('|'), 'g');
3434
const importRegex = /from\s+'(.*)';/g;
3535

@@ -227,4 +227,4 @@ function exec(cmd) {
227227
}
228228
});
229229
});
230-
}
230+
}

scripts/ci/sources/mode.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ is_lint() {
99
[[ "$MODE" = lint ]]
1010
}
1111

12-
is_circular_deps_check() {
13-
[[ "$MODE" = circular_deps ]]
14-
}
15-
1612
is_extract_metadata() {
1713
[[ "$MODE" = extract_metadata ]]
1814
}

0 commit comments

Comments
 (0)