Skip to content

Commit

Permalink
build: move from angular-cli to gulp (#948)
Browse files Browse the repository at this point in the history
Fixed #1636.
  • Loading branch information
hansl authored Aug 19, 2016
1 parent b5e1e33 commit abcc6af
Show file tree
Hide file tree
Showing 246 changed files with 780 additions and 3,520 deletions.
11 changes: 1 addition & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,11 @@ env:
- BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB
- ARCH=linux-x64
- BROWSER_PROVIDER_READY_FILE=/tmp/angular-material2-build/readyfile
# Token for tsd to increase github rate limit
# See https://github.com/DefinitelyTyped/tsd#tsdrc
# This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables
# because those are not visible for pull requests, and those should also be reliable.
# This SSO token belongs to github account angular-github-ratelimit-token which has no access
# (password is in Valentine)
- TSDRC='{"token":"ef474500309daea53d5991b3079159a29520a40b"}'
# GITHUB_TOKEN_ANGULAR
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
matrix:
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
- MODE=lint
- MODE=circular_deps
- MODE=extract_metadata
- MODE=e2e
- MODE=saucelabs_required
Expand All @@ -51,13 +43,12 @@ matrix:

install:
- npm install
- npm run typings

before_script:
- mkdir -p $LOGS_DIR

script:
- ./scripts/ci/build-and-test.sh
- ./scripts/ci/build-and-test.sh

cache:
directories:
Expand Down
111 changes: 0 additions & 111 deletions angular-cli-build.js

This file was deleted.

25 changes: 0 additions & 25 deletions angular-cli.json

This file was deleted.

14 changes: 14 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';
/**
* Load the TypeScript compiler, then load the TypeScript gulpfile which simply loads all
* the tasks. The tasks are really inside tools/gulp/tasks.
*/

const path = require('path');

// Register TS compilation.
require('ts-node').register({
project: path.join(__dirname, 'tools/gulp')
});

require('./tools/gulp/gulpfile');
44 changes: 25 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@
"url": "https://github.com/angular/material2.git"
},
"scripts": {
"ci:forbidden-identifiers": "node ./scripts/ci/forbidden-identifiers.js",
"build": "ng build",
"demo-app": "ng serve",
"test": "karma start test/karma.conf.js",
"tslint": "tslint -c tslint.json 'src/**/*.ts'",
"stylelint": "stylelint 'src/**/*.scss' --config stylelint-config.json --syntax scss",
"check-circular-deps": "madge --circular ./dist",
"typings": "typings install --global",
"postinstall": "npm run typings",
"e2e": "protractor",
"inline-resources": "node ./scripts/release/inline-resources.js ./dist/components",
"build": "gulp build",
"demo-app": "gulp serve:devapp",
"test": "gulp test",
"tslint": "gulp lint",
"stylelint": "gulp lint",
"e2e": "gulp e2e",
"deploy": "firebase deploy",
"webdriver-manager": "webdriver-manager"
},
Expand All @@ -31,10 +26,10 @@
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/forms": "0.3.0",
"@angular/http": "2.0.0-rc.5",
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/forms": "0.3.0",
"@angular/router": "3.0.0-rc.1",
"core-js": "^2.4.0",
"hammerjs": "^2.0.8",
Expand All @@ -44,29 +39,40 @@
},
"devDependencies": {
"@angular/compiler-cli": "^0.4.1",
"add-stream": "^1.0.0",
"angular-cli": "^1.0.0-beta.9",
"broccoli-autoprefixer": "^4.1.0",
"broccoli-funnel": "^1.0.1",
"broccoli-merge-trees": "^1.1.1",
"@types/glob": "^5.0.29",
"@types/gulp": "^3.8.29",
"@types/hammerjs": "^2.0.30",
"@types/jasmine": "^2.2.31",
"@types/merge2": "0.0.28",
"@types/node": "^6.0.34",
"@types/run-sequence": "0.0.27",
"browserstacktunnel-wrapper": "^1.4.2",
"conventional-changelog": "^1.1.0",
"ember-cli-inject-live-reload": "^1.4.0",
"express": "^4.14.0",
"firebase-tools": "^2.2.1",
"fs-extra": "^0.26.5",
"glob": "^6.0.4",
"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-sass": "^2.3.2",
"gulp-server-livereload": "^1.8.2",
"gulp-shell": "^0.5.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-typescript": "^2.13.6",
"jasmine-core": "^2.4.1",
"js-yaml": "^3.5.2",
"karma": "^1.1.1",
"karma-browserstack-launcher": "^1.0.1",
"karma-chrome-launcher": "^1.0.1",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-sauce-launcher": "^1.0.0",
"madge": "^0.6.0",
"merge2": "^1.0.2",
"node-sass": "^3.4.2",
"protractor": "^3.3.0",
"protractor-accessibility-plugin": "0.1.1",
"resolve-bin": "^0.4.0",
"run-sequence": "^1.2.2",
"sass": "^0.5.0",
"strip-ansi": "^3.0.0",
"stylelint": "^6.9.0",
Expand Down
38 changes: 4 additions & 34 deletions scripts/ci/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,12 @@ start_tunnel

wait_for_tunnel
if is_lint; then
npm run tslint
npm run ci:forbidden-identifiers
npm run stylelint
elif is_circular_deps_check; then
# Build first because madge needs the JavaScript output.
ng build
npm run check-circular-deps
$(npm bin)/gulp ci:lint
elif is_e2e; then
# Start up the e2e app. This will take some time.
echo "Starting e2e app"
MD_APP=e2e ng serve &
sleep 1

# Wait until the dist/ directory is created, indicating that the e2e app is ready.
# Use the presence of `button.js` to determine whether the compiled output is ready to be served.
echo "Waiting for e2e app to start"
while [ ! -f ./dist/components/button/button.js ]; do
sleep 2
echo -n ".."
done

echo "\nInlining resources"
npm run inline-resources

# Run the e2e tests on the served e2e app.
echo "Starting e2e tests"
ng e2e
$(npm bin)/gulp ci:e2e
elif is_extract_metadata; then
# Run `tsc` first so that the directory structure in dist/ matches what ngc expects.
./node_modules/.bin/tsc -p ./src/demo-app/
./node_modules/.bin/ngc -p ./src/demo-app/
$(npm bin)/gulp ci:extract-metadata
else
# Unit tests
npm run build
npm run inline-resources

karma start test/karma.conf.js --single-run --no-auto-watch --reporters='dots'
$(npm bin)/gulp ci:test
fi
teardown_tunnel
4 changes: 2 additions & 2 deletions scripts/ci/forbidden-identifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const blocked_statements = [
];

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

Expand Down Expand Up @@ -227,4 +227,4 @@ function exec(cmd) {
}
});
});
}
}
4 changes: 0 additions & 4 deletions scripts/ci/sources/mode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ is_lint() {
[[ "$MODE" = lint ]]
}

is_circular_deps_check() {
[[ "$MODE" = circular_deps ]]
}

is_extract_metadata() {
[[ "$MODE" = extract_metadata ]]
}
Loading

0 comments on commit abcc6af

Please sign in to comment.