homebrew-core/Formula/cromwell.rb

75 lines
2.0 KiB
Ruby

class Cromwell < Formula
desc "Workflow Execution Engine using Workflow Description Language"
homepage "https://github.com/broadinstitute/cromwell"
url "https://github.com/broadinstitute/cromwell/releases/download/63/cromwell-63.jar"
sha256 "54b35197da47d4bde21661a5871fa1c825706dc5dae82778a9ea3c506ad4aa70"
license "BSD-3-Clause"
bottle do
sha256 cellar: :any_skip_relocation, all: "109d10ab70e62335490554225383ded76612a5b524537e5b46a68dbd565b5b6f"
end
head do
url "https://github.com/broadinstitute/cromwell.git"
depends_on "sbt" => :build
end
depends_on "openjdk"
resource "womtool" do
url "https://github.com/broadinstitute/cromwell/releases/download/63/womtool-63.jar"
sha256 "6088eb37f3801a6ad6758ae7252cb1349de851ee0ac04c91ec9a10f235a9f444"
end
def install
if build.head?
system "sbt", "assembly"
libexec.install Dir["server/target/scala-*/cromwell-*.jar"][0] => "cromwell.jar"
libexec.install Dir["womtool/target/scala-*/womtool-*.jar"][0] => "womtool.jar"
else
libexec.install "cromwell-#{version}.jar" => "cromwell.jar"
resource("womtool").stage do
libexec.install "womtool-#{version}.jar" => "womtool.jar"
end
end
(bin/"cromwell").write <<~EOS
#!/bin/bash
exec "#{Formula["openjdk"].opt_bin}/java" $JAVA_OPTS -jar "#{libexec}/cromwell.jar" "$@"
EOS
(bin/"womtool").write <<~EOS
#!/bin/bash
exec "#{Formula["openjdk"].opt_bin}/java" -jar "#{libexec}/womtool.jar" "$@"
EOS
end
test do
(testpath/"hello.wdl").write <<~EOS
task hello {
String name
command {
echo 'hello ${name}!'
}
output {
File response = stdout()
}
}
workflow test {
call hello
}
EOS
(testpath/"hello.json").write <<~EOS
{
"test.hello.name": "world"
}
EOS
result = shell_output("#{bin}/cromwell run --inputs hello.json hello.wdl")
assert_match "test.hello.response", result
end
end