homebrew-core/Formula/vert.x.rb

38 lines
1.2 KiB
Ruby

class VertX < Formula
desc "Toolkit for building reactive applications on the JVM"
homepage "https://vertx.io/"
url "https://search.maven.org/remotecontent?filepath=io/vertx/vertx-stack-manager/4.0.2/vertx-stack-manager-4.0.2-full.tar.gz"
sha256 "ca9453c6a119b12cf1fb1f5bb5441d1c53fd034a57c9e168e4300ac0be7070a8"
license any_of: ["EPL-2.0", "Apache-2.0"]
livecheck do
url "https://search.maven.org/remotecontent?filepath=io/vertx/vertx-stack-manager/"
regex(%r{href=["']?v?(\d+(?:\.\d+)+)/?["' >]}i)
end
bottle :unneeded
depends_on "openjdk"
def install
rm_f Dir["bin/*.bat"]
libexec.install %w[bin conf lib]
(bin/"vertx").write_env_script "#{libexec}/bin/vertx", Language::Java.overridable_java_home_env
end
test do
(testpath/"HelloWorld.java").write <<~EOS
import io.vertx.core.AbstractVerticle;
public class HelloWorld extends AbstractVerticle {
public void start() {
System.out.println("Hello World!");
vertx.close();
System.exit(0);
}
}
EOS
output = shell_output("#{bin}/vertx run HelloWorld.java")
assert_equal "Hello World!\n", output
end
end