blob: 92ac7e6d09035e7dd396aba58b15057f1ea34059 [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 Afanasyeve152d992016-11-08 15:20:13 -080033
34cd crystax-ndk-$CRYSTAX_NDK_VERSION/sources
35curl -L -o openssl.tar.gz https://github.com/named-data-mobile/crystax-prebuilt-openssl/archive/crystax-$CRYSTAX_NDK_VERSION.tar.gz
36tar zx --strip-components 1 -C openssl -f openssl.tar.gz
37rm openssl.tar.gz
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080038SCRIPT
39
40Vagrant.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|
Alexander Afanasyevf3812562016-01-21 16:28:33 -080046 vb.memory = 4048
47 vb.cpus = 4
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080048 end
49end