Skip to content

Commit e5d624a

Browse files
committedJan 8, 2014
chore(build): update angular from the build directory
1 parent c5c5408 commit e5d624a

File tree

5 files changed

+115
-41
lines changed

5 files changed

+115
-41
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ logs/*
22
!.gitkeep
33
node_modules/
44
tmp
5+
.idea
56
.DS_Store
67
angular-phonecat-snapshots

‎app/index-async.html.template

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Google Phone Gallery</title>
6+
<style>
7+
[ng-cloak] {
8+
display: none;
9+
}
10+
</style>
11+
<link rel="stylesheet" href="css/app.css">
12+
<link rel="stylesheet" href="css/bootstrap.css">
13+
<link rel="stylesheet" href="css/animations.css">
14+
<script>
15+
// include angular loader, which allows the files to load in any order
16+
@@NG_LOADER@@
17+
18+
// include a third-party async loader library
19+
/*!
20+
* $script.js v1.3
21+
* https://github.com/ded/script.js
22+
* Copyright: @ded & @fat - Dustin Diaz, Jacob Thornton 2011
23+
* Follow our software http://twitter.com/dedfat
24+
* License: MIT
25+
*/
26+
!function(a,b,c){function t(a,c){var e=b.createElement("script"),f=j;e.onload=e.onerror=e[o]=function(){e[m]&&!/^c|loade/.test(e[m])||f||(e.onload=e[o]=null,f=1,c())},e.async=1,e.src=a,d.insertBefore(e,d.firstChild)}function q(a,b){p(a,function(a){return!b(a)})}var d=b.getElementsByTagName("head")[0],e={},f={},g={},h={},i="string",j=!1,k="push",l="DOMContentLoaded",m="readyState",n="addEventListener",o="onreadystatechange",p=function(a,b){for(var c=0,d=a.length;c<d;++c)if(!b(a[c]))return j;return 1};!b[m]&&b[n]&&(b[n](l,function r(){b.removeEventListener(l,r,j),b[m]="complete"},j),b[m]="loading");var s=function(a,b,d){function o(){if(!--m){e[l]=1,j&&j();for(var a in g)p(a.split("|"),n)&&!q(g[a],n)&&(g[a]=[])}}function n(a){return a.call?a():e[a]}a=a[k]?a:[a];var i=b&&b.call,j=i?b:d,l=i?a.join(""):b,m=a.length;c(function(){q(a,function(a){h[a]?(l&&(f[l]=1),o()):(h[a]=1,l&&(f[l]=1),t(s.path?s.path+a+".js":a,o))})},0);return s};s.get=t,s.ready=function(a,b,c){a=a[k]?a:[a];var d=[];!q(a,function(a){e[a]||d[k](a)})&&p(a,function(a){return e[a]})?b():!function(a){g[a]=g[a]||[],g[a][k](b),c&&c(d)}(a.join("|"));return s};var u=a.$script;s.noConflict=function(){a.$script=u;return this},typeof module!="undefined"&&module.exports?module.exports=s:a.$script=s}(this,document,setTimeout)
27+
28+
// load all of the dependencies asynchronously.
29+
$script([
30+
'lib/angular/angular.js',
31+
'lib/angular/angular-animate.js',
32+
'lib/angular/angular-resource.js',
33+
'lib/angular/angular-route.js',
34+
'js/app.js',
35+
'js/services.js',
36+
'js/controllers.js',
37+
'js/filters.js',
38+
'js/directives.js',
39+
'js/animations.js'
40+
], function() {
41+
// when all is done, execute bootstrap angular application
42+
debugger;
43+
angular.bootstrap(document, ['phonecatApp']);
44+
})
45+
</script>
46+
</head>
47+
<body ng-cloak>
48+
<div class="view-container">
49+
<div ng-view class="view-frame"></div>
50+
</div>
51+
</body>
52+
</html>

‎scripts/private/download-angular.sh

-21
This file was deleted.

‎scripts/private/test-all.sh

