Skip to content

Commit 194e76e

Browse files
committed
chore(travis): include dart doc generation
- Installs Dart SDK - Installs ng2/dart sources from the pub package site. - Re-enables doc build on Travis Note that `npm install -g gulp --no-optional` has been removed since it does not appear to be needed. Implements most of angular#1907.
1 parent 1e908ff commit 194e76e

9 files changed

+171
-12
lines changed

.travis.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,26 @@ env:
1111
- DISPLAY=:99.0
1212
- CHROME_BIN=chromium-browser
1313
- LATEST_RELEASE=2.0.0-rc.4
14+
- TASK_FLAGS="--dgeni-log=warn"
15+
# - TASK_FLAGS=""
1416
matrix:
1517
- TASK=lint
1618
- TASK="run-e2e-tests --fast" SCRIPT=examples-install.sh
1719
- TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh
18-
- TASK=build-compile SCRIPT=deploy-install.sh
19-
- TASK=build-compile SCRIPT=deploy-install-preview.sh
20+
- TASK=build-compile SCRIPT=deploy-install.sh WAIT="travis_wait 50"
21+
- TASK=build-compile SCRIPT=deploy-install-preview.sh WAIT="travis_wait 50"
2022
matrix:
2123
fast_finish: true
2224
allow_failures:
23-
- env: "TASK=\"run-e2e-tests --fast\" SCRIPT=examples-install-preview.sh"
24-
- env: "TASK=build-compile SCRIPT=deploy-install-preview.sh"
25+
- env: TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh
26+
- env: TASK=build-compile SCRIPT=deploy-install-preview.sh WAIT="travis_wait 50"
2527
before_install:
26-
- npm install -g gulp --no-optional
28+
- source ./scripts/env-set.sh
29+
- ./scripts/before-install.sh
2730
install:
2831
- npm install --no-optional
29-
- if [[ $SCRIPT ]]; then ./scripts/$SCRIPT; fi
32+
- if [[ -n "$SCRIPT" ]]; then echo "EXTRA INSTALL $SCRIPT"; ./scripts/$SCRIPT; fi
3033
before_script:
3134
- sh -e /etc/init.d/xvfb start
3235
script:
33-
- gulp $TASK
36+
- $WAIT gulp $TASK $TASK_FLAGS

