lib/cocoapods-packager/pod_utils.rb in cocoapods-packager-qcloud-1.5.1 vs lib/cocoapods-packager/pod_utils.rb in cocoapods-packager-qcloud-1.5.2
- old
+ new
@@ -38,20 +38,20 @@
static_installer
end
def podfile_from_spec(path, spec_name, platform_name, deployment_target, subspecs, sources)
options = {}
- spec_path = @path
+ spec_path = @originPath
if spec_path
- options[:podspec] = spec_path
+ options[:path] = Pathname(spec_path).dirname.to_path
else
options[:path] = '.'
end
puts "path is #{@path}"
options[:subspecs] = subspecs if subspecs
dependencies = @allLocalDependencies
- Pod::Podfile.new do
+ podfile = Pod::Podfile.new do
sources.each { |s| source s }
platform(platform_name, deployment_target)
pod(spec_name, options)
install!('cocoapods',
@@ -59,35 +59,31 @@
:deterministic_uuids => false)
if not dependencies.nil?
for dep in dependencies
pod dep.name , path:dep.path
- puts "pod #{dep.name} #{dep.path}"
end
else
puts "depencies is nil"
end
target('packager') do
if spec_path
if subspecs
subspecs.each do |subspec|
pod spec_name + '/' + subspec, :podspec => spec_path
end
- else
- pod spec_name, :podspec => spec_path
end
elsif subspecs
subspecs.each do |subspec|
pod spec_name + '/' + subspec, :path => '.'
end
- else
- pod spec_name, :path => '.'
end
end
-
-
end
+ puts "#{podfile.to_hash}"
+ puts "Realpath is #{Pathname(path).realpath.to_path}"
+ return podfile
end
def binary_only?(spec)
deps = spec.dependencies.map { |dep| spec_with_name(dep.name) }
[spec, *deps].each do |specification|
@@ -110,11 +106,11 @@
set.specification.root
end
def spec_with_path(path)
return if path.nil? || !Pathname.new(path).exist?
- @path = Pathname(path).realpath.to_path
- puts "path is #{@path}"
+ @path = path
+ @originPath = Pathname(path).realpath.to_path
if Pathname.new(path).directory?
help! path + ': is a directory.'
return
end