diff --git a/manifests/init.pp b/manifests/init.pp index c3b21bc..ba83052 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -31,5 +31,6 @@ class { 'android::paths': } -> class { 'android::sdk': } -> class { 'android::platform_tools': } -> + class { 'android::tool': } -> anchor { 'android::end': } } diff --git a/manifests/package.pp b/manifests/package.pp index f7dbd1f..37fd33a 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -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']], } diff --git a/manifests/tool.pp b/manifests/tool.pp new file mode 100644 index 0000000..a4cb835 --- /dev/null +++ b/manifests/tool.pp @@ -0,0 +1,19 @@ +# == Class: android::tools +# +# Installs the Android SDK Tools. +# +# === Authors +# +# Aska Wu +# +# === Copyright +# +# Copyright 2012 MaestroDev, unless otherwise noted. + +class android::tool { + + android::package{ 'tool': + type => 'tool', + } + +}