forked from YahooArchive/end-to-end
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdownload-libs.sh
executable file
·89 lines (76 loc) · 2.69 KB
/
download-libs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env bash
# // Copyright 2014 Google Inc. All rights reserved.
# //
# // Licensed under the Apache License, Version 2.0 (the "License");
# // you may not use this file except in compliance with the License.
# // You may obtain a copy of the License at
# //
# // http://www.apache.org/licenses/LICENSE-2.0
# //
# // Unless required by applicable law or agreed to in writing, software
# // distributed under the License is distributed on an "AS IS" BASIS,
# // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# // See the License for the specific language governing permissions and
# // limitations under the License.
# /**
# * @fileoverview Shell script to download End-To-End build dependencies
# *
# * @author [email protected] (Krzysztof Kotowicz)
# */
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
type ant >/dev/null 2>&1 || {
echo >&2 "Ant is required to build End-To-End dependencies."
exit 1
}
type javac >/dev/null 2>&1 || {
echo >&2 "Java compiler is required to build End-To-End dependencies."
exit 1
}
jversion=$(java -version 2>&1 | grep version | awk -F '"' '{print $2}')
if [[ $jversion < "1.7" ]]; then
echo "Java 1.7 or higher is required to build End-To-End."
exit 1
fi
if [ ! -d lib ]; then
mkdir lib
fi
git submodule init
git submodule update
cd lib
# symlink typedarray
if [ ! -d typedarray ]; then
mkdir typedarray
ln -s ../zlib.js/define/typedarray/use.js typedarray/use.js
fi
# build closure compiler
if [ ! -f closure-compiler/build/compiler.jar ]; then
cd closure-compiler
ant clean
ant jar
cd ..
fi
# checkout closure templates compiler
if [ ! -d closure-templates-compiler ]; then
curl https://dl.google.com/closure-templates/closure-templates-for-javascript-latest.zip -O # -k --ssl-added-and-removed-here-;-)
unzip closure-templates-for-javascript-latest.zip -d closure-templates-compiler
rm closure-templates-for-javascript-latest.zip
fi
# build css compiler
if [ ! -f closure-stylesheets/build/closure-stylesheets.jar ]; then
cd closure-stylesheets
ant
cd ..
fi
if [ -f chrome_extensions.js ]; then
rm -f chrome_extensions.js
fi
# Temporary fix
# Soy file bundled with the compiler does not compile with strict settings:
# lib/closure-templates-compiler/soyutils_usegoog.js:1762: ERROR - element JS_STR_CHARS does not exist on this enum
cd closure-templates-compiler
# Temporary fix
# Lock the version to Sep 16, 2015, in which the compiler can build without the follwing error
# curl https://raw.githubusercontent.com/google/closure-templates/master/javascript/soyutils_usegoog.js -O
curl https://raw.githubusercontent.com/google/closure-templates/0cbc8543c34d3f7727dd83a2d1938672f16d5c20/javascript/soyutils_usegoog.js -O
cd ..
cd ..