Files
XcodeGen/Formula/xcodegen.rb
T
2018-07-06 00:11:54 +10:00

38 lines
1.3 KiB
Ruby

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.10.2.tar.gz"
sha256 "d8463cd9e6d228d55bd62a51e1ac1f211e5af9e171762b255b403c317069466a"
head "https://github.com/yonaskolb/XcodeGen.git"
depends_on :xcode
def install
# fixes an issue an issue in homebrew when both Xcode 9.3+ and command line tools are installed
# see more details here https://github.com/Homebrew/brew/pull/4147
# remove this once homebrew is patched
ENV["CC"] = Utils.popen_read("xcrun -find clang").chomp
# step 2: usual build
system "make", "install", "PREFIX=#{prefix}"
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