aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/ios-class-guard.rb
blob: 7d66918242175510c004c8aa62f8af70d5c7cc93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require "formula"

class IosClassGuard < Formula
  homepage "https://github.com/Polidea/ios-class-guard/"
  head "https://github.com/Polidea/ios-class-guard.git"
  url "https://github.com/Polidea/ios-class-guard/archive/0.6.tar.gz"
  sha1 "6b16fcb8ba55354180de7460d3ea1ae3cc4830ac"

  bottle do
    cellar :any
    sha1 "e83dde7f68747d6b2d6c14beddbb737911632fad" => :mavericks
  end

  depends_on :macos => :mavericks
  depends_on :xcode => :build

  def install
    xcodebuild "-workspace", "ios-class-guard.xcworkspace", "-scheme", "ios-class-guard", "-configuration", "Release", "SYMROOT=build", "PREFIX=#{prefix}", "ONLY_ACTIVE_ARCH=YES"
    bin.install "build/Release/ios-class-guard"
  end

  test do
    (testpath/"crashdump").write <<-EOS.undent
      1   MYAPP                           0x0006573a -[C03B setR02:] + 42
    EOS
    (testpath/"symbols.json").write <<-EOS.undent
      {
        "C03B" : "MyViewController",
        "setR02" : "setRightButtons"
      }
    EOS
    system "#{bin}/ios-class-guard", "-c", "crashdump", "-m", "symbols.json"
  end
end