forked from Homebrew/homebrew-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp-engine-java.rb
33 lines (27 loc) · 1.16 KB
/
app-engine-java.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class AppEngineJava < Formula
desc "Google App Engine for Java"
homepage "https://cloud.google.com/appengine/docs/java/"
url "https://storage.googleapis.com/appengine-sdks/featured/appengine-java-sdk-1.9.72.zip"
sha256 "66af92c909c0403730aba7c4b9fbdc6d7ceb0f5310e7c2f1a653622dfa76c6fb"
bottle :unneeded
depends_on :java => "1.8"
def install
rm Dir["bin/*.cmd"]
libexec.install Dir["*"]
%w[appcfg.sh dev_appserver.sh endpoints.sh run_java.sh].each do |f|
bin.install libexec/"bin/#{f}"
end
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("1.8"))
end
test do
(testpath/"WEB-INF/web.xml").write "<web-app/>"
(testpath/"WEB-INF/appengine-web.xml").write "<appengine-web-app><threadsafe>true</threadsafe></appengine-web-app>"
Process.setsid
IO.popen("#{bin}/dev_appserver.sh . 2>&1") do |io|
assert_not_nil(io.gets, "Dev App Server terminated prematurely") until $LAST_READ_LINE == "INFO: Dev App Server is now running\n"
Signal.trap "INT", "IGNORE"
Process.kill "INT", 0
end
assert_equal(130, $CHILD_STATUS.exitstatus, "Dev App Server exited with unexpected status code")
end
end