/
scala@3.3.rb
53 lines (43 loc) 路 1.28 KB
/
scala@3.3.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
class ScalaAT33 < Formula
desc "JVM-based programming language"
homepage "https://www.scala-lang.org/"
url "https://github.com/lampepfl/dotty/releases/download/3.3.3/scala3-3.3.3.tar.gz"
sha256 "eb594011312faa412aaf9a5b0e5b45921f90be9f849c20e295737d5faecd14d1"
license "Apache-2.0"
livecheck do
url "https://www.scala-lang.org/download/"
regex(%r{href=.*?download/v?(3\.3(?:\.\d+)+)\.html}i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "a4f166a3db595429364d57bc9946e248247cab3249054bbd66cccee7d3fa8574"
end
keg_only :versioned_formula
depends_on "openjdk"
def install
rm Dir["bin/*.bat"]
libexec.install "lib"
prefix.install "bin"
bin.env_script_all_files libexec/"bin", Language::Java.overridable_java_home_env
# Set up an IntelliJ compatible symlink farm in 'idea'
idea = prefix/"idea"
idea.install_symlink libexec/"lib"
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
object Test {
def main(args: Array[String]): Unit = {
println(s"${2 + 2}")
}
}
EOS
out = shell_output("#{bin}/scala #{file}").strip
assert_equal "4", out
end
end