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 |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 7 | |
| 8 | CRYSTAX_NDK_VERSION=10.3.1 |
| 9 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 10 | SDK_VERSION=24.4.1 |
Alexander Afanasyev | a409156 | 2016-02-23 11:51:31 -0800 | [diff] [blame] | 11 | BUILD_TOOLS_VERSION=23.0.2 |
| 12 | COMPILE_SDK_VERSION=23 |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 13 | |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 14 | sudo apt-get install -y build-essential git openjdk-7-jdk unzip |
Alexander Afanasyev | 7395caf | 2016-01-31 10:33:28 -0800 | [diff] [blame] | 15 | sudo apt-get install -y lib32stdc++6 lib32z1 lib32z1-dev |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 16 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 17 | wget -nv https://www.crystax.net/download/crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz |
| 18 | tar xf crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz |
| 19 | rm crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 20 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 21 | wget -nv http://dl.google.com/android/android-sdk_r$SDK_VERSION-linux.tgz |
| 22 | tar zxf android-sdk_r$SDK_VERSION-linux.tgz |
| 23 | rm android-sdk_r$SDK_VERSION-linux.tgz |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 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 | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 31 | echo sdk.dir=`pwd`/android-sdk-linux > local.properties |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 32 | echo ndk.dir=`pwd`/crystax-ndk-$CRYSTAX_NDK_VERSION >> local.properties |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 33 | SCRIPT |
| 34 | |
| 35 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
| 36 | config.vm.box = "ubuntu/trusty64" |
| 37 | |
| 38 | config.vm.provision "shell", privileged: false, inline: $script |
| 39 | |
| 40 | config.vm.provider "virtualbox" do |vb| |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 41 | vb.memory = 4048 |
| 42 | vb.cpus = 4 |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 43 | end |
| 44 | end |