tests.sh 18.1 KB
Newer Older
1
#!/bin/bash
2 3 4 5
#
# Build and runs tests for the protobuf project.  The tests as written here are
# used by both Jenkins and Travis, though some specialized logic is required to
# handle the differences between them.
6

7 8 9 10 11 12
on_travis() {
  if [ "$TRAVIS" == "true" ]; then
    "$@"
  fi
}

13 14 15
# For when some other test needs the C++ main build, including protoc and
# libprotobuf.
internal_build_cpp() {
16 17 18 19 20
  if [ -f src/protoc ]; then
    # Already built.
    return
  fi

Josh Haberman's avatar
Josh Haberman committed
21
  if [[ $(uname -s) == "Linux" && "$TRAVIS" == "true" ]]; then
22 23 24 25 26 27 28
    # Install GCC 4.8 to replace the default GCC 4.6. We need 4.8 for more
    # decent C++ 11 support in order to compile conformance tests.
    sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
    sudo apt-get update -qq
    sudo apt-get install -qq g++-4.8
    export CXX="g++-4.8" CC="gcc-4.8"
  fi
29

30 31 32
  # Initialize any submodules.
  git submodule update --init --recursive

33
  ./autogen.sh
34 35
  ./configure CXXFLAGS="-fPIC"  # -fPIC is needed for python cpp test.
                                # See python/setup.py for more details
36
  make -j2
37 38 39 40
}

build_cpp() {
  internal_build_cpp
41
  make check -j2 || (cat src/test-suite.log; false)
42
  cd conformance && make test_cpp && cd ..
43

44 45 46 47 48 49
  # The benchmark code depends on cmake, so test if it is installed before
  # trying to do the build.
  # NOTE: The travis macOS images say they have cmake, but the xcode8.1 image
  # appears to be missing it: https://github.com/travis-ci/travis-ci/issues/6996
  if [[ $(type cmake 2>/dev/null) ]]; then
    # Verify benchmarking code can build successfully.
Yilun Chong's avatar
Yilun Chong committed
50
    cd benchmarks && make cpp-benchmark && cd ..
51 52 53 54 55
  else
    echo ""
    echo "WARNING: Skipping validation of the bench marking code, cmake isn't installed."
    echo ""
  fi
56 57 58
}

build_cpp_distcheck() {
59 60
  # Initialize any submodules.
  git submodule update --init --recursive
61 62
  ./autogen.sh
  ./configure
63 64 65
  make dist

  # List all files that should be included in the distribution package.
66
  git ls-files | grep "^\(java\|python\|objectivec\|csharp\|js\|ruby\|php\|cmake\|examples\|src/google/protobuf/.*\.proto\)" |\
67
    grep -v ".gitignore" | grep -v "java/compatibility_tests" |\
68
    grep -v "python/compatibility_tests" | grep -v "csharp/compatibility_tests" > dist.lst
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
  # Unzip the dist tar file.
  DIST=`ls *.tar.gz`
  tar -xf $DIST
  cd ${DIST//.tar.gz}
  # Check if every file exists in the dist tar file.
  FILES_MISSING=""
  for FILE in $(<../dist.lst); do
    if ! file $FILE &>/dev/null; then
      echo "$FILE is not found!"
      FILES_MISSING="$FILE $FILES_MISSING"
    fi
  done
  cd ..
  if [ ! -z "$FILES_MISSING" ]; then
    echo "Missing files in EXTRA_DIST: $FILES_MISSING"
    exit 1
  fi

  # Do the regular dist-check for C++.
88
  make distcheck -j2
89 90
}

91
build_csharp() {
92
  # Required for conformance tests and to regenerate protos.
93
  internal_build_cpp
94
  NUGET=/usr/local/bin/nuget.exe
95

96 97 98 99
  # Perform "dotnet new" once to get the setup preprocessing out of the
  # way. That spews a lot of output (including backspaces) into logs
  # otherwise, and can cause problems. It doesn't matter if this step
  # is performed multiple times; it's cheap after the first time anyway.
100 101 102
  # (It also doesn't matter if it's unnecessary, which it will be on some
  # systems. It's necessary on Jenkins in order to avoid unprintable
  # characters appearing in the JUnit output.)
103 104 105 106
  mkdir dotnettmp
  (cd dotnettmp; dotnet new > /dev/null)
  rm -rf dotnettmp

107 108 109
  # Check that the protos haven't broken C# codegen.
  # TODO(jonskeet): Fail if regenerating creates any changes.
  csharp/generate_protos.sh
110

111
  csharp/buildall.sh
112
  cd conformance && make test_csharp && cd ..
113 114 115

  # Run csharp compatibility test between 3.0.0 and the current version.
  csharp/compatibility_tests/v3.0.0/test.sh 3.0.0
116 117
}

Tim Swast's avatar
Tim Swast committed
118 119 120 121 122 123 124
build_golang() {
  # Go build needs `protoc`.
  internal_build_cpp
  # Add protoc to the path so that the examples build finds it.
  export PATH="`pwd`/src:$PATH"

  # Install Go and the Go protobuf compiler plugin.
Feng Xiao's avatar
Feng Xiao committed
125 126 127
  on_travis sudo apt-get update -qq
  on_travis sudo apt-get install -qq golang

Tim Swast's avatar
Tim Swast committed
128 129
  export GOPATH="$HOME/gocode"
  mkdir -p "$GOPATH/src/github.com/google"
Feng Xiao's avatar
Feng Xiao committed
130
  rm -f "$GOPATH/src/github.com/google/protobuf"
Tim Swast's avatar
Tim Swast committed
131 132 133 134
  ln -s "`pwd`" "$GOPATH/src/github.com/google/protobuf"
  export PATH="$GOPATH/bin:$PATH"
  go get github.com/golang/protobuf/protoc-gen-go

Feng Xiao's avatar
Feng Xiao committed
135
  cd examples && PROTO_PATH="-I../src -I." make gotest && cd ..
Tim Swast's avatar
Tim Swast committed
136 137
}

138 139 140 141
use_java() {
  version=$1
  case "$version" in
    jdk7)
142
      on_travis sudo apt-get install openjdk-7-jdk
143
      export PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH
144
      export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
145 146
      ;;
    oracle7)
