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 | |
| 10 | GRADLE_VERSION=2.10 |
| 11 | SDK_VERSION=24.4.1 |
| 12 | BUILD_TOOLS_VERSION=21.1.2 |
| 13 | COMPILE_SDK_VERSION=21 |
| 14 | |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 15 | sudo apt-get install -y build-essential git openjdk-7-jdk unzip |
| 16 | |
| 17 | # SDK binaries need i386 libraries |
| 18 | sudo dpkg --add-architecture i386; |
| 19 | sudo apt-get update -qq; sudo apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386 |
| 20 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame^] | 21 | wget -nv https://www.crystax.net/download/crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz |
| 22 | tar xf crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz |
| 23 | rm crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 24 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame^] | 25 | wget -nv http://dl.google.com/android/android-sdk_r$SDK_VERSION-linux.tgz |
| 26 | tar zxf android-sdk_r$SDK_VERSION-linux.tgz |
| 27 | rm android-sdk_r$SDK_VERSION-linux.tgz |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 28 | |
| 29 | export ANDROID_HOME=`pwd`/android-sdk-linux |
| 30 | export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools |
| 31 | |
| 32 | 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 |
| 33 | echo "y" | android update sdk --filter "android-19" --no-ui --all --force |
| 34 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame^] | 35 | wget -nv https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip |
| 36 | unzip gradle-$GRADLE_VERSION-bin.zip |
| 37 | rm gradle-$GRADLE_VERSION-bin.zip |
| 38 | export PATH=$PATH:`pwd`/gradle-$GRADLE_VERSION/bin |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 39 | |
| 40 | echo sdk.dir=`pwd`/android-sdk-linux > local.properties |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame^] | 41 | echo ndk.dir=`pwd`/crystax-ndk-$CRYSTAX_NDK_VERSION >> local.properties |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 42 | SCRIPT |
| 43 | |
| 44 | Vagrant.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 Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame^] | 50 | vb.memory = 4048 |
| 51 | vb.cpus = 4 |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 52 | end |
| 53 | end |