blob: f2ba0b21e628cd8bda86d0636f14ecea05f08d07 [file] [log] [blame]
# typed: false
# frozen_string_literal: true
class DartAT2 < Formula
desc "Dart 2 SDK"
homepage "https://dart.dev"
version "2.0.0"
keg_only :versioned_formula
if Hardware::CPU.is_64_bit?
url "https://storage.googleapis.com/dart-archive/channels/stable/release/2.0.0/sdk/dartsdk-macos-x64-release.zip"
sha256 "7cb9e65cea94ce23b05af4e5224ec416b26c3fb6bf0718778b68f6a73e617cc3"
else
url "https://storage.googleapis.com/dart-archive/channels/stable/release/2.0.0/sdk/dartsdk-macos-ia32-release.zip"
sha256 "da55f8fce70ca46e97304810406c89f039464be909b9b92f13986ce918da6775"
end
def install
libexec.install Dir["*"]
bin.install_symlink "#{libexec}/bin/dart"
bin.write_exec_script Dir["#{libexec}/bin/{pub,dart?*}"]
end
def caveats
<<~EOS
The dart@2 tap is now unneeded. Both stable and dev versions of the regular dart tap are on Dart 2 now.
The dart@2 tap will be removed at some point in the future.
Please note the path to the Dart SDK:
#{opt_libexec}
EOS
end
test do
(testpath/"sample.dart").write <<~EOS
void main() {
print(r"test message");
}
EOS
assert_equal "test message
", shell_output("#{bin}/dart sample.dart")
end
end