scalastyle 1.0.0 (#17414)
Also don't install the default_config resource; only use it for the test. The scalastyle script code is as recommended at http://www.scalastyle.org/command-line.html
This commit is contained in:
parent
cf537fbfd8
commit
170e3ea8bc
1 changed files with 9 additions and 20 deletions
|
@ -1,32 +1,20 @@
|
|||
class Scalastyle < Formula
|
||||
desc "Run scalastyle from the command-line"
|
||||
homepage "http://www.scalastyle.org/command-line.html"
|
||||
url "https://oss.sonatype.org/content/repositories/releases/org/scalastyle/scalastyle_2.11/0.8.0/scalastyle_2.11-0.8.0-batch.jar"
|
||||
sha256 "0f902a6d8c3f7bedb87860fc236bbd65deb801ea2a4d703b8f3a6475e9aea531"
|
||||
url "https://oss.sonatype.org/content/repositories/releases/org/scalastyle/scalastyle_2.12/1.0.0/scalastyle_2.12-1.0.0-batch.jar"
|
||||
sha256 "e9dafd97be0d00f28c1e8bfcab951d0e5172b262a1d41da31d1fd65d615aedcb"
|
||||
|
||||
bottle :unneeded
|
||||
|
||||
resource "default_config" do
|
||||
url "https://raw.githubusercontent.com/scalastyle/scalastyle/v0.8.0/lib/scalastyle_config.xml"
|
||||
version "0.8.0"
|
||||
sha256 "feb61c4a09373717f94d277487e8118be524bb4c3265eb6d2fdee7a1fa362e50"
|
||||
url "https://raw.githubusercontent.com/scalastyle/scalastyle/v1.0.0/lib/scalastyle_config.xml"
|
||||
version "1.0.0"
|
||||
sha256 "6ce156449609a375d973cc8384a17524e4538114f1747efc2295cf4ca473d04e"
|
||||
end
|
||||
|
||||
def install
|
||||
libexec.install "scalastyle_2.11-#{version}-batch.jar"
|
||||
etc.install resource("default_config")
|
||||
|
||||
(bin/"scalastyle").write <<~EOS
|
||||
#!/bin/sh
|
||||
java -jar "#{libexec}/scalastyle_2.11-#{version}-batch.jar" --config "#{etc}/scalastyle_config.xml" "$@"
|
||||
EOS
|
||||
end
|
||||
|
||||
def caveats
|
||||
<<~EOS
|
||||
A default configuration file is used from "#{etc}/scalastyle_config.xml"
|
||||
To override, pass a "--config your_config.xml" argument on the command line.
|
||||
EOS
|
||||
libexec.install "scalastyle_2.12-#{version}-batch.jar"
|
||||
bin.write_jar_script("#{libexec}/scalastyle_2.12-#{version}-batch.jar", "scalastyle")
|
||||
end
|
||||
|
||||
test do
|
||||
|
@ -37,6 +25,7 @@ class Scalastyle < Formula
|
|||
}
|
||||
}
|
||||
EOS
|
||||
system bin/"scalastyle", testpath/"test.scala"
|
||||
testpath.install resource("default_config")
|
||||
system bin/"scalastyle", "--config", "scalastyle_config.xml", testpath/"test.scala"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue