Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Add android::tool to get sdk tool up-to-date #32

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
class { 'android::paths': } ->
class { 'android::sdk': } ->
class { 'android::platform_tools': } ->
class { 'android::tool': } ->
anchor { 'android::end': }
}
30 changes: 1 addition & 29 deletions manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,13 @@
$proxy_host = $android::proxy_host ? { undef => '', default => "--proxy-host ${android::proxy_host}" }
$proxy_port = $android::proxy_port ? { undef => '', default => "--proxy-port ${android::proxy_port}" }

case $type {
'platform-tools': {
$creates = "${android::paths::sdk_home}/platform-tools"
}
'platform': {
$creates = "${android::paths::sdk_home}/platforms/${title}"
}
'system-images': {
$title_parts = split($title, '-')
$creates = "${android::paths::sdk_home}/system-images/android-${title_parts[1]}"
}
'addon': {
$creates = "${android::paths::sdk_home}/add-ons/${title}"
}
'extra': {
$title_parts = split($title, '-')
$creates = "${android::paths::sdk_home}/extras/${title_parts[1]}/${title_parts[2]}"
}
'build-tools': {
$title_parts = split($title, '-')

$creates = "${android::paths::sdk_home}/build-tools/${title_parts[2]}"
}
default: {
fail("Unsupported package type: ${type}")
}
}

file { "${android::installdir}/expect-install-${title}":
content => template("android/expect-script.erb"),
mode => '0755',
} ->
exec { "update-android-package-${title}":
command => "${android::installdir}/expect-install-${title}",
creates => $creates,
onlyif => "${android::paths::toolsdir}/android list sdk -u -e | grep '${title}'",
timeout => 0,
require => [Class['android::sdk']],
}
Expand Down
19 changes: 19 additions & 0 deletions manifests/tool.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# == Class: android::tools
#
# Installs the Android SDK Tools.
#
# === Authors
#
# Aska Wu <[email protected]>
#
# === Copyright
#
# Copyright 2012 MaestroDev, unless otherwise noted.

class android::tool {

android::package{ 'tool':
type => 'tool',
}

}