147 148 149 150 151 152 153
      if [ "$TRAVIS" == "true" ]; then
        sudo apt-get install python-software-properties # for apt-add-repository
        echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" | \
          sudo debconf-set-selections
        yes | sudo apt-add-repository ppa:webupd8team/java
        yes | sudo apt-get install oracle-java7-installer
      fi;
154
      export PATH=/usr/lib/jvm/java-7-oracle/bin:$PATH
155
      export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
156 157 158
      ;;
  esac

159 160 161 162 163
  if [ "$TRAVIS" != "true" ]; then
    MAVEN_LOCAL_REPOSITORY=/var/maven_local_repository
    MVN="$MVN -e -X --offline -Dmaven.repo.local=$MAVEN_LOCAL_REPOSITORY"
  fi;

164 165
  which java
  java -version
166
  $MVN -version
167 168
}

169
# --batch-mode supresses download progress output that spams the logs.
170
MVN="mvn --batch-mode"
171

172
build_java() {
173 174
  version=$1
  dir=java_$version
175 176
  # Java build needs `protoc`.
  internal_build_cpp
177 178
  cp -r java $dir
  cd $dir && $MVN clean && $MVN test
179 180 181
  cd ../..
}

182 183
# The conformance tests are hard-coded to work with the $ROOT/java directory.
# So this can't run in parallel with two different sets of tests.
184
build_java_with_conformance_tests() {
185
  # Java build needs `protoc`.
186
  internal_build_cpp
187
  cd java && $MVN test && $MVN install
188
  cd util && $MVN package assembly:single
Feng Xiao's avatar
Feng Xiao committed
189
  cd ../..
190 191 192 193 194
  cd conformance && make test_java && cd ..
}

build_javanano() {
  # Java build needs `protoc`.
195
  internal_build_cpp
196
  cd javanano && $MVN test && cd ..
197 198 199 200
}

build_java_jdk7() {
  use_java jdk7
201
  build_java_with_conformance_tests
202 203 204
}
build_java_oracle7() {
  use_java oracle7
205
  build_java oracle7
206
}
207 208 209 210 211 212 213 214
build_java_compatibility() {
  use_java jdk7
  internal_build_cpp
  # Use the unit-tests extraced from 2.5.0 to test the compatibilty between
  # 3.0.0-beta-4 and the current version.
  cd java/compatibility_tests/v2.5.0
  ./test.sh 3.0.0-beta-4
}
215 216 217 218 219 220 221 222 223 224

