homebrew-core/Formula/swiftformat.rb

35 lines
1.1 KiB
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
2016-11-23 13:17:03 +00:00
bottle do
cellar :any_skip_relocation
sha256 "9a65bcb6181e67def1bfec758f176db2708b46c2cd79f5c94e0696b2180bf051" => :sierra
sha256 "59ffab10eef628353e40f8c5df0f5bb288ae3bcdcd81b9ec332ca09be80e4908" => :el_capitan
end
2016-11-22 02:50:13 +00:00
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