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/47//cromwell-47.jar" sha256 "e0fbe17bb71741d5a231d0f3376f2a3cee2d8da084b615fdec95fea6d4159a42" head do url "https://github.com/broadinstitute/cromwell.git" depends_on "sbt" => :build end bottle :unneeded depends_on :java => "1.8+" resource "womtool" do url "https://github.com/broadinstitute/cromwell/releases/download/47//womtool-47.jar" sha256 "a82aa384abdaa1941e1c10229482d3d6010fc68d30b1c9f8023bc26be9c6b84b" end def install if build.head? system "sbt", "assembly" libexec.install Dir["server/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