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