Module: Pod::Podfile::DSL

Defined in:
lib/cocoapods-ppbuild/Main.rb,
lib/cocoapods-ppbuild/helper/feature_switches.rb

Constant Summary collapse

@@enable_prebuild_patch =
false

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.enable_prebuild_patch(value) ⇒ Object

when enable, ‘pod` function will skip all pods without ’prebuild => true’



17
18
19
# File 'lib/cocoapods-ppbuild/helper/feature_switches.rb', line 17

def self.enable_prebuild_patch(value)
    @@enable_prebuild_patch = value
end

Instance Method Details

#enable_bitcode_for_prebuilt_frameworks!Object

Enable bitcode for prebuilt frameworks



34
35
36
# File 'lib/cocoapods-ppbuild/Main.rb', line 34

def enable_bitcode_for_prebuilt_frameworks!
    DSL.bitcode_enabled = true
end

#remove_source_code_for_prebuilt_frameworks!Object

设置是否保存源码,默认 true



29
30
31
# File 'lib/cocoapods-ppbuild/Main.rb', line 29

def remove_source_code_for_prebuilt_frameworks!
    DSL.dont_remove_source_code = false
end

#set_custom_xcodebuild_options_for_prebuilt_frameworks(options) ⇒ Object

Add custom xcodebuild option to the prebuilding action

You may use this for your special demands. For example: the default archs in dSYMs of prebuilt frameworks is ‘arm64 armv7 x86_64’, and no ‘i386’ for 32bit simulator. It may generate a warning when building for a 32bit simulator. You may add following to your podfile

` set_custom_xcodebuild_options_for_prebuilt_frameworks :simulator => "ARCHS=$(ARCHS_STANDARD)" `

Another example to disable the generating of dSYM file:

` set_custom_xcodebuild_options_for_prebuilt_frameworks "DEBUG_INFORMATION_FORMAT=dwarf"`

Parameters:

  • options (String or Hash)

    If is a String, it will apply for device and simulator. Use it just like in the commandline. If is a Hash, it should be like this: { :device => “XXXXX”, :simulator => “XXXXX” }



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/cocoapods-ppbuild/Main.rb', line 57

def set_custom_xcodebuild_options_for_prebuilt_frameworks(options)
    if options.kind_of? Hash
        DSL.custom_build_options = [ options[:device] ] unless options[:device].nil?
        DSL.custom_build_options_simulator = [ options[:simulator] ] unless options[:simulator].nil?
    elsif options.kind_of? String
        DSL.custom_build_options = [options]
        DSL.custom_build_options_simulator = [options]
    else
        raise "Wrong type."
    end
end

#use_dynamic_binary!Object

Enable prebuiding for all pods it has a lower priority to other ppbuild settings



11
12
13
14
15
# File 'lib/cocoapods-ppbuild/Main.rb', line 11

def use_dynamic_binary!
    DSL.prebuild_all = true
    DSL.static_binary = false
    DSL.dont_remove_source_code = true
end

#use_static_binary!Object

设置是否使用静态库



22
23
24
25
26
# File 'lib/cocoapods-ppbuild/Main.rb', line 22

def use_static_binary!
    DSL.prebuild_all = true
    DSL.static_binary = true
    DSL.dont_remove_source_code = true
end

#use_swift_version(version) ⇒ Object

设置当前swift版本



17
18
19
# File 'lib/cocoapods-ppbuild/Main.rb', line 17

def use_swift_version(version)
    DSL.swift_version = version
end