From 9b2cc1fd68d5c790d64343c0842bfe2ab9940937 Mon Sep 17 00:00:00 2001 From: Dan Poggi Date: Sun, 6 Nov 2016 13:10:00 -0500 Subject: [PATCH] wildfly-as: add launchd plist. (#6226) --- Formula/wildfly-as.rb | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/Formula/wildfly-as.rb b/Formula/wildfly-as.rb index 9f0b8dc222..e42c883790 100644 --- a/Formula/wildfly-as.rb +++ b/Formula/wildfly-as.rb @@ -6,14 +6,17 @@ class WildflyAs < Formula bottle :unneeded + depends_on :java => "1.8+" + def install rm_f Dir["bin/*.bat"] rm_f Dir["bin/*.ps1"] libexec.install Dir["*"] + mkdir_p libexec/"standalone/log" end def caveats; <<-EOS.undent - The home of WildFly Application Server 10 is: + The home of WildFly Application Server #{version} is: #{opt_libexec} You may want to add the following to your .bash_profile: export JBOSS_HOME=#{opt_libexec} @@ -21,7 +24,41 @@ class WildflyAs < Formula EOS end + plist_options :manual => "#{HOMEBREW_PREFIX}/opt/wildfly-as/libexec/bin/standalone.sh --server-config=standalone.xml" + + def plist; <<-EOS.undent + + + + + Label + #{plist_name} + KeepAlive + + SuccessfulExit + + Crashed + + + ProgramArguments + + #{opt_libexec}/bin/standalone.sh + --server-config=standalone.xml + + EnvironmentVariables + + JBOSS_HOME + #{opt_libexec} + WILDFLY_HOME + #{opt_libexec} + + + + EOS + end + test do + ENV["JBOSS_HOME"] = opt_libexec system "#{opt_libexec}/bin/standalone.sh --version | grep #{version}" end end