X Tutup
Skip to content

Commit 6197ab0

Browse files
committed
chore(build): split Dart and JS builds
1 parent 8f6c45f commit 6197ab0

File tree

9 files changed

+75
-14
lines changed

9 files changed

+75
-14
lines changed

.travis.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@ env:
99
- LOGS_DIR=/tmp/angular-build/logs
1010
- ARCH=linux-x64
1111
matrix:
12-
- CHANNEL=stable
13-
- CHANNEL=dev
12+
- MODE=js DART_CHANNEL=stable
13+
- MODE=dart DART_CHANNEL=stable
14+
- MODE=dart DART_CHANNEL=dev
1415

1516
before_install:
1617
- export DISPLAY=:99.0
1718
- export GIT_SHA=$(git rev-parse HEAD)
1819
- ./scripts/ci/init_android.sh
19-
- ./scripts/ci/install_dart.sh
20+
- ./scripts/ci/install_dart.sh ${DART_CHANNEL} ${ARCH}
2021
- sh -e /etc/init.d/xvfb start
2122
- if [[ -e SKIP_TRAVIS_TESTS ]]; then { cat SKIP_TRAVIS_TESTS ; exit 0; } fi
2223
before_script:
2324
- mkdir -p $LOGS_DIR
2425
script:
25-
- ./scripts/ci/build.sh
26-
- ./scripts/ci/test_unit.sh
27-
- ./scripts/ci/test_e2e.sh
26+
- ./scripts/ci/build_and_test.sh ${MODE}
2827
after_script:
2928
- ./scripts/ci/print-logs.sh

scripts/ci/build_and_test.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e
3+
4+
MODE=$1
5+
6+
echo =============================================================================
7+
# go to project dir
8+
SCRIPT_DIR=$(dirname $0)
9+
cd $SCRIPT_DIR/../..
10+
11+
${SCRIPT_DIR}/build_$MODE.sh
12+
${SCRIPT_DIR}/test_unit_$MODE.sh
13+
${SCRIPT_DIR}/test_e2e_$MODE.sh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ SCRIPT_DIR=$(dirname $0)
77
source $SCRIPT_DIR/env_dart.sh
88
cd $SCRIPT_DIR/../..
99

10-
./node_modules/.bin/gulp build
10+
./node_modules/.bin/gulp build.js.cjs build.dart
1111

1212
pub install
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set -e
44
echo =============================================================================
55
# go to project dir
66
SCRIPT_DIR=$(dirname $0)
7+
# this is needed because we're running JS tests in Dartium too
78
source $SCRIPT_DIR/env_dart.sh
89
cd $SCRIPT_DIR/../..
910

10-
./node_modules/.bin/gulp ci --browsers=$KARMA_BROWSERS
11+
./node_modules/.bin/gulp build.js

scripts/ci/install_dart.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#!/bin/bash
22

3-
set -e
3+
set -e -x
44

5-
AVAILABLE_DART_VERSION=$(curl "https://storage.googleapis.com/dart-archive/channels/$CHANNEL/release/latest/VERSION" | python -c \
5+
DART_CHANNEL=$1
6+
ARCH=$2
7+
8+
AVAILABLE_DART_VERSION=$(curl "https://storage.googleapis.com/dart-archive/channels/${DART_CHANNEL}/release/latest/VERSION" | python -c \
69
'import sys, json; print(json.loads(sys.stdin.read())["version"])')
710

8-
echo Fetch Dart channel: $CHANNEL
11+
echo Fetch Dart channel: ${DART_CHANNEL}
912

10-
URL_PREFIX=https://storage.googleapis.com/dart-archive/channels/$CHANNEL/release/latest
13+
URL_PREFIX=https://storage.googleapis.com/dart-archive/channels/${DART_CHANNEL}/release/latest
1114
DART_SDK_URL="$URL_PREFIX/sdk/dartsdk-$ARCH-release.zip"
1215
DARTIUM_URL="$URL_PREFIX/dartium/dartium-$ARCH-release.zip"
1316

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ function killServer () {
1313
kill $serverPid
1414
}
1515

16-
./node_modules/.bin/gulp serve.js.prod serve.js.dart2js&
16+
./node_modules/.bin/gulp serve.js.dart2js&
1717
serverPid=$!
1818

1919
trap killServer EXIT
2020

2121
# wait for server to come up!
2222
sleep 10
2323

24-
./node_modules/.bin/protractor protractor-e2e-js.conf.js --browsers=$E2E_BROWSERS
2524
./node_modules/.bin/protractor protractor-e2e-dart2js.conf.js --browsers=$E2E_BROWSERS

scripts/ci/test_e2e_js.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo =============================================================================
5+
# go to project dir
6+
SCRIPT_DIR=$(dirname $0)
7+
source $SCRIPT_DIR/env_dart.sh
8+
cd $SCRIPT_DIR/../..
9+
10+
./node_modules/.bin/webdriver-manager update
11+
12+
function killServer () {
13+
kill $serverPid
14+
}
15+
16+
./node_modules/.bin/gulp serve.js.prod&
17+
serverPid=$!
18+
19+
trap killServer EXIT
20+
21+
# wait for server to come up!
22+
sleep 10
23+
24+
./node_modules/.bin/protractor protractor-e2e-js.conf.js --browsers=$E2E_BROWSERS

scripts/ci/test_unit_dart.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo =============================================================================
5+
# go to project dir
6+
SCRIPT_DIR=$(dirname $0)
7+
source $SCRIPT_DIR/env_dart.sh
8+
cd $SCRIPT_DIR/../..
9+
10+
./node_modules/.bin/gulp test.transpiler.unittest
11+
./node_modules/.bin/gulp test.dart/ci --browsers=$KARMA_BROWSERS

scripts/ci/test_unit_js.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo =============================================================================
5+
# go to project dir
6+
SCRIPT_DIR=$(dirname $0)
7+
source $SCRIPT_DIR/env_dart.sh
8+
cd $SCRIPT_DIR/../..
9+
10+
./node_modules/.bin/gulp test.transpiler.unittest
11+
./node_modules/.bin/gulp test.js/ci --browsers=$KARMA_BROWSERS

0 commit comments

Comments
 (0)
X Tutup