scala: 2.13, add scala@2.12 (#40800)

This commit is contained in:
Dale Wijnand 2019-06-12 21:26:21 +02:00 committed by Mike McQuaid
parent 4ab35aa1ba
commit a8427bbe5d
3 changed files with 19 additions and 14 deletions

View file

@ -1,10 +1,10 @@
class Scala < Formula
desc "JVM-based programming language"
homepage "https://www.scala-lang.org/"
url "https://downloads.lightbend.com/scala/2.12.8/scala-2.12.8.tgz"
mirror "https://www.scala-lang.org/files/archive/scala-2.12.8.tgz"
mirror "https://downloads.typesafe.com/scala/2.12.8/scala-2.12.8.tgz"
sha256 "440ea00c818fd88c5261dd85889711a9d1f7e6a39caa475fcf0583ab57db80a3"
url "https://downloads.lightbend.com/scala/2.13.0/scala-2.13.0.tgz"
mirror "https://www.scala-lang.org/files/archive/scala-2.13.0.tgz"
mirror "https://downloads.typesafe.com/scala/2.13.0/scala-2.13.0.tgz"
sha256 "f7d4653325bf516f9a28572f7401c2b0e5fab8e0a5d65837eb1df70e6252e089"
bottle :unneeded
@ -33,13 +33,13 @@ class Scala < Formula
file = testpath/"Test.scala"
file.write <<~EOS
object Test {
def main(args: Array[String]) {
def main(args: Array[String]): Unit = {
println(s"${2 + 2}")
}
}
EOS
out = shell_output("#{bin}/scala -nc #{file}").strip
out = shell_output("#{bin}/scala #{file}").strip
assert_equal "4", out
end

View file

@ -1,24 +1,23 @@
class ScalaAT210 < Formula
class ScalaAT212 < Formula
desc "JVM-based programming language"
homepage "https://www.scala-lang.org/"
url "https://downloads.lightbend.com/scala/2.10.7/scala-2.10.7.tgz"
mirror "https://downloads.typesafe.com/scala/2.10.7/scala-2.10.7.tgz"
mirror "https://www.scala-lang.org/files/archive/scala-2.10.7.tgz"
sha256 "9283119916f6bb7714e076a2840ccf22d58819b355228ed1591ae6f76929f111"
url "https://downloads.lightbend.com/scala/2.12.8/scala-2.12.8.tgz"
mirror "https://www.scala-lang.org/files/archive/scala-2.12.8.tgz"
mirror "https://downloads.typesafe.com/scala/2.12.8/scala-2.12.8.tgz"
sha256 "440ea00c818fd88c5261dd85889711a9d1f7e6a39caa475fcf0583ab57db80a3"
bottle :unneeded
keg_only :versioned_formula
depends_on :java => "1.8"
depends_on :java => "1.8+"
def install
rm_f Dir["bin/*.bat"]
doc.install Dir["doc/*"]
share.install "man"
libexec.install "bin", "lib"
bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("1.8"))
bin.install_symlink Dir["#{libexec}/bin/*"]
# Set up an IntelliJ compatible symlink farm in 'idea'
idea = prefix/"idea"
@ -26,6 +25,12 @@ class ScalaAT210 < Formula
idea.install_symlink doc => "doc"
end
def caveats; <<~EOS
To use with IntelliJ, set the Scala home to:
#{opt_prefix}/idea
EOS
end
test do
file = testpath/"Test.scala"
file.write <<~EOS