Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nailgun 0.9.3 #23769

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 12 additions & 37 deletions Formula/nailgun.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,8 @@
class Nailgun < Formula
desc "Command-line client, protocol and server for Java programs"
homepage "http://www.martiansoftware.com/nailgun/"

stable do
url "https://github.com/martylamb/nailgun/archive/nailgun-all-0.9.1.tar.gz"
sha256 "c487735b07f3d65e4c4d9bfa9aaef86d0d78128e4c055c6c24da818a4a47b2ab"

resource "nailgun-jar" do
url "https://search.maven.org/remotecontent?filepath=com/martiansoftware/nailgun-server/0.9.1/nailgun-server-0.9.1.jar"
sha256 "4518faa6bf4bd26fccdc4d85e1625dc679381a08d56872d8ad12151dda9cef25"
end

# This patch just prepares the way for the next one.
patch do
url "https://github.com/martylamb/nailgun/commit/a789fa3f4eefcd24018d4fd89fc9037427533f52.diff?full_index=1"
sha256 "7beb0f392ff498a28cfe11af4d6b0be2759c7e27262c944e385c7e9e52ae9db4"
end

# The makefile is not prefix aware
patch do
url "https://github.com/martylamb/nailgun/pull/45.diff?full_index=1"
sha256 "59edcba5eb804ae0eec4520a1b4aa26eb595ebfd6f8adce663bfa0fa15a563e2"
end
end
url "https://github.com/facebook/nailgun/archive/nailgun-all-0.9.3.tar.gz"
sha256 "3c1567c8633cdf1a942fbcd13eb07564800866cb4d80680b3fbe8ee07c53e7a3"

bottle do
cellar :any_skip_relocation
Expand All @@ -37,35 +17,30 @@ class Nailgun < Formula
head do
url "https://github.com/martylamb/nailgun.git"

depends_on "maven" => :build

# The -Xdoclint used in pom.xml causes a build error on Java 7
patch do
url "https://github.com/martylamb/nailgun/pull/70.diff?full_index=1"
sha256 "802fcb83cd93227dcfa8f988ec5665d980d04087813b776bf25aed15495bdc4f"
end
end

depends_on "maven" => :build

def install
system "make", "install", "CC=#{ENV.cc}", "PREFIX=#{prefix}", "CFLAGS=#{ENV.cflags}"
if build.head?
require "rexml/document"
pom_xml = REXML::Document.new(File.new("pom.xml"))
jar_version = REXML::XPath.first(pom_xml, "string(/pom:project/pom:version)", "pom" => "https://maven.apache.org/POM/4.0.0")
system "mvn", "clean", "install"
libexec.install Dir["nailgun-server/target/*.jar"]
else
jar_version=version
libexec.install resource("nailgun-jar").files("nailgun-server-#{version}.jar")
end
require "rexml/document"
pom_xml = REXML::Document.new(File.new("pom.xml"))
jar_version = REXML::XPath.first(pom_xml, "string(/pom:project/pom:version)", "pom" => "http://maven.apache.org/POM/4.0.0")
system "mvn", "clean", "install"
libexec.install Dir["nailgun-server/target/*.jar"]
bin.write_jar_script libexec/"nailgun-server-#{jar_version}.jar", "ng-server", "-server"
end

test do
fork { exec "ng-server", "8765" }
fork { exec "#{bin}/ng-server", "8765" }
sleep 1 # the server does not begin listening as fast as we can start a background process
system "ng", "--nailgun-port", "8765", "ng-version"
Kernel.system "ng", "--nailgun-port", "8765", "ng-stop"
system "#{bin}/ng", "--nailgun-port", "8765", "ng-version"
Kernel.system "#{bin}/ng", "--nailgun-port", "8765", "ng-stop"
# ng-stop always returns a non-zero exit code even on successful exit
true
end
Expand Down