Module: Pod::Podfile::DSL

Defined in:
lib/cocoapods-xlbuild/Main.rb,
lib/cocoapods-xlbuild/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-xlbuild/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



36
37
38
# File 'lib/cocoapods-xlbuild/Main.rb', line 36

def enable_bitcode_for_prebuilt_frameworks!
    DSL.bitcode_enabled = true
end

#remove_source_code_for_prebuilt_frameworks!Object

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



31
32
33
# File 'lib/cocoapods-xlbuild/Main.rb', line 31

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” }



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/cocoapods-xlbuild/Main.rb', line 59

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

#set_local_frameworks_cache_path(path) ⇒ Object



8
9
10
# File 'lib/cocoapods-xlbuild/Main.rb', line 8

def set_local_frameworks_cache_path(path)
    DSL.local_frameworks_cache_path = path
end

#use_dynamic_binary!Object

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



13
14
15
16
17
# File 'lib/cocoapods-xlbuild/Main.rb', line 13

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

#use_static_binary!Object

设置是否使用静态库



24
25
26
27
28
# File 'lib/cocoapods-xlbuild/Main.rb', line 24

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版本



19
20
21
# File 'lib/cocoapods-xlbuild/Main.rb', line 19

def use_swift_version(version)
    DSL.swift_version = version
end