gulpfile.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,7 @@ gulp.task('build-docs', ['build-devguide-docs', 'build-api-docs', 'build-plunker
545545
// Stop zipping examples Feb 28, 2016
546546
//gulp.task('build-docs', ['build-devguide-docs', 'build-api-docs', 'build-plunkers', '_zip-examples']);
547547

548-
gulp.task('build-api-docs', ['build-js-api-docs', 'build-ts-api-docs', 'build-dart-cheatsheet']
549-
// On TRAVIS? Skip building the Dart API docs for now.
550-
.concat(process.env.TRAVIS ? [] : ['build-dart-api-docs']));
548+
gulp.task('build-api-docs', ['build-js-api-docs', 'build-ts-api-docs', 'build-dart-api-docs']);
551549

552550
gulp.task('build-devguide-docs', ['_shred-devguide-examples', '_shred-devguide-shared-jade'], function() {
553551
return buildShredMaps(true);

pubspec.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: angular2_io
2+
description: Angular 2 for Dart Website
3+
version: 0.0.1
4+
environment:
5+
sdk: '>=1.13.0 <2.0.0'
6+
dependencies:
7+
angular2: 2.0.0-beta.17
8+
browser: ^0.10.0
9+
dart_to_js_script_rewriter: ^1.0.1
10+
transformers:
11+
- angular2:
12+
platform_directives:
13+
- 'package:angular2/common.dart#COMMON_DIRECTIVES'
14+
platform_pipes:
15+
- 'package:angular2/common.dart#COMMON_PIPES'
16+
entry_points: web/main.dart
17+
- dart_to_js_script_rewriter

scripts/before-install.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -o pipefail
4+
5+
./scripts/env-info-and-check.sh
6+
7+
if [[ 0 ]]; then
8+
# Doesn't seem to be necessary. Disabling.
9+
travis_fold start install.globals
10+
set -x
11+
npm install -g gulp --no-optional
12+
set +x
13+
travis_fold end install.globals
14+
fi

scripts/deploy-install.sh

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#!/usr/bin/env bash
22

3-
set -ex -o pipefail
3+
set -e -o pipefail
44

5-
(cd ../ && git clone https://github.com/angular/angular.git --branch $LATEST_RELEASE)
5+
travis_fold start install.ng2
6+
echo GETTING Angular2 from GitHub ...
7+
set -x
8+
git clone https://github.com/angular/angular.git --branch $LATEST_RELEASE $NG2_REPO
9+
set +x
10+
travis_fold end install.ng2
11+
12+
./scripts/install-ng2dart.sh
13+
14+
echo INSTALLED repos:
15+
ls -ld ../a*

scripts/env-info-and-check.sh

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -o pipefail
4+
5+
travis_fold start env_info
6+
echo ENVIRONMENT INFO
7+
travis_fold start env_info.path
8+
echo Path:
9+
echo $PATH | tr : '\n'
10+
echo
11+
travis_fold end env_info.path
12+
travis_fold start env_info.home
13+
echo Home: $HOME
14+
ls ~ -la
15+
echo
16+
travis_fold end env_info.home
17+
travis_fold start env_info.pwd
18+
echo Pwd: `pwd`
19+
ls -la
20+
echo
21+
travis_fold end env_info.pwd
22+
if [[ 0 ]]; then
23+
# Not needed anymore, but keeping it at least for the first commit for archival purposes.
24+
travis_fold start env_info.bash_profile
25+
echo Bash profile ------------------------------------------------------------
26+
cat ~/.bash_profile
27+
travis_fold end env_info.bash_profile
28+
travis_fold start env_info.bashrc
29+
echo Bashrc ------------------------------------------------------------------
30+
cat ~/.bashrc
31+
echo -------------------------------------------------------------------------
32+
travis_fold end env_info.bashrc
33+
travis_fold start env_info.build
34+
echo build.sh ----------------------------------------------------------------
35+
cat ~/build.sh
36+
echo -------------------------------------------------------------------------
37+
travis_fold end env_info.build
38+
fi
39+
travis_fold end env_info
40+
41+
echo ENVIRONMENT CONFIG CHECK:
42+
if [[ -z "$NGIO_ENV_DEFS" ]]; then
43+
echo Environment variables are not being set. Aborting.
44+
exit 1;
45+
else
46+
echo Environment variables successfully set.
47+
fi

scripts/env-set.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
# Ensure that this script is idempotent (esp. for PATH)
4+
if [[ -z "$NGIO_ENV_DEFS" ]]; then
5+
export ANSI_YELLOW="\033[33;1m"
6+
echo -e "${ANSI_YELLOW}Setting environment variables from scripts/env.sh${ANSI_RESET}"
7+
8+
export NGIO_ENV_DEFS=1
9+
10+
export TMP=$HOME/tmp
11+
export PKG=$TMP/pkg
12+
13+
[[ ! -d $TMP ]] && mkdir $TMP
14+
[[ ! -d $PKG ]] && mkdir $PKG
15+
16+
export DART_SDK="$PKG/dart-sdk"
17+
export PATH="$DART_SDK/bin:$PATH"
18+
export PATH="$HOME/.pub-cache/bin:$PATH"
19+
20+
export NG2_REPO=../angular
21+
export NG2DART_REPO=$NG2_REPO-dart
22+
23+
if [ ! $(type -t travis_fold) ]; then
24+
# In case this is being run locally.
25+
travis_fold () { echo -en "travis_fold:${1}:${2}"; }
26+
fi
27+
export -f travis_fold
28+
export ANSI_RESET
29+
fi

scripts/install-dart-sdk.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -o pipefail
4+
5+
travis_fold start install.dart
6+
echo Installing Dart SDK ...
7+
8+
# curl https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip > $TMP/dartsdk.zip
9+
10+
DART_ARCHIVE=https://storage.googleapis.com/dart-archive/channels
11+
VERS=stable/release/latest/sdk
12+
OS_ZIP=dartsdk-linux-x64-release.zip
13+
14+
curl $DART_ARCHIVE/$VERS/$OS_ZIP > $TMP/$OS_ZIP
15+
16+
unzip $TMP/$OS_ZIP -d $PKG > /dev/null
17+
travis_fold end install.dart
18+
19+
dart --version

scripts/install-ng2dart.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -o pipefail
4+
5+
if [[ ! -e "$NG2DART_REPO" ]]; then
6+
./scripts/install-dart-sdk.sh
7+
fi
8+
9+
travis_fold start install.ng2dart
10+
echo GETTING Angular2/Dart from pub package ...
11+
set -x
12+
# Get ng2dart via pub on ng.io pubspec.yaml
13+
pub upgrade
14+
15+
NG2DART_PUB=`find ~/.pub-cache/ -type d -name "angular2*" | xargs ls -dtr | tail -1`
16+
17+
cp -r $NG2DART_PUB $NG2DART_REPO
18+
# Run pub on ng2dart
19+
(cd $NG2DART_REPO && pub get)
20+
21+
set +x
22+
travis_fold end install.ng2dart

0 commit comments

Comments
 (0)