Class: CocoapodsMangle::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods_mangle/builder.rb

Overview

Builds the supplied targets of a Pods Xcode project.

This is useful for building pods for mangling purposes

Constant Summary collapse

BUILD_DIR =
'build'
BUILT_PRODUCTS_DIR =
"#{BUILD_DIR}/Release-iphonesimulator"

Instance Method Summary collapse

Constructor Details

#initialize(pods_project_path, pod_target_labels) ⇒ Builder

Returns a new instance of Builder.

Parameters:

  • pods_project_path (String)

    path to the pods project to build.

  • pod_target_labels (Array<String>)

    the pod targets to build.



16
17
18
19
# File 'lib/cocoapods_mangle/builder.rb', line 16

def initialize(pods_project_path, pod_target_labels)
  @pods_project_path = pods_project_path
  @pod_target_labels = pod_target_labels
end

Instance Method Details

#binaries_to_mangleArray<String>

Gives the built binaries to be mangled

Returns:

  • (Array<String>)

    Paths to the build pods binaries



29
30
31
# File 'lib/cocoapods_mangle/builder.rb', line 29

def binaries_to_mangle
  static_binaries_to_mangle + dynamic_binaries_to_mangle
end

#build!Object

Build the pods project



22
23
24
25
# File 'lib/cocoapods_mangle/builder.rb', line 22

def build!
  FileUtils.remove_dir(BUILD_DIR, true)
  @pod_target_labels.each { |target| build_target(target) }
end