build_javanano_jdk7() {
  use_java jdk7
  build_javanano
}
build_javanano_oracle7() {
  use_java oracle7
  build_javanano
}

225
internal_install_python_deps() {
226 227 228
  if [ "$TRAVIS" != "true" ]; then
    return;
  fi
229 230
  # Install tox (OS X doesn't have pip).
  if [ $(uname -s) == "Darwin" ]; then
231 232
    brew upgrade python
    python3 -m pip install tox
233 234 235
  else
    sudo pip install tox
  fi
236
  # Only install Python2.6/3.x on Linux.
237 238 239 240
  if [ $(uname -s) == "Linux" ]; then
    sudo apt-get install -y python-software-properties # for apt-add-repository
    sudo apt-add-repository -y ppa:fkrull/deadsnakes
    sudo apt-get update -qq
241
    sudo apt-get install -y python3.3 python3.3-dev
242
    sudo apt-get install -y python3.4 python3.4-dev
Jie Luo's avatar
Jie Luo committed
243 244
    sudo apt-get install -y python3.5 python3.5-dev
    sudo apt-get install -y python3.6 python3.6-dev
245
  fi
246 247
}

248
build_objectivec_ios() {
249
  # Reused the build script that takes care of configuring and ensuring things
250 251 252 253 254
  # are up to date.  The OS X test runs the objc conformance test, so skip it
  # here.
  # Note: travis has xctool installed, and we've looked at using it in the past
  # but it has ended up proving unreliable (bugs), an they are removing build
  # support in favor of xcbuild (or just xcodebuild).
255
  objectivec/DevTools/full_mac_build.sh \
256
      --core-only --skip-xcode-osx --skip-objc-conformance "$@"
257 258
}

259 260
build_objectivec_ios_debug() {
  build_objectivec_ios --skip-xcode-release
261 262
}

263 264
build_objectivec_ios_release() {
  build_objectivec_ios --skip-xcode-debug
265 266 267
}

build_objectivec_osx() {
268 269 270 271
  # Reused the build script that takes care of configuring and ensuring things
  # are up to date.
  objectivec/DevTools/full_mac_build.sh \
      --core-only --skip-xcode-ios
272
}
273

274 275 276 277 278 279
build_objectivec_cocoapods_integration() {
  # Update pod to the latest version.
  gem install cocoapods --no-ri --no-rdoc
  objectivec/Tests/CocoaPods/run_tests.sh
}

280
build_python() {
281
  internal_build_cpp
282
  internal_install_python_deps
283
  cd python
284
  # Only test Python 2.6/3.x on Linux
285
  if [ $(uname -s) == "Linux" ]; then
Jie Luo's avatar
Jie Luo committed
286
    envlist=py\{27,33,34,35,36\}-python
287 288 289 290
  else
    envlist=py27-python
  fi
  tox -e $envlist
291 292 293 294
  cd ..
}

build_python_cpp() {
295
  internal_build_cpp
296
  internal_install_python_deps
297 298
  export LD_LIBRARY_PATH=../src/.libs # for Linux
  export DYLD_LIBRARY_PATH=../src/.libs # for OS X
299
  cd python
Jie Luo's avatar
Jie Luo committed
300
  # Only test Python 3.x on Linux
301
  if [ $(uname -s) == "Linux" ]; then
Jie Luo's avatar
Jie Luo committed
302
    envlist=py\{27,33,34,35,36\}-cpp
303 304 305 306
  else
    envlist=py27-cpp
  fi
  tox -e $envlist
307 308 309
  cd ..
}

310 311 312 313 314 315 316 317 318 319
build_python_compatibility() {
  internal_build_cpp
  # Use the unit-tests extraced from 2.5.0 to test the compatibilty.
  cd python/compatibility_tests/v2.5.0
  # Test between 2.5.0 and the current version.
  ./test.sh 2.5.0
  # Test between 3.0.0-beta-1 and the current version.
  ./test.sh 3.0.0-beta-1
}

