homebrew-core/Formula/swiftformat.rb
2017-06-03 07:59:01 -07:00

34 lines
1.1 KiB
Ruby

class Swiftformat < Formula
desc "Formatting tool for reformatting Swift code"
homepage "https://github.com/nicklockwood/SwiftFormat"
url "https://github.com/nicklockwood/SwiftFormat/archive/0.28.6.tar.gz"
sha256 "f283c3ceea7629096f7b2f76002e6baecdf4fd661f57b299c4c8a76c0963652b"
head "https://github.com/nicklockwood/SwiftFormat.git", :shallow => false
bottle do
cellar :any_skip_relocation
sha256 "49cec4fd197a31feb68e0c4a291130f3ddd351e4da1a6f807e78c3f0378be890" => :sierra
sha256 "a87ae67c3070c40a014c430bac9febc0db0790887bcb54424fc810ee9c045944" => :el_capitan
end
depends_on :xcode => ["8.0", :build]
def install
xcodebuild "-project",
"SwiftFormat.xcodeproj",
"-scheme", "SwiftFormat (Command Line Tool)",
"CODE_SIGN_IDENTITY=",
"SYMROOT=build", "OBJROOT=build"
bin.install "build/Release/swiftformat"
end
test do
(testpath/"potato.swift").write <<-EOS.undent
struct Potato {
let baked: Bool
}
EOS
system "#{bin}/swiftformat", "#{testpath}/potato.swift"
end
end