homebrew-core/Formula/xcodegen.rb
2019-09-01 10:07:39 -04:00

38 lines
1.3 KiB
Ruby

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.7.0.tar.gz"
sha256 "3361b2fab09bb4de15e596aee13dee710edc1cf2f8c9977e9eb9cd1f27902f72"
head "https://github.com/yonaskolb/XcodeGen.git"
bottle do
cellar :any_skip_relocation
sha256 "9f27de231f3452ea835760a39bf178d921a019910ecf6c698b7e4c19a294eb77" => :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