320
build_ruby21() {
321
  internal_build_cpp  # For conformance tests.
322 323 324
  cd ruby && bash travis-test.sh ruby-2.1 && cd ..
}
build_ruby22() {
325
  internal_build_cpp  # For conformance tests.
326 327
  cd ruby && bash travis-test.sh ruby-2.2 && cd ..
}
328 329 330 331 332 333 334 335 336 337 338 339
build_ruby23() {
  internal_build_cpp  # For conformance tests.
  cd ruby && bash travis-test.sh ruby-2.3 && cd ..
}
build_ruby24() {
  internal_build_cpp  # For conformance tests.
  cd ruby && bash travis-test.sh ruby-2.4 && cd ..
}
build_ruby25() {
  internal_build_cpp  # For conformance tests.
  cd ruby && bash travis-test.sh ruby-2.5.0 && cd ..
}
340
build_jruby() {
341
  internal_build_cpp  # For conformance tests.
Feng Xiao's avatar
Feng Xiao committed
342 343 344 345 346 347 348
  # TODO(xiaofeng): Upgrade to jruby-9.x. There are some broken jests to be
  # fixed.
  cd ruby && bash travis-test.sh jruby-1.7 && cd ..
}
build_ruby_all() {
  build_ruby21
  build_ruby22
349 350 351
  build_ruby23
  build_ruby24
  build_ruby25
352 353
  # TODO(teboring): Disable jruby test temperarily for it randomly fails.
  # https://grpc-testing.appspot.com/job/protobuf_pull_request/735/consoleFull.
354
  # build_jruby
355 356
}

357 358
build_javascript() {
  internal_build_cpp
359
  cd js && npm install && npm test && cd ..
360
  cd conformance && make test_nodejs && cd ..
361 362
}

363 364 365 366 367 368
generate_php_test_proto() {
  internal_build_cpp
  pushd php/tests
  # Generate test file
  rm -rf generated
  mkdir generated
369
  ../../src/protoc --php_out=generated         \
370
    proto/empty/echo.proto                     \
371 372 373 374 375 376 377 378 379 380 381 382 383 384
    proto/test.proto                           \
    proto/test_include.proto                   \
    proto/test_no_namespace.proto              \
    proto/test_prefix.proto                    \
    proto/test_php_namespace.proto             \
    proto/test_empty_php_namespace.proto       \
    proto/test_reserved_enum_lower.proto       \
    proto/test_reserved_enum_upper.proto       \
    proto/test_reserved_enum_value_lower.proto \
    proto/test_reserved_enum_value_upper.proto \
    proto/test_reserved_message_lower.proto    \
    proto/test_reserved_message_upper.proto    \
    proto/test_service.proto                   \
    proto/test_service_namespace.proto         \
385
    proto/test_descriptors.proto
386
  pushd ../../src
387 388
  ./protoc --php_out=../php/tests/generated -I../php/tests -I. \
    ../php/tests/proto/test_import_descriptor_proto.proto
389 390 391 392
  popd
  popd
}

393 394 395 396 397
use_php() {
  VERSION=$1
  PHP=`which php`
  PHP_CONFIG=`which php-config`
  PHPIZE=`which phpize`
398 399 400
  ln -sfn "/usr/local/php-${VERSION}/bin/php" $PHP
  ln -sfn "/usr/local/php-${VERSION}/bin/php-config" $PHP_CONFIG
  ln -sfn "/usr/local/php-${VERSION}/bin/phpize" $PHPIZE
401
  generate_php_test_proto
402 403
}

Bo Yang's avatar
Bo Yang committed
404 405 406 407 408 409 410 411
use_php_zts() {
  VERSION=$1
  PHP=`which php`
  PHP_CONFIG=`which php-config`
  PHPIZE=`which phpize`
  ln -sfn "/usr/local/php-${VERSION}-zts/bin/php" $PHP
  ln -sfn "/usr/local/php-${VERSION}-zts/bin/php-config" $PHP_CONFIG
  ln -sfn "/usr/local/php-${VERSION}-zts/bin/phpize" $PHPIZE
412
  generate_php_test_proto
Bo Yang's avatar
Bo Yang committed
413 414
}

415 416 417 418 419 420 421 422
use_php_bc() {
  VERSION=$1
  PHP=`which php`
  PHP_CONFIG=`which php-config`
  PHPIZE=`which phpize`
  ln -sfn "/usr/local/php-${VERSION}-bc/bin/php" $PHP
  ln -sfn "/usr/local/php-${VERSION}-bc/bin/php-config" $PHP_CONFIG
  ln -sfn "/usr/local/php-${VERSION}-bc/bin/phpize" $PHPIZE
423
  generate_php_test_proto
424 425
}

