blob: 3b59f6588e4c65c4b98adad16cb2399d645b49e7 [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
Alexander Afanasyevf3812562016-01-21 16:28:33 -080010SDK_VERSION=24.4.1
Alexander Afanasyeva4091562016-02-23 11:51:31 -080011BUILD_TOOLS_VERSION=23.0.2
12COMPILE_SDK_VERSION=23
Alexander Afanasyevf3812562016-01-21 16:28:33 -080013
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080014sudo apt-get install -y build-essential git openjdk-7-jdk unzip
Alexander Afanasyev7395caf2016-01-31 10:33:28 -080015sudo apt-get install -y lib32stdc++6 lib32z1 lib32z1-dev
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080016
Alexander Afanasyevf3812562016-01-21 16:28:33 -080017wget -nv https://www.crystax.net/download/crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz
18tar xf crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz
19rm crystax-ndk-$CRYSTAX_NDK_VERSION-linux-x86_64.tar.xz
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080020
Alexander Afanasyevf3812562016-01-21 16:28:33 -080021wget -nv http://dl.google.com/android/android-sdk_r$SDK_VERSION-linux.tgz
22tar zxf android-sdk_r$SDK_VERSION-linux.tgz
23rm android-sdk_r$SDK_VERSION-linux.tgz
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080024
25export ANDROID_HOME=`pwd`/android-sdk-linux
26export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
27
28echo "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
29echo "y" | android update sdk --filter "android-19" --no-ui --all --force
30
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080031echo sdk.dir=`pwd`/android-sdk-linux > local.properties
Alexander Afanasyevf3812562016-01-21 16:28:33 -080032echo ndk.dir=`pwd`/crystax-ndk-$CRYSTAX_NDK_VERSION >> local.properties
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080033SCRIPT
34
35Vagrant.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 Afanasyevf3812562016-01-21 16:28:33 -080041 vb.memory = 4048
42 vb.cpus = 4
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080043 end
44end