+29-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,45 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
function cleanUp() {
6+
kill $WEBSERVER_PID
7+
git checkout -f $BRANCH
8+
}
9+
10+
trap cleanUp EXIT
11+
12+
# Define reasonable set of browsers in case we are running manually from commandline
13+
if [[ -z "$BROWSERS" ]]
14+
then
15+
BROWSERS="Chrome"
16+
fi
17+
18+
if [[ -z "$BROWSERS_E2E" ]]
19+
then
20+
BROWSERS_E2E="Chrome"
21+
fi
22+
123
ROOT_DIR=`dirname $0`/../..
224

325
cd $ROOT_DIR
26+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
427
npm install
528

29+
./scripts/web-server.js > /dev/null &
30+
WEBSERVER_PID=$!
31+
632
# Steps 0 and 1 do not have any tests - but going to step 0 copies useful files
733
# Step 2 only has unit tests
834
git checkout -f step-2
9-
karma start config/karma.conf.js --single-run
35+
./node_modules/karma/bin/karma start config/karma.conf.js --single-run
1036

1137
# Steps 3 through 12 have both unit and e2e tests
1238
for i in {3..12}
1339
do
1440
git checkout -f step-$i
15-
./scripts/web-server.js > /dev/null &
16-
WEBSERVER_PID=$!
1741

18-
karma start config/karma.conf.js --single-run
19-
karma start config/karma-e2e.conf.js --single-run
42+
./node_modules/karma/bin/karma start config/karma.conf.js --single-run --browsers $BROWSERS --reporters=dots --no-colors --no-color
43+
./node_modules/karma/bin/karma start config/karma-e2e.conf.js --browsers $BROWSERS_E2E --reporters=dots --no-colors --no-color
2044

21-
kill $WEBSERVER_PID
2245
done

‎scripts/private/update-angular.sh

+33-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
11
#! /bin/sh
2-
if [ -n "$1" ]; then
2+
set -xe
33

4-
SCRIPT_DIR=`dirname $0`
5-
ROOT_DIR=$SCRIPT_DIR/../../
4+
NG_BUILD_DIR=$1
5+
if [[ ! -e "$NG_BUILD_DIR/angular.js" ]]; then
6+
echo "Usage: update-angular <angular-build-dir>"
7+
exit 1
8+
fi
69

7-
git checkout -f master
8-
git checkout step-0^ -b update-$1
9-
$SCRIPT_DIR/download-angular.sh $1
10-
git add $ROOT_DIR/app/lib/angular
11-
git commit -m"BUMP ANGULAR VERSION to $1"
10+
SCRIPT_DIR=$(dirname $0)
11+
ROOT_DIR=$SCRIPT_DIR/../../
12+
VERSION=$(cat $NG_BUILD_DIR/version.txt)
1213

13-
for (( i = 0; i <= 12; i++ )); do
14-
git cherry-pick step-$i
15-
done
14+
cd $ROOT_DIR
1615

17-
else
18-
echo "Usage: update-angular <version>"
19-
fi
16+
# go back before the first step
17+
git reset --hard step-0^
18+
19+
# Remove the previous angular version
20+
rm -fr app/lib/angular
21+
# Copy all the angular library files over
22+
cp -r $NG_BUILD_DIR app/lib/angular
23+
# Clean up (in case the angular docs were left in the repos from)
24+
rm -fr app/lib/angular/docs
25+
# Update the inlined angular-loader in app/index-async.html
26+
sed '/@@NG_LOADER@@/{
27+
s/@@NG_LOADER@@//g
28+
r app/lib/angular/angular-loader.min.js
29+
}' app/index-async.html.template > app/index-async.html
30+
31+
git add $ROOT_DIR/app
32+
git commit -m"BUMP ANGULAR VERSION to $VERSION"
33+
34+
for (( i = 0; i <= 12; i++ )); do
35+
git cherry-pick step-$i
36+
done
37+
38+
$SCRIPT_DIR/retag.sh

0 commit comments

Comments
 (0)
Please sign in to comment.