# Copyright 2015 The Bazel Authors. 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.

# Setup scripts for Ubuntu 15.10

apt-get update
apt-get install -y zip g++ zlib1g-dev wget git unzip python python3 curl \
        openjdk-8-jdk openjdk-8-source ca-certificates-java xvfb

# Android SDK requires 32-bits libraries
dpkg --add-architecture i386
apt-get -qqy update
apt-get -qqy install libncurses5:i386 libstdc++6:i386 zlib1g:i386
apt-get -y install expect  # Needed to 'yes' the SDK licenses.

# Dependencies for TensorFlow
apt-get -y install python-numpy swig python-dev python-pip libcurl3-dev
pip install mock

# Copyright 2015 The Bazel Authors. 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.

# Setup scripts for Ubuntu 15.10

# Android SDK requires 32-bits libraries.
dpkg --add-architecture i386
apt-get -y update
apt-get -y dist-upgrade

# Explicitly install the OpenJDK 8 before anything else to prevent
# Ubuntu from pulling in OpenJDK 9.
apt-get -y install \
  openjdk-8-jdk \
  openjdk-8-source

packages=(
  # Bazel dependencies.
  build-essential
  curl
  git
  python
  python3
  unzip
  wget
  xvfb
  zip
  zlib1g-dev

  # Dependencies for Android SDK.
  # https://developer.android.com/studio/troubleshoot.html#linux-libraries
  # https://code.google.com/p/android/issues/detail?id=207212
  expect
  libbz2-1.0:i386
  libncurses5:i386
  libstdc++6:i386
  libz1:i386

  # Dependencies for TensorFlow.
  libcurl3-dev
  python-dev
  python-numpy
  python-pip
  python-wheel
  swig
)
apt-get -y install "${packages[@]}"

pip install mock

Install openjdk-8 before anything else on Ubuntu 15.10 slaves to prevent openjdk-7 from being pulled in and becoming the default JDK.
Install openjdk-8 before anything else on Ubuntu 15.10 slaves to prevent openjdk-7 from being pulled in and becoming the default JDK.

Change-Id: Iff22a0916c67f6860229664d6e2e7248aeb22bba
