diff --git a/Formula/mas.rb b/Formula/mas.rb index 08383dc48cce1..3e66b32302654 100644 --- a/Formula/mas.rb +++ b/Formula/mas.rb @@ -1,8 +1,8 @@ class Mas < Formula desc "Mac App Store command-line interface" homepage "https://github.com/mas-cli/mas" - url "https://github.com/mas-cli/mas/archive/v1.4.1.tar.gz" - sha256 "4fd91c13b46d403b52dbee3891adb3cd6571e07ad20cf58de0100c9f695e6c24" + url "https://github.com/mas-cli/mas/archive/v1.4.2.tar.gz" + sha256 "f9a751ff84e6dcbaedd4b2ca95b3ca623c739fd3af0b6ca950c321f2ce840bfe" head "https://github.com/mas-cli/mas.git" bottle do @@ -11,14 +11,31 @@ class Mas < Formula sha256 "af5be6aa9902d9cfc2aa69dbf313441a7c201463d516face721f900ceae9556b" => :sierra end - depends_on :xcode => ["9.0", :build] + depends_on :xcode => ["9.3", :build] + + resource "cocoapods" do + url "https://dl.bintray.com/phatblat/mas-bottles/master.tar.gz" + sha256 "fd8f1b06a2a0276c9005241b45cc19393b7c39cfc91d08da92a307ea2416e966" + end def install - xcodebuild "-project", "mas-cli.xcodeproj", + # Pre-install a shallow copy of the CocoaPods master repo + (buildpath/".brew_home/.cocoapods/repos/master").install resource("cocoapods") + + # Install bundler, then use it to install gems used by project + ENV["GEM_HOME"] = buildpath/"gem_home" + system "gem", "install", "bundler" + ENV.prepend_path "PATH", buildpath/"gem_home/bin" + system "bundle", "install" + system "bundle", "exec", "pod", "install" + + xcodebuild "-workspace", "mas-cli.xcworkspace", "-scheme", "mas-cli Release", - "-configuration", "Release", - "SYMROOT=build" - bin.install "build/mas" + "SYMROOT=#{buildpath.realpath}" + + bin.install buildpath/"build/mas" + + bash_completion.install "contrib/completion/mas-completion.bash" => "mas" end test do