Sha256: 8e0a272aed7c27a1c0fc274d6c88b3cec3297fe0b0620bd3f3dd1130033e094b

Contents?: true

Size: 1.1 KB

Versions: 26

Compression:

Stored size: 1.1 KB

Contents

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

module PodPrebuild
  def self.build(options)
    targets = options[:targets] || []
    return if targets.empty?

    options[:sandbox] = Pod::Sandbox.new(Pathname(options[:sandbox])) unless options[:sandbox].is_a?(Pod::Sandbox)
    options[:build_dir] = build_dir(options[:sandbox].root)

    case targets[0].platform.name
    when :ios, :tvos, :watchos
      PodPrebuild::XcodebuildCommand.new(options).run
    when :osx
      xcodebuild(
        sandbox: options[:sandbox],
        targets: targets,
        configuration: options[:configuration],
        sdk: "macosx",
        args: options[:args]
      )
    else
      raise "Unsupported platform for '#{targets[0].name}': '#{targets[0].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

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
cocoapods-binary-cache-next-0.1.16 lib/cocoapods-binary-cache/pod-binary/helper/build.rb
cocoapods-binary-cache-next-0.1.15 lib/cocoapods-binary-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.19 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.18 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.17 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.16 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.15 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.14 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.13 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.12 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.11 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.10 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.9 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.8 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.7 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.6 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.5 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.4 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.3 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb
cocoapods-binary-artifactory-cache-0.0.2 lib/cocoapods-binary-artifactory-cache/pod-binary/helper/build.rb