1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-19 03:30:12 +02:00
fdroidserver/buildserver/cookbooks/android-sdk/recipes/default.rb
Ciaran Gultnieks 6f72af39fe Press the y key
2013-05-25 14:00:31 +01:00

70 lines
1.5 KiB
Ruby

%w{openjdk-6-jdk}.each do |pkg|
package pkg do
action :install
end
end
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_r21.0.1-linux.tgz
mv android-sdk-linux #{sdk_loc}
#{sdk_loc}/tools/android update sdk --no-ui -t platform-tool
#{sdk_loc}/tools/android update sdk --no-ui -t tool
"
not_if "test -d #{sdk_loc}"
end
execute "add-android-sdk-path" do
user user
path = "#{sdk_loc}/tools:#{sdk_loc}/platform-tools"
command "echo \"export PATH=\\$PATH:#{path}\" >> /home/#{user}/.bashrc"
not_if "grep #{sdk_loc} /home/#{user}/.bashrc"
end
%w{android-3 android-4 android-7 android-8 android-10 android-11
android-12 android-13 android-14 android-15 android-16 android-17
extra-android-support}.each do |sdk|
script "add_sdk_#{sdk}" do
interpreter "bash"
user user
cwd "/tmp"
code "
#{sdk_loc}/tools/android update sdk --no-ui -a -t #{sdk} <<X
y
X
"
not_if "test -d #{sdk_loc}/platforms/#{sdk}"
end
end
%w{addon-google_apis-google-7 addon-google_apis-google-10 addon-google_apis-google-15 addon-google_apis-google-16 addon-google_apis-google-17}.each do |sdk|
script "add_addon_#{sdk}" do
interpreter "bash"
user user
cwd "/tmp"
code "
#{sdk_loc}/tools/android update sdk --no-ui -a -t #{sdk} <<X
y
X
"
not_if "test -d #{sdk_loc}/add-ons/#{sdk}"
end
end