#!/usr/bin/env bash

cd ~

sudo apt-get install -y unzip wget tar

echo """
export PATH=\\$PATH:/home/vagrant/platform-tools:/home/vagrant/build-tools/25.0.1:/home/vagrant/tools
export ANDROID_HOME=/home/vagrant
""" >> /home/vagrant/.bashrc
source /home/vagrant/.bashrc

(bash wynurz.sh node5 &&
npm install -g --unsafe-perm bower gulp cordova@6.3.1 karma) &

(wget -nv http://dev.dms-serwis.com.pl/misc/tools_r25.2.3-linux.zip &&
 unzip tools_r25.2.3-linux.zip &&
 rm -f tools_r25.2.3-linux.zip) &

bash wynurz.sh jdk

wait %2

echo y | ./tools/bin/sdkmanager "build-tools;25.0.1" "build-tools;24.0.0" "platforms;android-25" "platforms;android-24" "platforms;android-23" "platform-tools" "extras;android;m2repository" "extras;google;m2repository" "extras;google;google_play_services"

wait %1
