blob: 4f6ba1c72eb9542e52b7b9293eb9e5cb8ed330cc [file] [log] [blame]
Alexander Afanasyev087c7c12015-02-02 00:21:21 -08001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4VAGRANTFILE_API_VERSION = "2"
5
6$script = <<SCRIPT
Alexander Afanasyevf3812562016-01-21 16:28:33 -08007
8CRYSTAX_NDK_VERSION=10.3.1
9
10GRADLE_VERSION=2.10
11SDK_VERSION=24.4.1
12BUILD_TOOLS_VERSION=21.1.2
13COMPILE_SDK_VERSION=21
14
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080015sudo apt-get install -y build-essential git openjdk-7-jdk unzip
16
17# SDK binaries need i386 libraries
18sudo dpkg --add-architecture i386;
19sudo apt-get update -qq; sudo apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386
20
Alexander Afanasyevf3812562016-01-21 16:28:33 -080021wget -nv https://www.crystax.net/download/crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz
22tar xf crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz
23rm crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080024
Alexander Afanasyevf3812562016-01-21 16:28:33 -080025wget -nv http://dl.google.com/android/android-sdk_r$SDK_VERSION-linux.tgz
26tar zxf android-sdk_r$SDK_VERSION-linux.tgz
27rm android-sdk_r$SDK_VERSION-linux.tgz
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080028
29export ANDROID_HOME=`pwd`/android-sdk-linux
30export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
31
32echo "y" | android update sdk --filter platform-tools,build-tools-$BUILD_TOOLS_VERSION,android-$COMPILE_SDK_VERSION,extra-android-support,extra-android-m2repository,extra-google-m2repository --no-ui --all --force
33echo "y" | android update sdk --filter "android-19" --no-ui --all --force
34
Alexander Afanasyevf3812562016-01-21 16:28:33 -080035wget -nv https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip
36unzip gradle-$GRADLE_VERSION-bin.zip
37rm gradle-$GRADLE_VERSION-bin.zip
38export PATH=$PATH:`pwd`/gradle-$GRADLE_VERSION/bin
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080039
40echo sdk.dir=`pwd`/android-sdk-linux > local.properties
Alexander Afanasyevf3812562016-01-21 16:28:33 -080041echo ndk.dir=`pwd`/crystax-ndk-$CRYSTAX_NDK_VERSION >> local.properties
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080042SCRIPT
43
44Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
45 config.vm.box = "ubuntu/trusty64"
46
47 config.vm.provision "shell", privileged: false, inline: $script
48
49 config.vm.provider "virtualbox" do |vb|
Alexander Afanasyevf3812562016-01-21 16:28:33 -080050 vb.memory = 4048
51 vb.cpus = 4
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080052 end
53end