diff options
Diffstat (limited to 'Library/Formula/android-sdk.rb')
| -rw-r--r-- | Library/Formula/android-sdk.rb | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/Library/Formula/android-sdk.rb b/Library/Formula/android-sdk.rb index 8ccb7ac1e..0210ac789 100644 --- a/Library/Formula/android-sdk.rb +++ b/Library/Formula/android-sdk.rb @@ -6,31 +6,35 @@ class AndroidSdk <Formula md5 '0f330ed3ebb36786faf6dc72b8acf819' version 'r7' - skip_clean 'add-ons' - skip_clean 'platforms' - skip_clean 'temp' + VAR_DIRS = %w[platforms docs samples temp add-ons] + + skip_clean VAR_DIRS def install - mkdir %w[temp docs] << bin + mkdir bin - mv 'SDK Readme.txt', 'README' - prefix.install Dir['*'] + mv 'SDK Readme.txt', prefix/'README' + mv 'tools', prefix %w[adb android apkbuilder ddms dmtracedump draw9patch emulator hierarchyviewer hprof-conv layoutopt mksdcard traceview zipalign].each do |tool| - (bin+tool).make_link(prefix+'tools'+tool) + (bin/tool).make_link(prefix/'tools'/tool) end - end - - def caveats; <<-EOS.undent - We agreed to the Android SDK License Agreement for you when we downloaded the - SDK. If this is unacceptable you should uninstall. You can read the license - at: http://developer.android.com/sdk/terms.html - Please add this line to your .bash_profile: + # this is data that should be preserved across upgrades, but the Android + # SDK isn't too smart, so we still have to symlink it back into its tree. + VAR_DIRS.each do |d| + dst = prefix/d + src = var/'lib/android-sdk'/d + src.mkpath unless src.directory? + dst.make_relative_symlink src + end + end - export ANDROID_SDK_ROOT=#{prefix} + def caveats; <<-EOS + We put the useful tools in the PATH. Like the `android` tool. You probably + want to run that now. EOS end end |
