homebrew-core/Formula/swiftformat.rb

29 lines
847 B
Ruby
Raw Normal View History

2016-11-22 02:50:13 +00:00
class Swiftformat < Formula
desc "Formatting tool for reformatting Swift code"
homepage "https://github.com/nicklockwood/SwiftFormat"
url "https://github.com/nicklockwood/SwiftFormat/archive/0.18.tar.gz"
sha256 "adb81e0f52fd6a69a8f1b0446fee4b63586ed63e3f3977c603d5d70b3f25a877"
head "https://github.com/nicklockwood/SwiftFormat.git", :shallow => false
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
2016-11-22 02:50:13 +00:00
struct Potato {
let baked: Bool
2016-11-22 02:50:13 +00:00
}
EOS
2016-11-22 02:50:13 +00:00
system "#{bin}/swiftformat", "#{testpath}/potato.swift"
end
end