2010-01-06 00:01:19 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class AndroidSdk <Formula
|
2010-09-09 21:01:37 +00:00
|
|
|
url 'http://dl.google.com/android/android-sdk_r07-mac_x86.zip'
|
2010-01-06 00:01:19 +00:00
|
|
|
homepage 'http://developer.android.com/index.html'
|
2010-09-09 21:01:37 +00:00
|
|
|
md5 '0f330ed3ebb36786faf6dc72b8acf819'
|
|
|
|
version 'r7'
|
2010-01-06 00:01:19 +00:00
|
|
|
|
2010-09-12 20:55:04 +00:00
|
|
|
VAR_DIRS = %w[platforms docs samples temp add-ons]
|
|
|
|
|
|
|
|
skip_clean VAR_DIRS
|
2010-01-06 00:01:19 +00:00
|
|
|
|
|
|
|
def install
|
2010-09-12 20:55:04 +00:00
|
|
|
mkdir bin
|
2010-01-06 00:01:19 +00:00
|
|
|
|
2010-09-12 20:55:04 +00:00
|
|
|
mv 'SDK Readme.txt', prefix/'README'
|
|
|
|
mv 'tools', prefix
|
2010-01-06 00:01:19 +00:00
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
%w[adb android apkbuilder ddms dmtracedump draw9patch emulator
|
2010-01-06 00:01:19 +00:00
|
|
|
hierarchyviewer hprof-conv layoutopt mksdcard traceview
|
|
|
|
zipalign].each do |tool|
|
2010-09-12 20:55:04 +00:00
|
|
|
(bin/tool).make_link(prefix/'tools'/tool)
|
2010-01-06 00:01:19 +00:00
|
|
|
end
|
2010-02-27 17:26:27 +00:00
|
|
|
|
2010-09-12 20:55:04 +00:00
|
|
|
# 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
|
2010-02-27 17:26:27 +00:00
|
|
|
|
2010-09-12 20:55:04 +00:00
|
|
|
def caveats; <<-EOS
|
|
|
|
We put the useful tools in the PATH. Like the `android` tool. You probably
|
|
|
|
want to run that now.
|
2010-02-27 17:26:27 +00:00
|
|
|
EOS
|
2010-01-06 00:01:19 +00:00
|
|
|
end
|
|
|
|
end
|