Module: Pod::Podfile::DSL

Defined in:
lib/cocoapods-tdf-bin/native/podfile.rb

Overview

TREAT_DEVELOPMENTS_AS_NORMAL = ‘treat_developments_as_normal’.freeze

Instance Method Summary collapse

Instance Method Details

#allow_prerelease!Object



11
12
13
# File 'lib/cocoapods-tdf-bin/native/podfile.rb', line 11

def allow_prerelease!
  set_internal_hash_value(ALLOW_PRERELEASE, true)
end

#batch_pod_local(pods, path = "../../") ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cocoapods-tdf-bin/native/podfile.rb', line 15

def batch_pod_local(pods, path = "../../")
  pod_hash = Hash.new
  pods.each do |name|
    pod_hash[name] =  [ :path => "#{path}#{name}" ]
  end
  if get_batch_local_pods.nil?
    set_internal_hash_value(BATCH_POD_LOCAL, pod_hash)
  else
    set_internal_hash_value(BATCH_POD_LOCAL, get_internal_hash_value(BATCH_POD_LOCAL).merge(pod_hash))
  end
end

#batch_pod_remote(pods, branch, group = 'ios') ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/cocoapods-tdf-bin/native/podfile.rb', line 27

def batch_pod_remote(pods, branch , group = 'ios')
  pod_hash = Hash.new
  pods.each do |name|
    pod_hash[name] = [ :git => "[email protected]:#{group}/#{name}.git", :branch => "#{branch}" ]
  end
  if get_batch_remote_pods.nil?
    set_internal_hash_value(BATCH_POD_REMOTE, pod_hash)
  else
    set_internal_hash_value(BATCH_POD_REMOTE, get_internal_hash_value(BATCH_POD_REMOTE).merge(pod_hash))
  end
end

#pod(name = nil, *requirements) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/cocoapods-tdf-bin/native/podfile.rb', line 39

def pod(name = nil, *requirements)
  unless name
    raise StandardError, 'A dependency requires a name.'
  end

  local_pod_hash = get_batch_local_pods
  remote_pod_hash = get_batch_remote_pods
  if remote_pod_hash != nil
    requirements = remote_pod_hash[name].nil? ? requirements : remote_pod_hash[name];
  end
  if local_pod_hash != nil
    requirements = local_pod_hash[name].nil? ? requirements : local_pod_hash[name];
  end
  current_target_definition.store_pod(name, *requirements)
end

#set_configuration_env(env = "dev") ⇒ Object

0 dev 1 debug_iphoneos 2 release_iphoneos 需要在podfile_env 先定义 CONFIGURATION_ENV



75
76
77
# File 'lib/cocoapods-tdf-bin/native/podfile.rb', line 75

def set_configuration_env(env = "dev")
  set_internal_hash_value(CONFIGURATION_ENV, env)
end

#set_use_source_pods(pods) ⇒ Object



65
66
67
68
69
# File 'lib/cocoapods-tdf-bin/native/podfile.rb', line 65

def set_use_source_pods(pods)
  hash_pods_use_source = get_internal_hash_value(USE_SOURCE_PODS) || []
  hash_pods_use_source += Array(pods)
  set_internal_hash_value(USE_SOURCE_PODS, hash_pods_use_source)
end

#use_binaries!(flag = true) ⇒ Object



55
56
57
# File 'lib/cocoapods-tdf-bin/native/podfile.rb', line 55

def use_binaries!(flag = true)
  set_internal_hash_value(USE_BINARIES, flag)
end

#use_binaries_with_spec_selector!(&block) ⇒ Object

Raises:

  • (Informative)


59
60
61
62
63
# File 'lib/cocoapods-tdf-bin/native/podfile.rb', line 59

def use_binaries_with_spec_selector!(&block)
  raise Informative, '必须提供选择需要二进制组件的 block !' unless block_given?

  set_internal_hash_value(USE_BINARIES_SELECTOR, block)
end