homebrew-core/Formula/grails.rb

39 lines
1.0 KiB
Ruby

class Grails < Formula
desc "Web application framework for the Groovy language"
homepage "https://grails.org"
url "https://github.com/grails/grails-core/releases/download/v4.0.8/grails-4.0.8.zip"
sha256 "e6954f38784435dd8355953ef666a2f91ef8e060ac58c2fad959f225f9071ffc"
license "Apache-2.0"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle :unneeded
depends_on "openjdk@11"
def install
rm_f Dir["bin/*.bat", "bin/cygrails", "*.bat"]
libexec.install Dir["*"]
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files libexec/"bin", JAVA_HOME: "${JAVA_HOME:-#{Formula["openjdk@11"].opt_prefix}}"
end
def caveats
<<~EOS
The GRAILS_HOME directory is:
#{opt_libexec}
EOS
end
test do
system bin/"grails", "create-app", "brew-test"
assert_predicate testpath/"brew-test/gradle.properties", :exist?
assert_match "brew.test", File.read(testpath/"brew-test/build.gradle")
assert_match "Grails Version: #{version}", shell_output("#{bin}/grails -v")
end
end