49 lines
1.5 KiB
Ruby
49 lines
1.5 KiB
Ruby
class OpenlibertyMicroprofile4 < Formula
|
|
desc "Lightweight open framework for Java (Micro Profile 4)"
|
|
homepage "https://openliberty.io"
|
|
url "https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/release/22.0.0.10/openliberty-microProfile4-22.0.0.10.zip"
|
|
sha256 "ffa03e46394e29472518ad17e54146d5863077b0887c345844b042ea279490e1"
|
|
license "EPL-1.0"
|
|
|
|
livecheck do
|
|
url "https://openliberty.io/api/builds/data"
|
|
regex(/openliberty[._-]v?(\d+(?:\.\d+)+)\.zip/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "95197b59a42adcab2922ee9d7e3d8099e7b1bd8418f7e52375bdc3d5e956dbb9"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
rm_rf Dir["bin/**/*.bat"]
|
|
|
|
prefix.install_metafiles
|
|
libexec.install Dir["*"]
|
|
(bin/"openliberty-microprofile4").write_env_script "#{libexec}/bin/server",
|
|
Language::Java.overridable_java_home_env
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
The home of Open Liberty Micro Profile 4 is:
|
|
#{opt_libexec}
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
ENV["WLP_USER_DIR"] = testpath
|
|
|
|
begin
|
|
system bin/"openliberty-microprofile4", "start"
|
|
assert_predicate testpath/"servers/.pid/defaultServer.pid", :exist?
|
|
ensure
|
|
system bin/"openliberty-microprofile4", "stop"
|
|
end
|
|
|
|
refute_predicate testpath/"servers/.pid/defaultServer.pid", :exist?
|
|
assert_match "<feature>microProfile-4.1</feature>", (testpath/"servers/defaultServer/server.xml").read
|
|
end
|
|
end
|