sdk_loc = node[:settings][:sdk_loc] user = node[:settings][:user] script "setup-android-sdk" do timeout 14400 interpreter "bash" user user cwd "/tmp" code " unzip /vagrant/cache/android-sdk-tools.zip mkdir #{sdk_loc} mkdir #{sdk_loc}/platforms mkdir #{sdk_loc}/build-tools mv tools #{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{ platform-tools 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} <