lib/cocoapods-tdf-bin/native/podfile.rb in cocoapods-tdf-bin-0.0.16 vs lib/cocoapods-tdf-bin/native/podfile.rb in cocoapods-tdf-bin-0.0.17
- old
+ new
@@ -10,10 +10,47 @@
module DSL
def allow_prerelease!
set_internal_hash_value(ALLOW_PRERELEASE, true)
end
+ 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
+
+ def batch_pod_remote(pods, branch , group = 'ios')
+ pod_hash = Hash.new
+ pods.each do |name|
+ pod_hash[name] = [ :git => "git@git.2dfire.net:#{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
+
+ 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
+ requirements = remote_pod_hash[name].nil? ? requirements : remote_pod_hash[name];
+ requirements = local_pod_hash[name].nil? ? requirements : local_pod_hash[name];
+
+ current_target_definition.store_pod(name, *requirements)
+ end
+
def use_binaries!(flag = true)
set_internal_hash_value(USE_BINARIES, flag)
end
def use_binaries_with_spec_selector!(&block)
@@ -57,9 +94,17 @@
get_internal_hash_value(ALLOW_PRERELEASE, false) || ENV[ALLOW_PRERELEASE] == 'true'
end
def use_binaries?
get_internal_hash_value(USE_BINARIES, false) || ENV[USE_BINARIES] == 'true'
+ end
+
+ def get_batch_local_pods
+ get_internal_hash_value(BATCH_POD_LOCAL)
+ end
+
+ def get_batch_remote_pods
+ get_internal_hash_value(BATCH_POD_REMOTE)
end
def use_source_pods
get_internal_hash_value(USE_SOURCE_PODS, []) + String(ENV[USE_SOURCE_PODS]).split('|').uniq
end