35 lines
1.1 KiB
Ruby
35 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.29.2.tar.gz"
|
|
sha256 "10c7ee4a7085eb5780f24383128012f4f96e2214c2a664eeec98a2d94fa4183f"
|
|
|
|
head "https://github.com/nicklockwood/SwiftFormat.git", :shallow => false
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "19f5eea8719a0a40f104a9763fb0dcba19c6276c6539726db8484981e4cc2a43" => :sierra
|
|
sha256 "1464685532563ee037b1a93b2cbe887b115509a7bb231bd01dceccbcc5ea3fdb" => :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
|