Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 1 | #!/bin/bash |
Thomas Van Lenten | c4d3638 | 2015-06-09 13:35:41 -0400 | [diff] [blame] | 2 | |
Josh Haberman | 0f8c25d | 2016-02-19 09:11:38 -0800 | [diff] [blame] | 3 | on_travis() { |
| 4 | if [ "$TRAVIS" == "true" ]; then |
| 5 | "$@" |
| 6 | fi |
| 7 | } |
| 8 | |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 9 | # For when some other test needs the C++ main build, including protoc and |
| 10 | # libprotobuf. |
| 11 | internal_build_cpp() { |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 12 | if [ -f src/protoc ]; then |
| 13 | # Already built. |
| 14 | return |
| 15 | fi |
| 16 | |
Josh Haberman | d33e93b | 2016-02-18 19:13:07 -0800 | [diff] [blame] | 17 | if [[ $(uname -s) == "Linux" && "$TRAVIS" == "true" ]]; then |
Feng Xiao | 9125863 | 2015-12-21 03:34:28 -0800 | [diff] [blame] | 18 | # Install GCC 4.8 to replace the default GCC 4.6. We need 4.8 for more |
| 19 | # decent C++ 11 support in order to compile conformance tests. |
| 20 | sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y |
| 21 | sudo apt-get update -qq |
| 22 | sudo apt-get install -qq g++-4.8 |
| 23 | export CXX="g++-4.8" CC="gcc-4.8" |
| 24 | fi |
Feng Xiao | 1e2fece | 2015-12-18 15:16:07 -0800 | [diff] [blame] | 25 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 26 | ./autogen.sh |
| 27 | ./configure |
Josh Haberman | d33e93b | 2016-02-18 19:13:07 -0800 | [diff] [blame] | 28 | make $PARALLELISM |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | build_cpp() { |
| 32 | internal_build_cpp |
Josh Haberman | d33e93b | 2016-02-18 19:13:07 -0800 | [diff] [blame] | 33 | make check $PARALLELISM |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 34 | cd conformance && make test_cpp && cd .. |
| 35 | } |
| 36 | |
| 37 | build_cpp_distcheck() { |
| 38 | ./autogen.sh |
| 39 | ./configure |
Josh Haberman | d33e93b | 2016-02-18 19:13:07 -0800 | [diff] [blame] | 40 | make distcheck $PARALLELISM |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 41 | } |
| 42 | |
Jan Tattermusch | ddb36ef | 2015-05-18 17:34:02 -0700 | [diff] [blame] | 43 | build_csharp() { |
Jon Skeet | b6defa7 | 2015-08-04 10:01:40 +0100 | [diff] [blame] | 44 | # Just for the conformance tests. We don't currently |
| 45 | # need to really build protoc, but it's simplest to keep with the |
| 46 | # conventions of the other builds. |
| 47 | internal_build_cpp |
Josh Haberman | ffc8118 | 2016-02-22 15:39:29 -0800 | [diff] [blame] | 48 | NUGET=/usr/local/bin/nuget.exe |
Jon Skeet | b6defa7 | 2015-08-04 10:01:40 +0100 | [diff] [blame] | 49 | |
Josh Haberman | ffc8118 | 2016-02-22 15:39:29 -0800 | [diff] [blame] | 50 | if [ "$TRAVIS" == "true" ]; then |
| 51 | # Install latest version of Mono |
| 52 | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF |
| 53 | echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list |
| 54 | echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list |
| 55 | sudo apt-get update -qq |
| 56 | sudo apt-get install -qq mono-devel referenceassemblies-pcl nunit |
| 57 | wget www.nuget.org/NuGet.exe -O nuget.exe |
| 58 | NUGET=../../nuget.exe |
| 59 | fi |
Jan Tattermusch | ddb36ef | 2015-05-18 17:34:02 -0700 | [diff] [blame] | 60 | |
Josh Haberman | ffc8118 | 2016-02-22 15:39:29 -0800 | [diff] [blame] | 61 | (cd csharp/src; mono $NUGET restore) |
Jan Tattermusch | ddb36ef | 2015-05-18 17:34:02 -0700 | [diff] [blame] | 62 | csharp/buildall.sh |
Josh Haberman | e891c29 | 2015-12-30 16:03:49 -0800 | [diff] [blame] | 63 | cd conformance && make test_csharp && cd .. |
Jan Tattermusch | ddb36ef | 2015-05-18 17:34:02 -0700 | [diff] [blame] | 64 | } |
| 65 | |
Tim Swast | 7e31c4d | 2015-11-20 15:32:53 -0800 | [diff] [blame] | 66 | build_golang() { |
| 67 | # Go build needs `protoc`. |
| 68 | internal_build_cpp |
| 69 | # Add protoc to the path so that the examples build finds it. |
| 70 | export PATH="`pwd`/src:$PATH" |
| 71 | |
| 72 | # Install Go and the Go protobuf compiler plugin. |
| 73 | sudo apt-get update -qq |
| 74 | sudo apt-get install -qq golang |
| 75 | export GOPATH="$HOME/gocode" |
| 76 | mkdir -p "$GOPATH/src/github.com/google" |
| 77 | ln -s "`pwd`" "$GOPATH/src/github.com/google/protobuf" |
| 78 | export PATH="$GOPATH/bin:$PATH" |
| 79 | go get github.com/golang/protobuf/protoc-gen-go |
| 80 | |
| 81 | cd examples && make gotest && cd .. |
| 82 | } |
| 83 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 84 | use_java() { |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 85 | version=$1 |
| 86 | case "$version" in |
| 87 | jdk6) |
Josh Haberman | 0f8c25d | 2016-02-19 09:11:38 -0800 | [diff] [blame] | 88 | on_travis sudo apt-get install openjdk-6-jdk |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 89 | export PATH=/usr/lib/jvm/java-6-openjdk-amd64/bin:$PATH |
| 90 | ;; |
| 91 | jdk7) |
Josh Haberman | 0f8c25d | 2016-02-19 09:11:38 -0800 | [diff] [blame] | 92 | on_travis sudo apt-get install openjdk-7-jdk |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 93 | export PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH |
| 94 | ;; |
| 95 | oracle7) |
Josh Haberman | ffc8118 | 2016-02-22 15:39:29 -0800 | [diff] [blame] | 96 | if [ "$TRAVIS" == "true" ]; then |
| 97 | sudo apt-get install python-software-properties # for apt-add-repository |
| 98 | echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" | \ |
| 99 | sudo debconf-set-selections |
| 100 | yes | sudo apt-add-repository ppa:webupd8team/java |
| 101 | yes | sudo apt-get install oracle-java7-installer |
| 102 | fi; |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 103 | export PATH=/usr/lib/jvm/java-7-oracle/bin:$PATH |
| 104 | ;; |
| 105 | esac |
| 106 | |
| 107 | which java |
| 108 | java -version |
| 109 | } |
| 110 | |
Josh Haberman | d08c39c | 2016-02-20 12:03:39 -0800 | [diff] [blame] | 111 | # --batch-mode supresses download progress output that spams the logs. |
Josh Haberman | b28b3f6 | 2016-02-20 12:17:10 -0800 | [diff] [blame] | 112 | MVN="mvn --batch-mode" |
Josh Haberman | d08c39c | 2016-02-20 12:03:39 -0800 | [diff] [blame] | 113 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 114 | build_java() { |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame^] | 115 | version=$1 |
| 116 | dir=java_$version |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 117 | # Java build needs `protoc`. |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 118 | internal_build_cpp |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame^] | 119 | cp -r java $dir |
| 120 | cd $dir && $MVN clean && $MVN test |
Feng Xiao | 9e5fb55 | 2015-12-21 11:08:18 -0800 | [diff] [blame] | 121 | cd ../.. |
| 122 | } |
| 123 | |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame^] | 124 | # The conformance tests are hard-coded to work with the $ROOT/java directory. |
| 125 | # So this can't run in parallel with two different sets of tests. |
Feng Xiao | 9e5fb55 | 2015-12-21 11:08:18 -0800 | [diff] [blame] | 126 | build_java_with_conformance_tests() { |
| 127 | # Java build needs `protoc`. |
| 128 | internal_build_cpp |
Josh Haberman | d08c39c | 2016-02-20 12:03:39 -0800 | [diff] [blame] | 129 | cd java && $MVN test && $MVN install |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame^] | 130 | cd util && $MVN package assembly:single |
Feng Xiao | af81dcf | 2015-12-21 03:25:59 -0800 | [diff] [blame] | 131 | cd ../.. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 132 | cd conformance && make test_java && cd .. |
| 133 | } |
| 134 | |
| 135 | build_javanano() { |
| 136 | # Java build needs `protoc`. |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 137 | internal_build_cpp |
Josh Haberman | b28b3f6 | 2016-02-20 12:17:10 -0800 | [diff] [blame] | 138 | cd javanano && $MVN test && cd .. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | build_java_jdk6() { |
| 142 | use_java jdk6 |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame^] | 143 | build_java jdk6 |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 144 | } |
| 145 | build_java_jdk7() { |
| 146 | use_java jdk7 |
Feng Xiao | 9e5fb55 | 2015-12-21 11:08:18 -0800 | [diff] [blame] | 147 | build_java_with_conformance_tests |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 148 | } |
| 149 | build_java_oracle7() { |
| 150 | use_java oracle7 |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame^] | 151 | build_java oracle7 |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | build_javanano_jdk6() { |
| 155 | use_java jdk6 |
| 156 | build_javanano |
| 157 | } |
| 158 | build_javanano_jdk7() { |
| 159 | use_java jdk7 |
| 160 | build_javanano |
| 161 | } |
| 162 | build_javanano_oracle7() { |
| 163 | use_java oracle7 |
| 164 | build_javanano |
| 165 | } |
| 166 | |
Dan O'Reilly | 5de2a81 | 2015-08-20 18:19:56 -0400 | [diff] [blame] | 167 | internal_install_python_deps() { |
Josh Haberman | 483533d | 2016-02-19 12:48:33 -0800 | [diff] [blame] | 168 | if [ "$TRAVIS" != "true" ]; then |
| 169 | return; |
| 170 | fi |
Thomas Van Lenten | 9642b82 | 2015-06-10 17:21:23 -0400 | [diff] [blame] | 171 | # Install tox (OS X doesn't have pip). |
| 172 | if [ $(uname -s) == "Darwin" ]; then |
| 173 | sudo easy_install tox |
| 174 | else |
| 175 | sudo pip install tox |
| 176 | fi |
Dan O'Reilly | d9598ca | 2015-08-26 20:30:41 -0400 | [diff] [blame] | 177 | # Only install Python2.6/3.x on Linux. |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 178 | if [ $(uname -s) == "Linux" ]; then |
| 179 | sudo apt-get install -y python-software-properties # for apt-add-repository |
| 180 | sudo apt-add-repository -y ppa:fkrull/deadsnakes |
| 181 | sudo apt-get update -qq |
| 182 | sudo apt-get install -y python2.6 python2.6-dev |
Dan O'Reilly | d9598ca | 2015-08-26 20:30:41 -0400 | [diff] [blame] | 183 | sudo apt-get install -y python3.3 python3.3-dev |
| 184 | sudo apt-get install -y python3.4 python3.4-dev |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 185 | fi |
Dan O'Reilly | 5de2a81 | 2015-08-20 18:19:56 -0400 | [diff] [blame] | 186 | } |
| 187 | |
Thomas Van Lenten | 76b6138 | 2015-11-09 14:21:51 -0500 | [diff] [blame] | 188 | internal_objectivec_common () { |
| 189 | # Make sure xctool is up to date. Adapted from |
| 190 | # http://docs.travis-ci.com/user/osx-ci-environment/ |
| 191 | # We don't use a before_install because we test multiple OSes. |
| 192 | brew update |
Thomas Van Lenten | 8c78450 | 2016-02-18 11:08:30 -0500 | [diff] [blame] | 193 | # xctool 0.2.8 seems to have a bug where it randomly kills tests saying |
| 194 | # they failed. Disabling the updates, but letting it report about being |
| 195 | # updates as a hint that this needs to eventually get re-enabled. |
| 196 | # https://github.com/facebook/xctool/issues/619 |
| 197 | # https://github.com/google/protobuf/issues/1232 |
| 198 | brew outdated xctool || true |
| 199 | #brew outdated xctool || brew upgrade xctool |
Thomas Van Lenten | 76b6138 | 2015-11-09 14:21:51 -0500 | [diff] [blame] | 200 | # Reused the build script that takes care of configuring and ensuring things |
Thomas Van Lenten | 1745f7e | 2015-11-17 10:18:49 -0500 | [diff] [blame] | 201 | # are up to date. Xcode and conformance tests will be directly invoked. |
| 202 | objectivec/DevTools/full_mac_build.sh \ |
| 203 | --core-only --skip-xcode --skip-objc-conformance |
Thomas Van Lenten | 76b6138 | 2015-11-09 14:21:51 -0500 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | internal_xctool_debug_and_release() { |
Thomas Van Lenten | efca368 | 2016-02-16 15:10:14 -0500 | [diff] [blame] | 207 | # Always use -reporter plain to avoid escape codes in output (makes travis |
| 208 | # logs easier to read). |
| 209 | xctool -reporter plain -configuration Debug "$@" |
| 210 | xctool -reporter plain -configuration Release "$@" |
Thomas Van Lenten | 9642b82 | 2015-06-10 17:21:23 -0400 | [diff] [blame] | 211 | } |
| 212 | |
| 213 | build_objectivec_ios() { |
Thomas Van Lenten | 76b6138 | 2015-11-09 14:21:51 -0500 | [diff] [blame] | 214 | internal_objectivec_common |
| 215 | # https://github.com/facebook/xctool/issues/509 - unlike xcodebuild, xctool |
| 216 | # doesn't support >1 destination, so we have to build first and then run the |
| 217 | # tests one destination at a time. |
| 218 | internal_xctool_debug_and_release \ |
| 219 | -project objectivec/ProtocolBuffers_iOS.xcodeproj \ |
| 220 | -scheme ProtocolBuffers \ |
| 221 | -sdk iphonesimulator \ |
| 222 | build-tests |
| 223 | IOS_DESTINATIONS=( |
| 224 | "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit |
Thomas Van Lenten | 1324119 | 2016-02-16 09:19:50 -0500 | [diff] [blame] | 225 | "platform=iOS Simulator,name=iPhone 6,OS=9.2" # 64bit |
Thomas Van Lenten | 76b6138 | 2015-11-09 14:21:51 -0500 | [diff] [blame] | 226 | "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit |
Thomas Van Lenten | 1324119 | 2016-02-16 09:19:50 -0500 | [diff] [blame] | 227 | "platform=iOS Simulator,name=iPad Air,OS=9.2" # 64bit |
Thomas Van Lenten | 76b6138 | 2015-11-09 14:21:51 -0500 | [diff] [blame] | 228 | ) |
| 229 | for i in "${IOS_DESTINATIONS[@]}" ; do |
| 230 | internal_xctool_debug_and_release \ |
| 231 | -project objectivec/ProtocolBuffers_iOS.xcodeproj \ |
| 232 | -scheme ProtocolBuffers \ |
| 233 | -sdk iphonesimulator \ |
| 234 | -destination "${i}" \ |
Thomas Van Lenten | 8c78450 | 2016-02-18 11:08:30 -0500 | [diff] [blame] | 235 | run-tests |
Thomas Van Lenten | 76b6138 | 2015-11-09 14:21:51 -0500 | [diff] [blame] | 236 | done |
Thomas Van Lenten | 9642b82 | 2015-06-10 17:21:23 -0400 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | build_objectivec_osx() { |
Thomas Van Lenten | 76b6138 | 2015-11-09 14:21:51 -0500 | [diff] [blame] | 240 | internal_objectivec_common |
| 241 | internal_xctool_debug_and_release \ |
| 242 | -project objectivec/ProtocolBuffers_OSX.xcodeproj \ |
| 243 | -scheme ProtocolBuffers \ |
| 244 | -destination "platform=OS X,arch=x86_64" \ |
| 245 | test |
Thomas Van Lenten | 1745f7e | 2015-11-17 10:18:49 -0500 | [diff] [blame] | 246 | cd conformance && make test_objc && cd .. |
Thomas Van Lenten | 9642b82 | 2015-06-10 17:21:23 -0400 | [diff] [blame] | 247 | } |
Dan O'Reilly | 5de2a81 | 2015-08-20 18:19:56 -0400 | [diff] [blame] | 248 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 249 | build_python() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 250 | internal_build_cpp |
Dan O'Reilly | 5de2a81 | 2015-08-20 18:19:56 -0400 | [diff] [blame] | 251 | internal_install_python_deps |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 252 | cd python |
Dan O'Reilly | d9598ca | 2015-08-26 20:30:41 -0400 | [diff] [blame] | 253 | # Only test Python 2.6/3.x on Linux |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 254 | if [ $(uname -s) == "Linux" ]; then |
Jie Luo | 2850a98 | 2015-10-09 17:07:03 -0700 | [diff] [blame] | 255 | envlist=py\{26,27,33,34\}-python |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 256 | else |
| 257 | envlist=py27-python |
| 258 | fi |
| 259 | tox -e $envlist |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 260 | cd .. |
| 261 | } |
| 262 | |
| 263 | build_python_cpp() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 264 | internal_build_cpp |
Dan O'Reilly | 5de2a81 | 2015-08-20 18:19:56 -0400 | [diff] [blame] | 265 | internal_install_python_deps |
| 266 | export LD_LIBRARY_PATH=../src/.libs # for Linux |
Tamir Duberstein | c91d9ab | 2015-05-14 21:32:39 -0400 | [diff] [blame] | 267 | export DYLD_LIBRARY_PATH=../src/.libs # for OS X |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 268 | cd python |
Dan O'Reilly | d9598ca | 2015-08-26 20:30:41 -0400 | [diff] [blame] | 269 | # Only test Python 2.6/3.x on Linux |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 270 | if [ $(uname -s) == "Linux" ]; then |
Jisi Liu | 72bd9c9 | 2015-10-06 10:48:57 -0700 | [diff] [blame] | 271 | # py26 is currently disabled due to json_format |
| 272 | envlist=py\{27,33,34\}-cpp |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 273 | else |
| 274 | envlist=py27-cpp |
| 275 | fi |
| 276 | tox -e $envlist |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 277 | cd .. |
| 278 | } |
| 279 | |
| 280 | build_ruby19() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 281 | internal_build_cpp # For conformance tests. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 282 | cd ruby && bash travis-test.sh ruby-1.9 && cd .. |
| 283 | } |
| 284 | build_ruby20() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 285 | internal_build_cpp # For conformance tests. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 286 | cd ruby && bash travis-test.sh ruby-2.0 && cd .. |
| 287 | } |
| 288 | build_ruby21() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 289 | internal_build_cpp # For conformance tests. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 290 | cd ruby && bash travis-test.sh ruby-2.1 && cd .. |
| 291 | } |
| 292 | build_ruby22() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 293 | internal_build_cpp # For conformance tests. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 294 | cd ruby && bash travis-test.sh ruby-2.2 && cd .. |
| 295 | } |
| 296 | build_jruby() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 297 | internal_build_cpp # For conformance tests. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 298 | cd ruby && bash travis-test.sh jruby && cd .. |
| 299 | } |
| 300 | |
Josh Haberman | e9cf31e | 2015-12-21 15:18:17 -0800 | [diff] [blame] | 301 | build_javascript() { |
| 302 | internal_build_cpp |
Josh Haberman | 0d2d8bc | 2015-12-28 06:43:42 -0800 | [diff] [blame] | 303 | cd js && npm install && npm test && cd .. |
Josh Haberman | e9cf31e | 2015-12-21 15:18:17 -0800 | [diff] [blame] | 304 | } |
| 305 | |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 306 | [ -n "${PARALLELISM}" ] && PARALLELISM=-j8 |
| 307 | |
| 308 | # Note: travis currently does not support testing more than one language so the |
| 309 | # .travis.yml cheats and claims to only be cpp. If they add multiple language |
| 310 | # support, this should probably get updated to install steps and/or |
| 311 | # rvm/gemfile/jdk/etc. entries rather than manually doing the work. |
| 312 | |
| 313 | # .travis.yml uses matrix.exclude to block the cases where app-get can't be |
| 314 | # use to install things. |
| 315 | |
| 316 | # -------- main -------- |
| 317 | |
| 318 | # Set value used in tests.sh. |
| 319 | PARALLELISM=-j2 |
| 320 | |
| 321 | if [ "$#" -ne 1 ]; then |
| 322 | echo " |
| 323 | Usage: $0 { cpp | |
| 324 | csharp | |
| 325 | java_jdk6 | |
| 326 | java_jdk7 | |
| 327 | java_oracle7 | |
| 328 | javanano_jdk6 | |
| 329 | javanano_jdk7 | |
| 330 | javanano_oracle7 | |
| 331 | objectivec_ios | |
| 332 | objectivec_osx | |
| 333 | python | |
| 334 | python_cpp | |
Josh Haberman | ffc8118 | 2016-02-22 15:39:29 -0800 | [diff] [blame] | 335 | ruby19 | |
| 336 | ruby20 | |
| 337 | ruby21 | |
| 338 | ruby22 | |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 339 | jruby } |
| 340 | " |
| 341 | exit 1 |
| 342 | fi |
| 343 | |
| 344 | set -e # exit immediately on error |
| 345 | set -x # display all commands |
| 346 | eval "build_$1" |