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.21.tar.gz"
sha256 "f1a0973672e839d150887b30e3d42dcbb5780fce547c578ea569bf4775792983"
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-20 19:33:16 +00:00
sha256 "5d49da1d31a81d3499048bc080ab3f15f88fc3e9c3eec2af29ea35f86a9d671a" => :sierra
sha256 "1dcf44f922ea898a57a0f47e8d0b2754ac0341509b23d624127976d2ef2913ef" => :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