class Xcodegen < Formula desc "Generate your Xcode project from a spec file and your folder structure" homepage "https://github.com/yonaskolb/XcodeGen" url "https://github.com/yonaskolb/XcodeGen/archive/2.16.0.tar.gz" sha256 "ae813fdbc3cc26a5af7de50fa1378292e23a0a719c20cb9b461d4bbd7099078a" license "MIT" head "https://github.com/yonaskolb/XcodeGen.git" bottle do cellar :any_skip_relocation sha256 "fc8f03f0f3968c6f913725629bdfa34a24a539a6868afdb1112b8f76cdbf5a55" => :catalina sha256 "a8eea29cb064ef817a1aae173b102eb689a263fc4039987a4592e9f15c4b1d85" => :mojave end depends_on xcode: ["10.2", :build] def install system "make", "install", "PREFIX=#{prefix}" end test do (testpath/"xcodegen.yml").write <<~EOS name: GeneratedProject options: bundleIdPrefix: com.project targets: TestProject: type: application platform: iOS sources: TestProject EOS (testpath/"TestProject").mkpath system bin/"XcodeGen", "--spec", testpath/"xcodegen.yml" assert_predicate testpath/"GeneratedProject.xcodeproj", :exist? assert_predicate testpath/"GeneratedProject.xcodeproj/project.pbxproj", :exist? output = (testpath/"GeneratedProject.xcodeproj/project.pbxproj").read assert_match "name = TestProject", output assert_match "isa = PBXNativeTarget", output end end