homebrew-core/Formula/swiftformat.rb
2018-02-21 20:26:38 -05: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.33.3.tar.gz"
sha256 "cb50c51580fe96a4c41a17e33065049ef043f0dc58d50ffd7824c2973fbbb5a8"
head "https://github.com/nicklockwood/SwiftFormat.git", :shallow => false
bottle do
cellar :any_skip_relocation
sha256 "129199cee6ab3187f1a5110e8c6cb102f064de6d3a87e3a4d0602cae1ec64063" => :high_sierra
sha256 "009144ab6e2d920b581326950cf8651d9868362e5455ab148ec9173d50bc0fa6" => :sierra
end
depends_on :xcode => ["9.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
struct Potato {
let baked: Bool
}
EOS
system "#{bin}/swiftformat", "#{testpath}/potato.swift"
end
end