homebrew-core/Formula/swiftformat.rb
2017-02-10 21:19:16 +00: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.24.4.tar.gz"
sha256 "fcd4d85c925de6c8eac29d9f51847eaf87ec5748fe88e73a6a8d43694a396773"
head "https://github.com/nicklockwood/SwiftFormat.git", :shallow => false
bottle do
cellar :any_skip_relocation
sha256 "5bd46f606a3a253f930078f95d43f6b6d7b89b70cade8ef84e5f509ddc0f63b8" => :sierra
sha256 "18239ae64f91f249f4cfe7cb7452cab2c7b4633cd5b18ae66c376d95019d899d" => :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