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.3.0.tar.gz" sha256 "214bb1535b54056d9e67a7b12820797ad4d7ad38976750f4851c874dc2c8b802" head "https://github.com/yonaskolb/XcodeGen.git" bottle do cellar :any_skip_relocation sha256 "e044b44ec5a2857f6fd1ad74fda0260bc6255082fbed62f2f62137a5d7b94089" => :mojave sha256 "79d9e960fdf2f20960662fa82cd33385b28488447302baaa262c47e8d87cbd18" => :high_sierra end depends_on :xcode => ["9.3", :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