This repository was archived by the owner on Nov 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 181
Expand file tree
/
Copy pathdownload-libs.sh
More file actions
executable file
·141 lines (126 loc) · 4.39 KB
/
download-libs.sh
File metadata and controls
executable file
·141 lines (126 loc) · 4.39 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/usr/bin/env bash
# Copyright 2016 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 VSAQ build dependencies
#
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
THIRD_PARTY_DIRECTORY="third_party"
type unzip >/dev/null 2>&1 || {
echo >&2 "Unzip is required to build VSAQ dependencies."
exit 1
}
type wget >/dev/null 2>&1 || {
echo >&2 "Wget is required to build VSAQ dependencies."
exit 1
}
type ant >/dev/null 2>&1 || {
echo >&2 "Ant is required to build VSAQ dependencies."
exit 1
}
type mvn >/dev/null 2>&1 || {
echo >&2 "Apache Maven is required to build VSAQ dependencies."
exit 1
}
type javac >/dev/null 2>&1 || {
echo >&2 "Java compiler is required to build VSAQ dependencies."
exit 1
}
type git >/dev/null 2>&1 || {
echo >&2 "Git is required to build VSAQ dependencies."
exit 1
}
type curl >/dev/null 2>&1 || {
echo >&2 "Curl is required to build VSAQ dependencies."
exit 1
}
type unzip >/dev/null 2>&1 || {
echo >&2 "Unzip is required to build VSAQ 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 VSAQ."
exit 1
fi
# if repo was downloaded as zip from github, init git and clear submodules
if [ ! -d .git ]; then
git init
rm -rf $THIRD_PARTY_DIRECTORY/closure-compiler
rm -rf $THIRD_PARTY_DIRECTORY/closure-library
rm -rf $THIRD_PARTY_DIRECTORY/closure-stylesheets
rm -rf $THIRD_PARTY_DIRECTORY/js-dossier
rm -rf $THIRD_PARTY_DIRECTORY/closure-templates
fi
if [ ! -d $THIRD_PARTY_DIRECTORY ]; then
mkdir $THIRD_PARTY_DIRECTORY
fi
cd $THIRD_PARTY_DIRECTORY
git submodule add -f https://github.com/google/closure-compiler closure-compiler
git submodule add -f https://github.com/google/closure-library closure-library
git submodule add -f https://github.com/google/closure-stylesheets closure-stylesheets
git submodule add -f https://github.com/google/closure-templates closure-templates
git submodule add -f https://github.com/jleyba/js-dossier js-dossier
git submodule add -f https://github.com/google/safe-html-types safe-html-types
git submodule init
git submodule update
# Pin submodules to particular commits
cd closure-compiler
git checkout -b 0441c526dc7ed322034d4f708062c00802184e8f 0441c526dc7ed322034d4f708062c00802184e8f
cd ..
cd closure-library
git checkout -b 26de3253e443d36f64c2ea380faee879dfcf1c54 26de3253e443d36f64c2ea380faee879dfcf1c54
cd ..
cd js-dossier
git checkout -b e6e55806ea97a4fcf4157661ee809eb8b48fe848 e6e55806ea97a4fcf4157661ee809eb8b48fe848
cd ..
cd closure-templates
git checkout -b 17dad0f13db94ca43a2e4c436658682a0403ced1 17dad0f13db94ca43a2e4c436658682a0403ced1
cd ..
cd safe-html-types
git checkout -b 8507735457ea41a37dfa027fb176d49d5783c4ba 8507735457ea41a37dfa027fb176d49d5783c4ba
cd ..
cd closure-stylesheets
git checkout -b d2c0cce5c11891c086a3d055ec84e96d5b9cb559 d2c0cce5c11891c086a3d055ec84e96d5b9cb559
cd ..
# build closure compiler
if [ ! -f closure-compiler/build/compiler.jar ] && [ -d closure-compiler ]; then
cd closure-compiler
mvn -DskipTests -pl externs/pom.xml,pom-main.xml,pom-main-shaded.xml
cd ..
fi
# build closure templates compiler
if [ -d closure-templates ] && [ ! -d closure-templates/target ]; then
cd closure-templates
mvn -DskipTests package
cd ..
fi
# build css compiler
if [ ! -f closure-stylesheets/target/closure-stylesheets-1.5.0-SNAPSHOT-jar-with-dependencies.jar ]; then
cd closure-stylesheets
mvn compile assembly:single
cd ..
fi
if [ -f chrome_extensions.js ]; then
rm -f chrome_extensions.js
fi
mkdir protoc; cd protoc
wget https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
unzip protoc-3.5.1-linux-x86_64.zip
rm protoc-3.5.1-linux-x86_64.zip
wget https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-js-3.5.1.zip
unzip protobuf-js-3.5.1.zip
rm protobuf-js-3.5.1.zip
cd ..
cd ..