Sha256: 1d35fa4f965da0f32e413506d80494e65dd66f061d15ec9129a81b991901fde4

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

require_relative "../../pod-rome/xcodebuild_raw"
require_relative "../../pod-rome/xcodebuild_command"

module Pod
  class Prebuild
    def self.build(options)
      target = options[:target]
      return if target.nil?

      Pod::UI.puts "Building target: #{target}...".magenta
      options[:sandbox] = Pod::Sandbox.new(Pathname(options[:sandbox])) unless options[:sandbox].is_a?(Pod::Sandbox)
      options[:build_dir] = build_dir(options[:sandbox].root)

      case target.platform.name
      when :ios, :tvos, :watchos
        XcodebuildCommand.new(options).run
      when :osx
        xcodebuild(
          sandbox: options[:sandbox],
          target: target.label,
          configuration: options[:configuration],
          sdk: "macosx",
          args: options[:args]
        )
      else
        raise "Unsupported platform for '#{target.name}': '#{target.platform.name}'"
      end
      raise "The build directory was not found in the expected location" unless options[:build_dir].directory?
    end

    def self.remove_build_dir(sandbox_root)
      path = build_dir(sandbox_root)
      path.rmtree if path.exist?
    end

    def self.build_dir(sandbox_root)
      sandbox_root.parent + "build"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cocoapods-binary-cache-0.1.8 lib/cocoapods-binary-cache/pod-binary/helper/build.rb