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.20.tar.gz"
sha256 "b06cf3393cb09cc0c880906a0f7d90eaaf4f1725d2e846ebc4d0a3ac85ab2d44"
2016-11-22 02:50:13 +00:00
head "https://github.com/nicklockwood/SwiftFormat.git", :shallow => false
2016-11-23 13:17:03 +00:00
bottle do
cellar :any_skip_relocation
2016-12-09 21:10:04 +00:00
sha256 "d879bd55719ab783a720dc7abcdd24ab7e42f04155d4d1b61aeb6202416d132f" => :sierra
sha256 "f1a5b71386d511f1e2d4089539505dfdb72590de9a64e145bf5e6a1d03b21318" => :el_capitan
2016-11-23 13:17:03 +00:00
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