chiark / gitweb /
Download platforms via makebuildserver
[fdroidserver.git] / buildserver / cookbooks / android-sdk / recipes / default.rb
1
2 sdk_loc = node[:settings][:sdk_loc]
3 user = node[:settings][:user]
4
5 script "setup-android-sdk" do
6   timeout 14400
7   interpreter "bash"
8   user user
9   cwd "/tmp"
10   code "
11     tar zxvf /vagrant/cache/android-sdk_r24.4.1-linux.tgz
12     mv android-sdk-linux #{sdk_loc}
13   "
14   not_if "test -d #{sdk_loc}"
15 end
16
17 execute "add-android-sdk-path" do
18   user user
19   path = "#{sdk_loc}/tools:#{sdk_loc}/platform-tools"
20   command "echo \"export PATH=\\$PATH:#{path} #PATH-SDK\" >> /home/#{user}/.bsenv"
21   not_if "grep PATH-SDK /home/#{user}/.bsenv"
22 end
23
24 %w{
25     tools
26     platform-tools
27     build-tools-17.0.0
28     build-tools-18.0.1
29     build-tools-18.1.0
30     build-tools-18.1.1
31     build-tools-19.0.0
32     build-tools-19.0.1
33     build-tools-19.0.2
34     build-tools-19.0.3
35     build-tools-19.1.0
36     build-tools-20.0.0
37     build-tools-21.0.0
38     build-tools-21.0.1
39     build-tools-21.0.2
40     build-tools-21.1.0
41     build-tools-21.1.1
42     build-tools-21.1.2
43     build-tools-22.0.0
44     build-tools-22.0.1
45     build-tools-23.0.0
46     build-tools-23.0.1
47     build-tools-23.0.2
48     extra-android-support
49     extra-android-m2repository
50 }.each do |pkg|
51   script "add_pkg_#{pkg}" do
52     interpreter "bash"
53     user user
54     code "
55       #{sdk_loc}/tools/android update sdk --no-ui -a -t #{pkg} <<X
56 y
57
58 X
59     "
60   end
61
62 end
63
64 %w{3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}.each do |api|
65   script "add_sdk_#{api}" do
66     interpreter "bash"
67     user user
68     cwd "/tmp"
69     code "
70       unzip /vagrant/cache/android-platform-#{api}.zip
71       mv android-*/ #{sdk_loc}/platforms/android-#{api}
72     "
73     not_if "test -d #{sdk_loc}/platforms/android-#{api}"
74   end
75 end
76