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.24.5.tar.gz"
|
|
sha256 "ea0488361716765d0d37c8cceafc4a9b808dd64ffd448993d70b523119498af6"
|
|
|
|
head "https://github.com/nicklockwood/SwiftFormat.git", :shallow => false
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "7695965d817eed9cd0709e5f850d5b3baa09b454fb705cdbe605309b0600ec79" => :sierra
|
|
sha256 "670ff126bf823215705b2556ec67ef986b42b80a6d446d722fb8d5aaa3649236" => :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
|