22 lines
798 B
Ruby
22 lines
798 B
Ruby
class GoogleJavaFormat < Formula
|
|
desc "Reformats Java source code to comply with Google Java Style"
|
|
homepage "https://github.com/google/google-java-format"
|
|
url "https://github.com/google/google-java-format/releases/download/google-java-format-1.9/google-java-format-1.9-all-deps.jar"
|
|
sha256 "1d98720a5984de85a822aa32a378eeacd4d17480d31cba6e730caae313466b97"
|
|
license "Apache-2.0"
|
|
|
|
bottle :unneeded
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
libexec.install "google-java-format-#{version}-all-deps.jar" => "google-java-format.jar"
|
|
bin.write_jar_script libexec / "google-java-format.jar", "google-java-format"
|
|
end
|
|
|
|
test do
|
|
(testpath/"foo.java").write "public class Foo{\n}\n"
|
|
assert_match "public class Foo {}", shell_output("#{bin}/google-java-format foo.java")
|
|
end
|
|
end
|