2012-02-03 17:01:35 +01:00
|
|
|
%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
|
|
|
|
interpreter "bash"
|
|
|
|
user user
|
|
|
|
cwd "/tmp"
|
|
|
|
code "
|
|
|
|
wget http://dl.google.com/android/android-sdk_r16-linux.tgz
|
|
|
|
tar zxvf android-sdk_r16-linux.tgz
|
|
|
|
mv android-sdk-linux #{sdk_loc}
|
|
|
|
rm android-sdk_r16-linux.tgz
|
|
|
|
#{sdk_loc}/tools/android update sdk --no-ui -t platform-tool
|
2012-08-31 15:48:50 +02:00
|
|
|
#{sdk_loc}/tools/android update sdk --no-ui -t tool
|
2012-02-03 17:01:35 +01:00
|
|
|
"
|
2012-09-04 19:51:53 +02:00
|
|
|
not_if "test -d #{sdk_loc}"
|
2012-02-03 17:01:35 +01:00
|
|
|
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
|
|
|
|
|
2012-09-20 11:27:33 +02:00
|
|
|
%w{android-3 android-4 android-7 android-8 android-10 android-11
|
2012-10-01 14:18:06 +02:00
|
|
|
android-12 android-13 android-14 android-15 android-16
|
|
|
|
extra-android-support}.each do |sdk|
|
2012-09-04 19:51:53 +02:00
|
|
|
|
|
|
|
script "add_sdk_#{sdk}" do
|
|
|
|
interpreter "bash"
|
|
|
|
user user
|
|
|
|
cwd "/tmp"
|
|
|
|
code "
|
|
|
|
#{sdk_loc}/tools/android update sdk --no-ui -a -t #{sdk}
|
|
|
|
"
|
|
|
|
not_if "test -d #{sdk_loc}/platforms/#{sdk}"
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2012-09-15 00:14:16 +02:00
|
|
|
%w{addon-google_apis-google-7 addon-google_apis-google-10 addon-google_apis-google-15 addon-google_apis-google-16}.each do |sdk|
|
2012-09-04 19:51:53 +02:00
|
|
|
|
|
|
|
script "add_addon_#{sdk}" do
|
|
|
|
interpreter "bash"
|
|
|
|
user user
|
|
|
|
cwd "/tmp"
|
|
|
|
code "
|
|
|
|
#{sdk_loc}/tools/android update sdk --no-ui -a -t #{sdk}
|
|
|
|
"
|
|
|
|
|
|
|
|
not_if "test -d #{sdk_loc}/add-ons/#{sdk}"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|