1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 00:40:11 +01:00
fdroidserver/buildserver/cookbooks/android-sdk/recipes/default.rb

100 lines
2.5 KiB
Ruby
Raw Normal View History

sdk_loc = node[:settings][:sdk_loc]
user = node[:settings][:user]
script "setup-android-sdk" do
timeout 14400
interpreter "bash"
user user
cwd "/tmp"
code "
2013-11-02 20:33:44 +01:00
tar zxvf /vagrant/cache/android-sdk_r22.3-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
"
2012-09-04 19:51:53 +02:00
not_if "test -d #{sdk_loc}"
end
execute "add-android-sdk-path" do
user user
path = "#{sdk_loc}/tools:#{sdk_loc}/platform-tools"
2013-08-29 22:05:25 +02:00
command "echo \"export PATH=\\$PATH:#{path} #PATH-SDK\" >> /home/#{user}/.bsenv"
not_if "grep PATH-SDK /home/#{user}/.bsenv"
2013-08-29 19:25:26 +02:00
end
execute "add-android-home" do
user user
2013-08-29 22:05:25 +02:00
command "echo \"export ANDROID_HOME=#{sdk_loc}\" >> /home/#{user}/.bsenv"
not_if "grep ANDROID_HOME /home/#{user}/.bsenv"
end
2014-01-12 11:57:23 +01:00
script "add_build_tools" do
interpreter "bash"
user user
ver = "19.0.1"
cwd "/tmp"
code "
if [ -f /vagrant/cache/build-tools/#{ver}.tar.gz ] ; then
echo Installing from cache
mkdir #{sdk_loc}/build-tools
tar -C #{sdk_loc}/build-tools -z -x -f /vagrant/cache/build-tools/#{ver}.tar.gz
else
#{sdk_loc}/tools/android update sdk --no-ui -a -t build-tools-#{ver} <<X
2013-07-31 18:46:31 +02:00
y
X
2014-01-12 11:57:23 +01:00
fi
sed -i '/BTPATH/d' /home/#{user}/.bsenv
echo \"export PATH=\\$PATH:#{sdk_loc}/build-tools/#{ver} #BTPATH\" >> /home/#{user}/.bsenv
"
not_if "test -d #{sdk_loc}/build-tools/#{ver}"
end
2013-12-22 13:24:40 +01:00
# This is currently 19.0.1
2013-10-20 13:42:58 +02:00
script "add_platform_tools" do
interpreter "bash"
user user
cwd "/tmp"
code "
if [ -f /vagrant/cache/platform-tools.tar.gz ] ; then
echo Installing from cache
mkdir #{sdk_loc}/platform-tools
tar -C #{sdk_loc}/platform-tools -z -x -f /vagrant/cache/platform-tools.tar.gz
else
#{sdk_loc}/tools/android update sdk --no-ui -a -t platform-tools <<X
y
X
fi
"
not_if "test -d #{sdk_loc}/platform-tools"
end
2012-09-20 11:27:33 +02:00
%w{android-3 android-4 android-7 android-8 android-10 android-11
2013-11-02 20:35:45 +01:00
android-12 android-13 android-14 android-15 android-16 android-17
android-18 android-19
extra-android-support extra-android-m2repository}.each do |sdk|
2012-09-04 19:51:53 +02:00
script "add_sdk_#{sdk}" do
interpreter "bash"
user user
cwd "/tmp"
code "
if [ -f /vagrant/cache/platforms/#{sdk}.tar.gz ] ; then
echo Installing from cache
tar -C #{sdk_loc}/platforms -z -x -f /vagrant/cache/platforms/#{sdk}.tar.gz
else
echo Installing via 'android'
#{sdk_loc}/tools/android update sdk --no-ui -a -t #{sdk} <<X
2013-05-25 15:00:31 +02:00
y
X
fi
2012-09-04 19:51:53 +02:00
"
not_if "test -d #{sdk_loc}/platforms/#{sdk}"
end
end