class Bnd < Formula desc "Swiss Army Knife for OSGi bundles" homepage "https://bnd.bndtools.org/" url "https://search.maven.org/remotecontent?filepath=biz/aQute/bnd/biz.aQute.bnd/5.3.0/biz.aQute.bnd-5.3.0.jar" sha256 "f02cd3406b054da1840795c3cecc11c4226a8563aa74a67acc05f3d9aeaa9b85" bottle :unneeded depends_on "openjdk" def install libexec.install "biz.aQute.bnd-#{version}.jar" bin.write_jar_script libexec/"biz.aQute.bnd-#{version}.jar", "bnd" end test do # Test bnd by resolving a launch.bndrun file against a trivial index. test_sha = "baad835c6fa65afc1695cc92a9e1afe2967e546cae94d59fa9e49b557052b2b1" test_bsn = "org.apache.felix.gogo.runtime" test_version = "1.0.0" test_version_next = "1.0.1" test_file_name = "#{test_bsn}-#{test_version}.jar" (testpath/"index.xml").write <<~EOS EOS (testpath/"launch.bndrun").write <<~EOS -standalone: ${.}/index.xml -runrequires: osgi.identity;filter:='(osgi.identity=#{test_bsn})' EOS (testpath/"cnf/build.bnd").write <<~EOS EOS output = shell_output("#{bin}/bnd resolve resolve -b launch.bndrun") assert_match(/BUNDLES\s+#{test_bsn};version='\[#{test_version},#{test_version_next}\)'/, output) end end