blob: 46b4c75af2d0d079f0ac988a8e006dcd138163d4 [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 Afanasyevda066292017-11-12 23:02:31 -05007 export DEBIAN_FRONTEND=noninteractive
Alexander Afanasyevf3812562016-01-21 16:28:33 -08008
Alexander Afanasyevda066292017-11-12 23:02:31 -05009 sudo apt-mark hold grub-pc
10 sudo apt -q -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update
11 sudo apt -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
12 sudo apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" build-essential git openjdk-8-jdk unzip ruby ruby-rugged
13 sudo apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" lib32stdc++6 lib32z1 lib32z1-dev
Alexander Afanasyevf3812562016-01-21 16:28:33 -080014
Alexander Afanasyevda066292017-11-12 23:02:31 -050015 mkdir android-sdk-linux
16 cd android-sdk-linux
17 wget -q https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
18 unzip sdk-tools-linux-3859397.zip
19 rm sdk-tools-linux-3859397.zip
Alexander Afanasyevf3812562016-01-21 16:28:33 -080020
Alexander Afanasyevda066292017-11-12 23:02:31 -050021 export ANDROID_HOME=`pwd`
22 export PATH=${PATH}:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080023
Alexander Afanasyevda066292017-11-12 23:02:31 -050024 echo "y" | sdkmanager "platform-tools"
Alexander Afanasyev14fd3e22018-07-04 14:20:53 -040025 sdkmanager "platforms;android-28" "ndk-bundle"
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080026
Alexander Afanasyevda066292017-11-12 23:02:31 -050027 cd ndk-bundle
Alexander Afanasyev14fd3e22018-07-04 14:20:53 -040028 git clone https://github.com/named-data-mobile/android-crew-staging.git crew.dir
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080029
Alexander Afanasyev14fd3e22018-07-04 14:20:53 -040030 CREW_OWNER=named-data-mobile crew.dir/crew install target/sqlite target/openssl target/boost
31 CREW_OWNER=named-data-mobile crew.dir/crew install target/ndn_cxx target/nfd
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080032
Alexander Afanasyevda066292017-11-12 23:02:31 -050033 cd ../..
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080034
Alexander Afanasyevda066292017-11-12 23:02:31 -050035 echo sdk.dir=`pwd`/android-sdk-linux > local.properties
36 echo ndk.dir=`pwd`/android-sdk-linux/ndk-bundle >> local.properties
Alexander Afanasyeve152d992016-11-08 15:20:13 -080037
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080038SCRIPT
39
40Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
Alexander Afanasyevda066292017-11-12 23:02:31 -050041 config.vm.box = "puphpet/ubuntu1604-x64"
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080042
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