chiark / gitweb /
Work in progress on integrating build server
[fdroidserver.git] / buildserver / cookbooks / android-sdk / recipes / default.rb
1 %w{openjdk-6-jdk}.each do |pkg|
2   package pkg do
3     action :install
4   end
5 end
6
7 sdk_loc = node[:settings][:sdk_loc]
8 user = node[:settings][:user]
9
10 script "setup-android-sdk" do
11   interpreter "bash"
12   user user
13   cwd "/tmp"
14   code "
15     wget http://dl.google.com/android/android-sdk_r16-linux.tgz
16     tar zxvf android-sdk_r16-linux.tgz
17     mv android-sdk-linux #{sdk_loc}
18     rm android-sdk_r16-linux.tgz
19     #{sdk_loc}/tools/android update sdk --no-ui -t platform-tool
20     #{sdk_loc}/tools/android update sdk --no-ui -t platform
21     #{sdk_loc}/tools/android update sdk --no-ui -t tool,platform-tool
22   "
23   not_if do
24     File.exists?("#{sdk_loc}")
25   end
26 end
27
28 execute "add-android-sdk-path" do
29   user user
30   path = "#{sdk_loc}/tools:#{sdk_loc}/platform-tools"
31   command "echo \"export PATH=\\$PATH:#{path}\" >> /home/#{user}/.bashrc"
32   not_if "grep #{sdk_loc} /home/#{user}/.bashrc"
33 end
34