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.24.3.tar.gz"
sha256 "0f1244223ac9ab1b1bbc5367e5a0c4877780e9eb6078dc01d6fcda6ac7e1d7c3"
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
2017-01-27 02:50:43 +00:00
sha256 "a463a89c75a96a42098d9a0f02ad751dc29c61309c325036fe6a9d70cb9f9941" => :sierra
sha256 "1098d400a54d07d50f375e284738c50585fd20d22d23aa76e7c1af3b797204f3" => :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