class Xcodegen < Formula desc "Tool that generates your Xcode project from a project spec" homepage "https://github.com/yonaskolb/XcodeGen" url "https://github.com/yonaskolb/XcodeGen/archive/1.1.0.tar.gz" sha256 "44d78de3cb4fb681fcfc46d1f16e0305ad14eaa3820cb1a9326bafbc2e2c004e" head "https://github.com/yonaskolb/XcodeGen.git" depends_on :xcode def install xcodegen_path = "#{buildpath}/.build/release/XcodeGen" ohai "Building XcodeGen" system("swift build --disable-sandbox -c release -Xswiftc -static-stdlib") bin.install xcodegen_path pkgshare.install "SettingPresets" end test do (testpath/"xcodegen.yml").write <<-EOS.undent name: GeneratedProject targets: TestProject: type: application platform: iOS sources: TestProject settings: PRODUCT_BUNDLE_IDENTIFIER: com.test PRODUCT_NAME: TestProject EOS Dir.mkdir(File.join(testpath, "TestProject")) system("#{bin}/XcodeGen --spec #{File.join(testpath, "xcodegen.yml")}") system("xcodebuild --project #{File.join(testpath, "GeneratedProject.xcodeproj")}") end end