2011-12-18 04:19:38 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Dart < Formula
|
|
|
|
homepage 'http://www.dartlang.org/'
|
2012-08-15 19:56:23 +00:00
|
|
|
|
|
|
|
if MacOS.prefer_64_bit?
|
2014-04-27 21:13:07 +00:00
|
|
|
url 'http://storage.googleapis.com/dart-archive/channels/stable/release/35121/sdk/dartsdk-macos-x64-release.zip'
|
|
|
|
sha1 '5f4daec23a4ce3f58ecdc8b0c77c6448c3562fc5'
|
2012-08-15 19:56:23 +00:00
|
|
|
else
|
2014-04-27 21:13:07 +00:00
|
|
|
url 'http://storage.googleapis.com/dart-archive/channels/stable/release/35121/sdk/dartsdk-macos-ia32-release.zip'
|
|
|
|
sha1 '8ec49b7acc2ea959c96b76f5d7522825b1511e19'
|
2012-08-15 19:56:23 +00:00
|
|
|
end
|
|
|
|
|
2014-04-27 21:13:07 +00:00
|
|
|
version '1.3.3'
|
2011-12-18 04:19:38 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
libexec.install Dir['*']
|
2012-12-07 12:14:40 +00:00
|
|
|
bin.install_symlink "#{libexec}/bin/dart"
|
|
|
|
bin.write_exec_script Dir["#{libexec}/bin/{pub,dart?*}"]
|
2011-12-18 04:19:38 +00:00
|
|
|
end
|
|
|
|
|
2013-11-02 11:25:16 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
To use with IntelliJ, set the Dart home to:
|
2014-03-06 05:28:31 +00:00
|
|
|
#{opt_libexec}
|
2013-11-02 11:25:16 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2013-02-02 05:12:32 +00:00
|
|
|
test do
|
|
|
|
(testpath/'sample.dart').write <<-EOS.undent
|
2012-04-20 05:01:38 +00:00
|
|
|
void main() {
|
2013-11-08 20:43:13 +00:00
|
|
|
print(r"test message");
|
2012-04-20 05:01:38 +00:00
|
|
|
}
|
2013-02-02 05:12:32 +00:00
|
|
|
EOS
|
2012-04-20 05:01:38 +00:00
|
|
|
|
2013-11-08 20:43:13 +00:00
|
|
|
assert_equal "test message\n", `#{bin}/dart sample.dart`
|
2011-12-18 04:19:38 +00:00
|
|
|
end
|
|
|
|
end
|