sdk_loc = node[:settings][:sdk_loc] user = node[:settings][:user] script "setup-android-sdk" do timeout 14400 interpreter "bash" user user cwd "/tmp" code " tar zxvf /vagrant/cache/android-sdk_r24.4.1-linux.tgz mv android-sdk-linux #{sdk_loc} " not_if "test -d #{sdk_loc}" end script "setup-sdk-dirs" do interpreter "bash" user user code " mkdir -p #{sdk_loc}/build-tools " end execute "add-android-sdk-path" do user user path = "#{sdk_loc}/tools:#{sdk_loc}/platform-tools" command "echo \"export PATH=\\$PATH:#{path} #PATH-SDK\" >> /home/#{user}/.bsenv" not_if "grep PATH-SDK /home/#{user}/.bsenv" end %w{ tools platform-tools extra-android-support extra-android-m2repository }.each do |pkg| script "add_pkg_#{pkg}" do interpreter "bash" user user code " #{sdk_loc}/tools/android update sdk --no-ui -a -t #{pkg} <