homebrew-core/Formula/cromwell.rb

69 lines
1.9 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/79/cromwell-79.jar"
sha256 "251440bc78390f575e6a7145e038e386b6393a596db45a25888a3ba467879bce"
license "BSD-3-Clause"
bottle do
sha256 cellar: :any_skip_relocation, all: "6ef1f95d469d327bf372c415d58382737f70a85d93472fc078ee51e70614e7da"
end
head do
url "https://github.com/broadinstitute/cromwell.git", branch: "develop"
depends_on "sbt" => :build
end
depends_on "openjdk"
resource "womtool" do
url "https://github.com/broadinstitute/cromwell/releases/download/79/womtool-79.jar"
sha256 "7804aecae96907bfdbcfd9b5fae31845947b3dbe976cb4529ad7f5e162221537"
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.write_jar_script libexec/"cromwell.jar", "cromwell", "$JAVA_OPTS"
bin.write_jar_script libexec/"womtool.jar", "womtool"
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