homebrew-core/Formula/cromwell.rb
2018-09-27 09:18:54 +10:00

65 lines
1.7 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/35/cromwell-35.jar"
sha256 "77d38492dc8749481cbe1a0881c9b054f4f178b446d4cf47e168e7fe9b06876e"
head do
url "https://github.com/broadinstitute/cromwell.git"
depends_on "sbt" => :build
end
bottle :unneeded
depends_on "akka"
depends_on :java => "1.8+"
resource "womtool" do
url "https://github.com/broadinstitute/cromwell/releases/download/35/womtool-35.jar"
sha256 "5b00ff48d173e92bd8fc4fb230ec9f7a1ee89516b0217aa86ecae829f9deec6c"
end
def install
if build.head?
system "sbt", "assembly"
libexec.install Dir["target/scala-*/cromwell-*.jar"][0]
libexec.install Dir["womtool/target/scala-2.12/womtool-*.jar"][0]
else
libexec.install Dir["cromwell-*.jar"][0]
resource("womtool").stage do
libexec.install Dir["womtool-*.jar"][0]
end
end
bin.write_jar_script Dir[libexec/"cromwell-*.jar"][0], "cromwell", "$JAVA_OPTS"
bin.write_jar_script Dir[libexec/"womtool-*.jar"][0], "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