426
build_php5.5() {
427
  use_php 5.5
428

429
  pushd php
430 431
  rm -rf vendor
  cp -r /usr/local/vendor-5.5 vendor
432 433
  wget https://phar.phpunit.de/phpunit-4.8.0.phar -O /usr/bin/phpunit
  phpunit
434
  popd
435
  pushd conformance
436
  make test_php
437
  popd
438 439
}

440
build_php5.5_c() {
441 442
  use_php 5.5
  wget https://phar.phpunit.de/phpunit-4.8.0.phar -O /usr/bin/phpunit
443
  pushd php/tests
444
  /bin/bash ./test.sh 5.5
445
  popd
446 447 448 449
  # TODO(teboring): Add it back
  # pushd conformance
  # make test_php_c
  # popd
450 451
}

Bo Yang's avatar
Bo Yang committed
452 453
build_php5.5_zts_c() {
  use_php_zts 5.5
454
  wget https://phar.phpunit.de/phpunit-4.8.0.phar -O /usr/bin/phpunit
455
  cd php/tests && /bin/bash ./test.sh 5.5-zts && cd ../..
456 457 458 459
  # TODO(teboring): Add it back
  # pushd conformance
  # make test_php_zts_c
  # popd
460 461
}

462
build_php5.6() {
463
  use_php 5.6
464
  pushd php
465 466
  rm -rf vendor
  cp -r /usr/local/vendor-5.6 vendor
467 468
  wget https://phar.phpunit.de/phpunit-5.7.0.phar -O /usr/bin/phpunit
  phpunit
469
  popd
470
  pushd conformance
471
  make test_php
472
  popd
473 474
}

475 476
build_php5.6_c() {
  use_php 5.6
477
  wget https://phar.phpunit.de/phpunit-5.7.0.phar -O /usr/bin/phpunit
478
  cd php/tests && /bin/bash ./test.sh 5.6 && cd ../..
479 480
  # TODO(teboring): Add it back
  # pushd conformance
481
  # make test_php_c
482
  # popd
483 484 485 486 487
}

build_php5.6_zts_c() {
  use_php_zts 5.6
  wget https://phar.phpunit.de/phpunit-5.7.0.phar -O /usr/bin/phpunit
488
  cd php/tests && /bin/bash ./test.sh 5.6-zts && cd ../..
489 490 491 492
  # TODO(teboring): Add it back
  # pushd conformance
  # make test_php_zts_c
  # popd
493 494
}

495
build_php5.6_mac() {
496
  generate_php_test_proto
497 498
  # Install PHP
  curl -s https://php-osx.liip.ch/install.sh | bash -s 5.6
499 500
  PHP_FOLDER=`find /usr/local -type d -name "php5-5.6*"`  # The folder name may change upon time
  export PATH="$PHP_FOLDER/bin:$PATH"
501 502

  # Install phpunit
503
  curl https://phar.phpunit.de/phpunit-5.6.10.phar -L -o phpunit.phar
504 505 506 507 508 509 510 511 512 513
  chmod +x phpunit.phar
  sudo mv phpunit.phar /usr/local/bin/phpunit

  # Install valgrind
  echo "#! /bin/bash" > valgrind
  chmod ug+x valgrind
  sudo mv valgrind /usr/local/bin/valgrind

  # Test
  cd php/tests && /bin/bash ./test.sh && cd ../..
514 515
  # TODO(teboring): Add it back
  # pushd conformance
516
  # make test_php_c
517
  # popd
518 519
}

520
build_php7.0() {
521
  use_php 7.0
522
  pushd php
523 524
  rm -rf vendor
  cp -r /usr/local/vendor-7.0 vendor
525 526
  wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit
  phpunit
527
  popd
528
  pushd conformance
529
  make test_php
530
  popd
531 532
}

533 534
build_php7.0_c() {
  use_php 7.0
535
  wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit
536
  cd php/tests && /bin/bash ./test.sh 7.0 && cd ../..
537 538
  # TODO(teboring): Add it back
  # pushd conformance
539
  # make test_php_c
540
  # popd
541 542 543 544 545
}

