From 4f28a6344519cdedcbf67ef5e2a89680d686e3bf Mon Sep 17 00:00:00 2001 From: "weijie.lwj" Date: Fri, 12 May 2017 17:09:48 +0800 Subject: [PATCH 1/4] bugfix:podspec of outting add dependency desc when build with excludes_dep --- lib/cocoapods-packager/spec_builder.rb | 19 +++++++++++++++++++ lib/pod/command/package.rb | 1 + 2 files changed, 20 insertions(+) diff --git a/lib/cocoapods-packager/spec_builder.rb b/lib/cocoapods-packager/spec_builder.rb index 52b45fd..4b9e7e5 100644 --- a/lib/cocoapods-packager/spec_builder.rb +++ b/lib/cocoapods-packager/spec_builder.rb @@ -43,6 +43,25 @@ def spec_close "end\n" end + def spec_dependenies(excludedeps) + dependencies = "" + if excludedeps + @spec.dependencies.each do |dep| + dependency = "" + if dep.name != nil && dep.name.class == String + dependency += %Q( s.dependency "#{dep.name}") + if dep.requirement != nil + dependency += %Q(, "#{dep.requirement}") + end + end + dependency += "\n" + dependencies += dependency + end + end + + dependencies + end + private def spec_header diff --git a/lib/pod/command/package.rb b/lib/pod/command/package.rb index c14bc09..466319a 100644 --- a/lib/pod/command/package.rb +++ b/lib/pod/command/package.rb @@ -102,6 +102,7 @@ def build_package newspec += builder.spec_platform(platform) end + newspec += builder.spec_dependenies(@exclude_deps) newspec += builder.spec_close File.open(@spec.name + '.podspec', 'w') { |file| file.write(newspec) } end From 0ef1026b78a8611bc4c8cec9161252e00b8ba860 Mon Sep 17 00:00:00 2001 From: "weijie.lwj" Date: Fri, 12 May 2017 18:35:08 +0800 Subject: [PATCH 2/4] fix ci problem --- lib/cocoapods-packager/spec_builder.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/cocoapods-packager/spec_builder.rb b/lib/cocoapods-packager/spec_builder.rb index 4b9e7e5..c73a2de 100644 --- a/lib/cocoapods-packager/spec_builder.rb +++ b/lib/cocoapods-packager/spec_builder.rb @@ -44,18 +44,16 @@ def spec_close end def spec_dependenies(excludedeps) - dependencies = "" + dependencies = %( # Dependencies\n) if excludedeps @spec.dependencies.each do |dep| - dependency = "" - if dep.name != nil && dep.name.class == String - dependency += %Q( s.dependency "#{dep.name}") - if dep.requirement != nil - dependency += %Q(, "#{dep.requirement}") + if !dep.name.nil? && dep.name.class == String + if !dep.requirement.nil? + dependencies += %( s.dependency "#{dep.name}", "#{dep.requirement}"\n) + else + dependencies += %( s.dependency "#{dep.name}"\n) end end - dependency += "\n" - dependencies += dependency end end From a2934db590ac3c4f99d27a4351015f0857306671 Mon Sep 17 00:00:00 2001 From: "weijie.lwj" Date: Fri, 12 May 2017 19:35:05 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix=20ci=20problem=20again=5F(:=D0=B7?= =?UTF-8?q?=E3=82=9D=E2=88=A0)=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cocoapods-packager/spec_builder.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cocoapods-packager/spec_builder.rb b/lib/cocoapods-packager/spec_builder.rb index c73a2de..898e102 100644 --- a/lib/cocoapods-packager/spec_builder.rb +++ b/lib/cocoapods-packager/spec_builder.rb @@ -47,13 +47,13 @@ def spec_dependenies(excludedeps) dependencies = %( # Dependencies\n) if excludedeps @spec.dependencies.each do |dep| - if !dep.name.nil? && dep.name.class == String + next if dep.name.nil? || dep.name.class != String + dependencies += if !dep.requirement.nil? - dependencies += %( s.dependency "#{dep.name}", "#{dep.requirement}"\n) + %( s.dependency "#{dep.name}", "#{dep.requirement}"\n) else - dependencies += %( s.dependency "#{dep.name}"\n) + %( s.dependency "#{dep.name}"\n) end - end end end From 541743fcbfa9c21092f0c1577d84546d443ccd6a Mon Sep 17 00:00:00 2001 From: 3f_hawk <3f_hawk@gmail.com> Date: Sun, 14 May 2017 02:06:50 +0800 Subject: [PATCH 4/4] =?UTF-8?q?try=20to=20fix=20ci=20question..=5F(:=D0=B7?= =?UTF-8?q?=E3=82=9D=E2=88=A0)=5F=20again=20and=20again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cocoapods-packager/spec_builder.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/cocoapods-packager/spec_builder.rb b/lib/cocoapods-packager/spec_builder.rb index 898e102..74b47dc 100644 --- a/lib/cocoapods-packager/spec_builder.rb +++ b/lib/cocoapods-packager/spec_builder.rb @@ -44,16 +44,10 @@ def spec_close end def spec_dependenies(excludedeps) - dependencies = %( # Dependencies\n) + dependencies = %( # Excluded - Dependencies\n) if excludedeps @spec.dependencies.each do |dep| - next if dep.name.nil? || dep.name.class != String - dependencies += - if !dep.requirement.nil? - %( s.dependency "#{dep.name}", "#{dep.requirement}"\n) - else - %( s.dependency "#{dep.name}"\n) - end + dependencies += %( s.dependency "#{dep.name}", "#{dep.requirement}"\n) end end