c4b2e70677
Closes #23917. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
46 lines
1.4 KiB
Ruby
46 lines
1.4 KiB
Ruby
class SbtAT013 < Formula
|
|
desc "Build tool for Scala projects"
|
|
homepage "https://www.scala-sbt.org/"
|
|
url "https://github.com/sbt/sbt/releases/download/v0.13.17/sbt-0.13.17.tgz"
|
|
sha256 "25f782ccb2ad6d54e13ce6cec0afa3d2328874c508d68ee34e2f742e99f2c847"
|
|
|
|
bottle :unneeded
|
|
|
|
keg_only :versioned_formula
|
|
|
|
depends_on :java => "1.6+"
|
|
|
|
def install
|
|
inreplace "bin/sbt" do |s|
|
|
s.gsub! 'etc_sbt_opts_file="/etc/sbt/sbtopts"', "etc_sbt_opts_file=\"#{etc}/sbtopts\""
|
|
s.gsub! "/etc/sbt/sbtopts", "#{etc}/sbtopts"
|
|
end
|
|
|
|
libexec.install "bin", "lib"
|
|
etc.install "conf/sbtopts"
|
|
|
|
(bin/"sbt").write <<~EOS
|
|
#!/bin/sh
|
|
if [ -f "$HOME/.sbtconfig" ]; then
|
|
echo "Use of ~/.sbtconfig is deprecated, please migrate global settings to #{etc}/sbtopts" >&2
|
|
. "$HOME/.sbtconfig"
|
|
fi
|
|
exec "#{libexec}/bin/sbt" "$@"
|
|
EOS
|
|
end
|
|
|
|
def caveats; <<~EOS
|
|
You can use $SBT_OPTS to pass additional JVM options to SBT:
|
|
SBT_OPTS="-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
|
|
|
|
This formula uses the standard Lightbend sbt launcher script.
|
|
Project specific options should be placed in .sbtopts in the root of your project.
|
|
Global settings should be placed in #{etc}/sbtopts
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
ENV.append "_JAVA_OPTIONS", "-Dsbt.log.noformat=true"
|
|
assert_match "[info] #{version}", shell_output("#{bin}/sbt sbtVersion")
|
|
end
|
|
end
|