build_php7.0_zts_c() {
  use_php_zts 7.0
  wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit
546
  cd php/tests && /bin/bash ./test.sh 7.0-zts && cd ../..
547 548 549 550
  # TODO(teboring): Add it back.
  # pushd conformance
  # make test_php_zts_c
  # popd
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571
}

build_php7.0_mac() {
  generate_php_test_proto
  # Install PHP
  curl -s https://php-osx.liip.ch/install.sh | bash -s 7.0
  PHP_FOLDER=`find /usr/local -type d -name "php7-7.0*"`  # The folder name may change upon time
  export PATH="$PHP_FOLDER/bin:$PATH"

  # Install phpunit
  curl https://phar.phpunit.de/phpunit-5.6.0.phar -L -o phpunit.phar
  chmod +x phpunit.phar
  sudo mv phpunit.phar /usr/local/bin/phpunit

  # Install valgrind
  echo "#! /bin/bash" > valgrind
  chmod ug+x valgrind
  sudo mv valgrind /usr/local/bin/valgrind

  # Test
  cd php/tests && /bin/bash ./test.sh && cd ../..
572 573
  # TODO(teboring): Add it back
  # pushd conformance
574
  # make test_php_c
575
  # popd
576 577
}

578 579 580 581 582
build_php_compatibility() {
  internal_build_cpp
  php/tests/compatibility_test.sh
}

583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599
build_php7.1() {
  use_php 7.1
  pushd php
  rm -rf vendor
  cp -r /usr/local/vendor-7.1 vendor
  wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit
  phpunit
  popd
  pushd conformance
  # TODO(teboring): Add it back
  # make test_php
  popd
}

build_php7.1_c() {
  use_php 7.1
  wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit
600
  cd php/tests && /bin/bash ./test.sh 7.1 && cd ../..
601 602 603 604 605 606 607 608
  pushd conformance
  # make test_php_c
  popd
}

build_php7.1_zts_c() {
  use_php_zts 7.1
  wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit
609
  cd php/tests && /bin/bash ./test.sh 7.1-zts && cd ../..
610 611 612 613 614
  pushd conformance
  # make test_php_c
  popd
}

615
build_php_all_32() {
616 617 618
  build_php5.5
  build_php5.6
  build_php7.0
619
  build_php7.1
620 621
  build_php5.5_c
  build_php5.6_c
622
  build_php7.0_c
623
  build_php7.1_c
Bo Yang's avatar
Bo Yang committed
624
  build_php5.5_zts_c
625 626
  build_php5.6_zts_c
  build_php7.0_zts_c
627
  build_php7.1_zts_c
628 629
}

630 631 632 633 634
build_php_all() {
  build_php_all_32
  build_php_compatibility
}

635 636 637 638 639 640 641 642 643 644 645 646 647
# Note: travis currently does not support testing more than one language so the
# .travis.yml cheats and claims to only be cpp.  If they add multiple language
# support, this should probably get updated to install steps and/or
# rvm/gemfile/jdk/etc. entries rather than manually doing the work.

# .travis.yml uses matrix.exclude to block the cases where app-get can't be
# use to install things.

# -------- main --------

if [ "$#" -ne 1 ]; then
  echo "
Usage: $0 { cpp |
648
            cpp_distcheck |
649 650 651
            csharp |
            java_jdk7 |
            java_oracle7 |
652
            java_compatibility |
653 654 655
            javanano_jdk7 |
            javanano_oracle7 |
            objectivec_ios |
656 657
            objectivec_ios_debug |
            objectivec_ios_release |
658
            objectivec_osx |
659
            objectivec_cocoapods_integration |
660 661
            python |
            python_cpp |
662
            python_compatibility |
663 664
            ruby21 |
            ruby22 |
Feng Xiao's avatar
Feng Xiao committed
665
            jruby |
666 667 668 669 670 671
            ruby_all |
            php5.5   |
            php5.5_c |
            php5.6   |
            php5.6_c |
            php7.0   |
672
            php7.0_c |
673
            php_compatibility |
674 675
            php7.1   |
            php7.1_c |
676
            php_all)
677 678 679 680 681 682 683
"
  exit 1
fi

set -e  # exit immediately on error
set -x  # display all commands
eval "build_$1"