blob: 7115d2b8abd15717552c92fdc434ca6063ad7389 [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
7sudo apt-get install -y build-essential git openjdk-7-jdk unzip
8
9# SDK binaries need i386 libraries
10sudo dpkg --add-architecture i386;
11sudo apt-get update -qq; sudo apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386
12
13wget -q https://www.crystax.net/download/crystax-ndk-10.1.0-linux-x86_64.tar.bz2
14tar jxf crystax-ndk-10.1.0-linux-x86_64.tar.bz2
15rm crystax-ndk-10.1.0-linux-x86_64.tar.bz2
16find crystax-ndk-10.1.0 -name byteswap.h -exec sed -i -e 's/ swap/ bswap/g' {} \\;
17
18wget -q http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz
19tar zxf android-sdk_r24.0.2-linux.tgz
20rm android-sdk_r24.0.2-linux.tgz
21
22SDK_TOOLS_VERSION=24.0.2
23BUILD_TOOLS_VERSION=21.1.2
24COMPILE_SDK_VERSION=21
25
26export ANDROID_HOME=`pwd`/android-sdk-linux
27export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
28
29echo "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
30echo "y" | android update sdk --filter "android-19" --no-ui --all --force
31
32wget -q https://services.gradle.org/distributions/gradle-2.2.1-bin.zip
33unzip gradle-2.2.1-bin.zip
34rm gradle-2.2.1-bin.zip
35export PATH=$PATH:`pwd`/gradle-2.2.1/bin
36
37echo sdk.dir=`pwd`/android-sdk-linux > local.properties
38echo ndk.dir=`pwd`/crystax-ndk-10.1.0 >> local.properties
39SCRIPT
40
41Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
42 config.vm.box = "ubuntu/trusty64"
43
44 config.vm.provision "shell", privileged: false, inline: $script
45
46 config.vm.provider "virtualbox" do |vb|
47 # Don't boot with headless mode
48 vb.gui = false
49
50 # Use VBoxManage to customize the VM. For example to change memory:
51 vb.customize ["modifyvm", :id, "--memory", "4048", "--cpus", "4"]
52 end
53end