module PodPrebuild

Copyright 2019 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file

Public Class Methods

build(options) click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/build.rb, line 5
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
build_dir(sandbox_root) click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/build.rb, line 34
def self.build_dir(sandbox_root)
  sandbox_root.parent + "build"
end
config() click to toggle source
# File lib/command/config.rb, line 4
def self.config
  PodPrebuild::Config.instance
end
remove_build_dir(sandbox_root) click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/build.rb, line 29
def self.remove_build_dir(sandbox_root)
  path = build_dir(sandbox_root)
  path.rmtree if path.exist?
end
state() click to toggle source
# File lib/cocoapods-binary-cache/state_store.rb, line 2
def self.state
  @state ||= State.new
end