Files
XcodeGen/Formula/xcodegen.rb
T
2017-09-19 12:37:35 +02:00

35 lines
1.1 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.0.1.tar.gz"
sha256 "4f4b0d1b2debc9bad69b1021cc4a9562c8adac7866536629cf098c5e08fc3125"
head "https://github.com/yonaskolb/XcodeGen.git"
depends_on :xcode
def install
xcodegen_path = "#{buildpath}/.build/release/XcodeGen"
ohai "Building XcodeGen"
system("swift build -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