cocoapods-packager-ext 0.0.12 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58db525ae0b5173a6d29fc3bf52b373acc3c5464c8ec73f825edcef0842e490a
4
- data.tar.gz: e3d0f10f47f07e579582c6188146f8eb3d92def26a61c81ffa1888e4f845c9cb
3
+ metadata.gz: 84c499b900fb1168ebcbf8f5b71cacc402e4a29e6204357b99655df721d1d4dd
4
+ data.tar.gz: c2832c442bfc7d0650563b4b512457ba6fb018a5604b9ca9a9cb4f0bf2b8bba3
5
5
  SHA512:
6
- metadata.gz: 00033ee3fbecaa3740e902a60482e5669368c92ae7e4d08845a4f20d39ff615428a0b4846bb0f61d1bdcfc99db0c6dcff5e816a6a7e67eaf44d0295fc266e9ac
7
- data.tar.gz: 1d3b69017ead90b8cb023f62c28227a9ddc25480ef1db48809f1e6a872fd62f6a3e4c065bfec54270b9b85888a5a49424e088d9a777f0a93f16c17a373692ed5
6
+ metadata.gz: 9ba741c09f68fb3a4712f2375ec87ea6fea71f87bbb343e8f416cbc7b38c09a558e20cb336280d117d4c7cec944bb860654edcd0d55638562c7a6c9a766590b5
7
+ data.tar.gz: 83b0a5513f8f18973fd663c7dc25b5a243055a89b16070a4fc8558683a95851a59cea473ffb0f41e84327779ebf4d0c8acf6d72ff9989bdcfdbf9f99a7692154
@@ -20,5 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency 'bundler', '~> 1.3'
22
22
  spec.add_development_dependency 'rake'
23
- spec.add_development_dependency 'cocoapods-packager'
23
+ spec.add_runtime_dependency(%q<cocoapods-packager>.freeze,["1.5.1"])
24
+
24
25
  end
@@ -6,6 +6,7 @@ module Pod
6
6
  if @dry_deps
7
7
  prepare
8
8
  resolve_dependencies
9
+ exit 0
9
10
  else
10
11
  install_t!
11
12
  end
@@ -32,25 +33,46 @@ module Pod
32
33
  # @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
33
34
  # in the `plugins.json` file, once your plugin is released.
34
35
  #
36
+ module ClassMethods
37
+ def options
38
+ options = [
39
+ ['--dry-deps','only test depend'],
40
+ ]
41
+ options.concat(super)
42
+ end
43
+ end
35
44
  class Install
45
+
36
46
  def self.options
37
47
  [
38
48
  ['--repo-update', 'Force running `pod repo update` before install'],
39
49
  ['--deployment', 'Disallow any changes to the Podfile or the Podfile.lock during installation'],
40
- ['--clean-install', 'Ignore the contents of the project cache and force a full pod installation. This only ' \
41
- 'applies to projects that have enabled incremental installation'],
50
+ ['--clean-install', 'Ignore the contents of the project cache and force a full pod installation. This only applies to projects that have enabled incremental installation.'],
42
51
  ['--dry-deps','only test depend'],
43
52
  ].concat(super).reject { |(name, _)| name == '--no-repo-update' }
44
53
  end
54
+
55
+ # class << self
56
+ # options_t = instance_method(:options)
57
+ # # alias options_t options
58
+ # define_method(:options) do
59
+ # item = options_t.bind(self).call()
60
+ #
61
+ # [
62
+ # ['--dry-deps','only test depend'],
63
+ # ].concat(item)
64
+ # end
65
+ # end
45
66
  # class << self
46
67
  # alias options_t options
47
68
  # def options
48
- # o = options_t
49
- # o.push(['--dry-deps','only test depend'])
50
- # o.concat(super)
69
+ # o = options_t
70
+ # o.push(['--dry-deps','only test depend'])
71
+ # o.concat(super)
51
72
  # end
52
73
  #
53
74
  # end
75
+
54
76
  def initialize(argv)
55
77
  super
56
78
  @deployment = argv.flag?('deployment', false)
@@ -58,34 +80,16 @@ module Pod
58
80
  @dry_deps = argv.flag?('dry-deps',false)
59
81
  end
60
82
 
61
- # alias run_t run
62
- # def run
63
- # if @dry_deps
64
- # verify_podfile_exists!
65
- # installer = installer_for_config
66
- # installer.repo_update = repo_update?(:default => false)
67
- # installer.update = false
68
- # installer.deployment = @deployment
69
- # installer.clean_install = @clean_install
70
- # installer.dry_deps = @dry_deps
71
- # installer.install!
72
- # else
73
- # run_t
74
- # end
75
- # end
76
- def run
77
- verify_podfile_exists!
78
- installer = installer_for_config
79
- installer.repo_update = repo_update?(:default => false)
80
- installer.update = false
81
- installer.deployment = @deployment
82
- installer.clean_install = @clean_install
83
+ alias installer_for_config_t installer_for_config
84
+ def installer_for_config
85
+ item = installer_for_config_t
83
86
  if @dry_deps
84
- installer.dry_deps = @dry_deps
87
+ item.dry_deps = @dry_deps
85
88
  end
86
- installer.install!
89
+ item
87
90
  end
88
91
 
92
+
89
93
  end
90
94
  end
91
95
  end
@@ -1,5 +1,7 @@
1
- require 'cocoapods-packager-ext/ext/downloader/path'
1
+ require 'cocoapods-packager-ext/ext/downloader/lnpath'
2
2
  require 'cocoapods-packager-ext/ext/downloader_ext'
3
+ require 'cocoapods-packager-ext/ext/pod_utils'
4
+
3
5
  module Pod
4
6
  class Command
5
7
  # This is an example of a cocoapods plugin adding a top-level subcommand
@@ -21,29 +23,99 @@ module Pod
21
23
  #
22
24
  class Package
23
25
  class << self
24
- alias options_t options
25
- def options
26
- o = options_t
27
- o.push(['--all-deps','add all-depends'])
28
- o.push(['--archs','select archs'])
29
- o.push(['--black-deps','select exclude deps'])
30
- o.concat(super)
26
+
27
+ begin
28
+ alias options_t options
29
+ def options
30
+ o = options_t
31
+ o.push(['--archs','select archs'])
32
+ o.push(['--podfile','select deps version from podfile'])
33
+ o.push(['--platform','select platform'])
34
+ o.concat(super)
35
+ end
36
+ rescue
37
+ return
31
38
  end
39
+
32
40
 
33
41
  end
34
42
 
35
43
  alias initialize_t initialize
36
44
  def initialize(argv)
37
- @all_deps = argv.flag?('all-deps',false)
45
+ @exclude_dep_items = argv.option('exclude-deps','').split(',')
38
46
  @select_archs = argv.option('archs','').split(',')
39
- @black_deps = argv.option('black-deps','').split(',')
47
+ @podfile = argv.option('podfile','')
48
+ @platform = argv.option('platform','')
40
49
  initialize_t argv
41
50
  end
42
51
 
52
+ alias build_in_sandbox_t build_in_sandbox
53
+ def build_in_sandbox(platform)
54
+ config.installation_root = Pathname.new(Dir.pwd)
55
+ config.sandbox_root = 'Pods'
56
+
57
+ static_sandbox = build_static_sandbox(@dynamic)
58
+ static_installer = install_pod(platform.name, static_sandbox)
59
+
60
+ if @dynamic
61
+ dynamic_sandbox = build_dynamic_sandbox(static_sandbox, static_installer)
62
+ install_dynamic_pod(dynamic_sandbox, static_sandbox, static_installer, platform)
63
+ end
64
+
65
+ begin
66
+ perform_build(platform, static_sandbox, dynamic_sandbox, static_installer)
67
+ ensure # in case the build fails; see Builder#xcodebuild.
68
+ if not ENV['ENABLE_BACKUP_WORKSPACE']
69
+ Pathname.new(config.sandbox_root).rmtree
70
+ FileUtils.rm_f('Podfile.lock')
71
+ end
72
+ end
73
+ end
74
+
75
+ def spec_library(platform)
76
+ spec = <<RB
77
+ s.#{platform.name}.deployment_target = '#{platform.deployment_target}'
78
+ s.#{platform.name}.vendored_libraries = ['#{platform}/*.a']
79
+ s.#{platform.name}.public_header_files = ['#{platform}/Headers/*.{h}']
80
+ s.#{platform.name}.source_files = ['#{platform}/Headers/*.{h}']
81
+ s.#{platform.name}.resource = ['#{platform}/Resources/*.bundle']
82
+ s.#{platform.name}.module_map = "#{platform}/Modules/module.modulemap"
83
+ RB
84
+ end
85
+
86
+ alias build_package_t build_package
87
+ def build_package
88
+ if @platform == ''
89
+ build_package_t
90
+ else
91
+ builder = SpecBuilder.new(@spec, @source, @embedded, @dynamic)
92
+ newspec = builder.spec_metadata
93
+
94
+ @spec.available_platforms.each do |platform|
95
+ if @platform.include?(platform.name.to_s)
96
+ UI.puts 'build package platform:'+platform.name.to_s
97
+ build_in_sandbox(platform)
98
+ if @library
99
+ newspec += spec_library(platform)
100
+ else
101
+ newspec += builder.spec_platform(platform)
102
+ end
103
+
104
+
105
+ else
106
+ UI.puts 'jump build platforms:'+platform.to_s
107
+ end
108
+ end
109
+
110
+ newspec += builder.spec_close
111
+ File.open(@spec.name + '.podspec', 'w') { |file| file.write(newspec) }
112
+ end
113
+
114
+ end
43
115
 
44
116
  alias perform_build_t perform_build
45
- def perform_build(platform, static_sandbox, dynamic_sandbox)
46
- if @all_deps
117
+ def perform_build(platform, static_sandbox, dynamic_sandbox,static_installer)
118
+ if @select_archs.length > 0 || @exclude_dep_items.length > 0
47
119
  static_sandbox_root = config.sandbox_root.to_s
48
120
 
49
121
  if @dynamic
@@ -52,28 +124,29 @@ module Pod
52
124
  end
53
125
 
54
126
  builder = Pod::Builder.new(
55
- @source_dir,
56
- static_sandbox_root,
57
- dynamic_sandbox_root,
58
- static_sandbox.public_headers.root,
59
- @spec,
60
- @embedded,
61
- @mangle,
62
- @dynamic,
63
- @config,
64
- @bundle_identifier,
65
- @exclude_deps,
66
- @all_deps,
67
- @black_deps,
68
- @select_archs
127
+ platform,
128
+ static_installer,
129
+ @source_dir,
130
+ static_sandbox_root,
131
+ dynamic_sandbox_root,
132
+ static_sandbox.public_headers.root,
133
+ @spec,
134
+ @embedded,
135
+ @mangle,
136
+ @dynamic,
137
+ @config,
138
+ @bundle_identifier,
139
+ @exclude_deps,
140
+ @exclude_dep_items,
141
+ @select_archs
69
142
  )
70
143
 
71
- builder.build(platform, @library)
144
+ builder.build(@package_type)
72
145
 
73
146
  return unless @embedded
74
147
  builder.link_embedded_resources
75
148
  else
76
- perform_build_t(platform,static_sandbox,dynamic_sandbox)
149
+ perform_build_t(platform,static_sandbox,dynamic_sandbox,static_installer)
77
150
  end
78
151
  end
79
152
 
@@ -2,108 +2,218 @@ require "fileutils"
2
2
 
3
3
  module Pod
4
4
  class Builder
5
-
6
- def deal_target(path)
7
- for item in @target_type_ext
8
- if File.extname(path) == item
9
- isBlack = false
10
- for black in @black_deps
11
- if File.basename(path).include? black
12
- isBlack = true
13
- end
14
- end
15
- if isBlack
16
- return
17
- end
18
- begin
19
- if File.directory? path
20
- FileUtils.copy_entry(path,"#{@target_dir_ext_ext}/#{File.basename(path)}", false,false, true)
21
- else
22
- FileUtils.cp(path,"#{@target_dir_ext_ext}/#{File.basename(path)}")
23
- end
24
- rescue Exception => e
25
- puts e
26
- end
27
- return
28
- end
29
- end
30
- if File.directory? path
31
- is_black = false
32
- for black in @black_list_ext
33
- if black == path
34
- is_black = true
35
- break
36
- end
37
- end
38
- if is_black
39
- return
40
- end
41
- Dir.foreach(path) do |file|
42
- if file != '.' && file != '..'
43
- deal_target(path+'/'+file)
44
- end
5
+
6
+ alias build_static_library_t build_static_library
7
+ def build_static_library
8
+ build_static_library_t
9
+ platform_path = Pathname.new(@platform.name.to_s)
10
+ header_path = platform_path+'Headers'
11
+ header_path.mkpath unless header_path.exist?
12
+
13
+ module_map_path = platform_path+'Modules'
14
+ module_map_path.mkpath unless module_map_path.exist?
15
+ copy_headers_to_target header_path,module_map_path
16
+
17
+ resources_path = platform_path+'Resources'
18
+ resources_path.mkpath unless resources_path.exist?
19
+ copy_resources_to_target resources_path
20
+ end
21
+ alias build_static_library_for_ios_t build_static_library_for_ios
22
+ def build_static_library_for_ios(output)
23
+ if @exclude_dep_items.length > 0
24
+ static_libs = static_libs_in_sandbox('build') + static_libs_in_sandbox('build-sim') + vendored_libraries
25
+ static_libs.reject! {|lib| @exclude_dep_items.any? {|item| lib.to_s.include? item}}
26
+ libs = ios_architectures.map do |arch|
27
+ library = "#{@static_sandbox_root}/build/package-#{arch}.a"
28
+ `libtool -arch_only #{arch} -static -o #{library} #{static_libs.join(' ')}`
29
+ library
45
30
  end
31
+
32
+ `lipo -create -output #{output} #{libs.join(' ')}`
46
33
 
34
+ # static_libs = static_libs_in_sandbox('build')
35
+ # sim_libs = static_libs_in_sandbox('build-sim')
36
+ # for item in @black_deps
37
+ # static_libs.delete_if do |obj|
38
+ # obj.include? item
39
+ # end
40
+ # sim_libs.delete_if do |obj|
41
+ # obj.include? item
42
+ # end
43
+ # end
44
+ # UI.puts "links statics:#{static_libs.join(' ')}, sim_libs:#{sim_libs.join(' ')}"
45
+ # `xcrun -r libtool -no_warning_for_no_symbols -static -o #{output} #{static_libs.join(' ')} #{sim_libs.join(' ')}`
46
+ else
47
+ build_static_library_for_ios_t output
47
48
  end
48
49
  end
49
50
 
50
- alias build_library_t build_library
51
- def build_library(platform, defines, output)
52
- deal_target(@static_sandbox_root)
53
-
54
51
 
55
- build_library_t platform,defines,output
52
+ alias static_linker_flags_in_sandbox_t ios_architectures
53
+ def static_linker_flags_in_sandbox
54
+ static_libs = static_libs_in_sandbox('build') + static_libs_in_sandbox('build-sim') + vendored_libraries
55
+ linker_flags = static_libs.map do |lib|
56
+ lib = lib.chomp('.a').split('/').last
57
+ lib.slice!('lib')
58
+ "-l#{lib}"
59
+ end
60
+ linker_flags.reject { |e| e == "-l#{@spec.name}" || e == '-lPods-packager' }
56
61
  end
57
62
 
58
- alias ios_build_options_t ios_build_options
59
63
  def ios_build_options
64
+ if ENV['DISABLE_BITCODE']
65
+ "ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-Qunused-arguments\'"
66
+ else
67
+ "ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
68
+ end
69
+ end
70
+
71
+ def static_linker_defines
72
+ static_libs = static_libs_in_sandbox('build') + static_libs_in_sandbox('build-sim')
73
+ static_libs = static_libs.map { |path| Pathname("#{Dir.pwd}/#{path}").parent.to_s }
74
+ vendored_libs = vendored_libraries.map { |path| Pathname(path).parent.to_s }
75
+ link_paths = static_libs + vendored_libs
76
+ link_paths.uniq.join(" ")
77
+ end
78
+ alias build_dynamic_framework_for_ios_t build_dynamic_framework_for_ios
79
+ def build_dynamic_framework_for_ios(defines, output)
80
+ # Specify frameworks to link and search paths
81
+ linker_flags = static_linker_flags_in_sandbox
82
+ defines = "#{defines} OTHER_LDFLAGS='$(inherited) #{linker_flags.join(' ')}'"
83
+
84
+ # Build Target Dynamic Framework for both device and Simulator
85
+ device_defines = "#{defines} LIBRARY_SEARCH_PATHS=\"#{static_linker_defines}\""
86
+ device_options = ios_build_options << ' -sdk iphoneos'
87
+ xcodebuild(device_defines, device_options, 'build', @spec.name.to_s, @dynamic_sandbox_root.to_s)
88
+ if @select_archs.size == 0 || @select_archs.include?('i386') || @select_archs.include?('x86_64')
89
+ sim_defines = "#{defines} LIBRARY_SEARCH_PATHS=\"#{Dir.pwd}/#{@static_sandbox_root}/build-sim\" ONLY_ACTIVE_ARCH=NO"
90
+ xcodebuild(sim_defines, '-sdk iphonesimulator', 'build-sim', @spec.name.to_s, @dynamic_sandbox_root.to_s)
91
+ # Combine architectures
92
+ `lipo #{@dynamic_sandbox_root}/build/#{@spec.name}.framework/#{@spec.name} #{@dynamic_sandbox_root}/build-sim/#{@spec.name}.framework/#{@spec.name} -create -output #{output}`
93
+ else
94
+ `mv #{@dynamic_sandbox_root}/build/#{@spec.name}.framework/#{@spec.name} #{output}`
95
+ end
96
+
97
+ FileUtils.mkdir(@platform.name.to_s)
98
+ `mv #{@dynamic_sandbox_root}/build/#{@spec.name}.framework #{@platform.name}`
99
+ `mv #{@dynamic_sandbox_root}/build/#{@spec.name}.framework.dSYM #{@platform.name}`
100
+ end
101
+
102
+ alias ios_architectures_t ios_architectures
103
+ def ios_architectures
60
104
  if @select_archs.size != 0
61
- return "ARCHS=\'#{@select_archs.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
105
+ return @select_archs
62
106
  else
63
- return "ARCHS=\'x86_64 i386 arm64 armv7\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
107
+ return ios_architectures_t
64
108
  end
65
109
  end
66
110
 
67
- alias build_sim_libraries_t build_sim_libraries
68
- def build_sim_libraries(platform, defines)
69
- if @select_archs.size != 0 && !@select_archs.include?('i386') && !@select_archs.include?('x86_64')
70
- return
71
- else
72
- UI.puts 'start build sim'
73
- build_sim_libraries_t platform,defines
74
- end
111
+ alias copy_headers_t copy_headers
112
+ def copy_headers
113
+ copy_headers_to_target @fwk.headers_path
75
114
  end
76
115
 
77
- alias build_static_lib_for_ios_t build_static_lib_for_ios
78
- def build_static_lib_for_ios(static_libs, _defines, output)
79
- if @all_deps
80
- return if static_libs.count == 0
81
- sim_libs = static_libs_in_sandbox('build-sim')
82
- for item in @black_deps
83
- static_libs.delete_if do |obj|
84
- obj.include? item
85
- end
86
- sim_libs.delete_if do |obj|
87
- obj.include? item
116
+ def copy_headers_to_target(headers_target_path,module_map_target_path)
117
+ headers_target_path = @fwk.headers_path if headers_target_path.nil?
118
+ module_map_target_path = @fwk.module_map_path if module_map_target_path.nil?
119
+
120
+ headers_source_root = "#{@public_headers_root}/#{@spec.name}"
121
+
122
+ Dir.glob("#{headers_source_root}/**/*.h").
123
+ each { |h| `ditto #{h} #{headers_target_path}/#{h.sub(headers_source_root, '')}` }
124
+
125
+ # If custom 'module_map' is specified add it to the framework distribution
126
+ # otherwise check if a header exists that is equal to 'spec.name', if so
127
+ # create a default 'module_map' one using it.
128
+ if !@spec.module_map.nil?
129
+ module_map_file = @file_accessors.flat_map(&:module_map).first
130
+ module_map = File.read(module_map_file) if Pathname(module_map_file).exist?
131
+ elsif File.exist?("#{@public_headers_root}/#{@spec.name}/#{@spec.name}.h")
132
+ module_map = <<MAP
133
+ framework module #{@spec.name} {
134
+ umbrella header "#{@spec.name}.h"
135
+
136
+ export *
137
+ module * { export * }
138
+ }
139
+ MAP
140
+ else
141
+
142
+ f = File.new(File.join("#{headers_target_path}","#{@spec.name}.h"), "w+")
143
+ f.puts("#import <UIKit/UIKit.h>")
144
+ f.puts("#import <Foundation/Foundation.h>")
145
+ Dir.foreach(headers_target_path) do |filename|
146
+ if filename != "." and filename != ".."
147
+ f.puts("#import \"#{filename}\"")
88
148
  end
89
149
  end
90
- UI.puts "links statics:#{static_libs.join(' ')}, sim_libs:#{sim_libs.join(' ')}"
91
- `xcrun -r libtool -no_warning_for_no_symbols -static -o #{output} #{static_libs.join(' ')} #{sim_libs.join(' ')}`
150
+ f.close
151
+
152
+ module_map = <<MAP
153
+ framework module #{@spec.name} {
154
+ umbrella header "#{@spec.name}.h"
155
+
156
+ export *
157
+ module * { export * }
158
+ }
159
+ MAP
160
+ end
161
+
162
+ unless module_map.nil?
163
+ module_map_target_path.mkpath unless module_map_target_path.exist?
164
+ File.write("#{module_map_target_path}/module.modulemap", module_map)
165
+ end
166
+ end
167
+
168
+ alias copy_resources_t copy_resources
169
+ def copy_resources
170
+ copy_resources_to_target @fwk.resources_path
171
+ end
172
+ def copy_resources_to_target(resources_target_path)
173
+ resources_target_path = @fwk.resources_path if resources_target_path.nil?
174
+ if @exclude_deps
175
+ bundles = @static_installer.pod_targets.flat_map(&:file_accessors).flat_map{|item|item.resources}
176
+ else
177
+ bundles = @static_installer.pod_targets.reject { |t| @exclude_dep_items.any?{|item|t.pod_name == item}}.flat_map(&:file_accessors).flat_map{|item|item.resources}
178
+ end
179
+ if @dynamic
180
+ resources_path = "ios/#{@spec.name}.framework"
181
+ bundles.tap{|path| FileUtils.cp_r path,resources_path}
182
+ `cp -rp #{@static_sandbox_root}/build/*.bundle #{resources_path} 2>&1`
92
183
  else
93
- build_static_lib_for_ios static_libs,_defines,output
184
+ `cp -rp #{@static_sandbox_root}/build/*.bundle #{resources_path} 2>&1`
185
+ resources = expand_paths(@spec.consumer(@platform).resources)
186
+ if resources.count == 0 && bundles.count == 0
187
+ if @fwk
188
+ @fwk.delete_resources
189
+ else
190
+ if resources_target_path.exist?
191
+ FileUtils.rm_rf resources_target_path
192
+ end
193
+ end
194
+ return
195
+ end
196
+ if resources.count > 0
197
+ `cp -rp #{resources.join(' ')} #{resources_target_path}`
198
+ end
94
199
  end
95
-
200
+ end
201
+
202
+ alias build_sim_libraries_t build_sim_libraries
203
+ def build_sim_libraries(defines)
204
+ if @select_archs.size != 0 && !@select_archs.include?('i386') && !@select_archs.include?('x86_64')
205
+ return
206
+ else
207
+ UI.puts 'start build sim'
208
+ build_sim_libraries_t defines
209
+ end
96
210
  end
97
211
 
98
212
  alias initialize_t initialize
99
- def initialize(source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps, all_deps,black_deps,select_archs)
100
- @all_deps = all_deps
101
- @black_deps = black_deps
213
+ def initialize(platform, static_installer, source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps,exclude_dep_items=[],select_archs=[])
214
+ @exclude_dep_items = exclude_dep_items
102
215
  @select_archs = select_archs
103
- @target_type_ext = ['.a','.bundle']
104
- @target_dir_ext_ext = "#{static_sandbox_root}/build"
105
- @black_list_ext = ["#{static_sandbox_root}/build","#{static_sandbox_root}/build-sim"]
106
- initialize_t(source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps)
216
+ initialize_t(platform, static_installer,source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps)
107
217
  end
108
218
  end
109
219
  end
@@ -11,7 +11,7 @@ module Pod
11
11
 
12
12
  def download_file(full_filename)
13
13
 
14
- # ln! "-s",url, full_filename
14
+ ln! "-s",url, full_filename
15
15
  end
16
16
 
17
17
  end
@@ -1,11 +1,11 @@
1
1
  module Pod
2
2
  module Downloader
3
- autoload :LocalPath,'cocoapods-packager-ext/ext/downloader/path'
3
+ autoload :LocalPath,'cocoapods-packager-ext/ext/downloader/lnpath'
4
4
  class << self
5
5
  alias downloader_class_by_key_t downloader_class_by_key
6
6
  def downloader_class_by_key
7
7
  keys = downloader_class_by_key_t
8
- keys[:path] = LocalPath
8
+ keys[:lnpath] = LocalPath
9
9
  return keys
10
10
  end
11
11
  end
@@ -0,0 +1,57 @@
1
+ module Pod
2
+ class Command
3
+ class Package
4
+
5
+ # @param [Pod::Installer] static_installer
6
+ #
7
+ # @return [Pod::PodTarget]
8
+ #
9
+ alias build_dynamic_target_t build_dynamic_target
10
+
11
+ def build_dynamic_target(dynamic_sandbox, static_installer, platform)
12
+ spec_targets = static_installer.pod_targets.select do |target|
13
+ target.name == @spec.name
14
+ end
15
+ static_target = spec_targets[0]
16
+
17
+ file_accessors = create_file_accessors(static_target, dynamic_sandbox)
18
+
19
+ archs = []
20
+ dynamic_target = Pod::PodTarget.new(dynamic_sandbox, BuildType.dynamic_framework, static_target.user_build_configurations, archs, platform, static_target.specs, static_target.target_definitions, file_accessors)
21
+ dynamic_target
22
+ end
23
+ alias copy_dynamic_target_t copy_dynamic_target
24
+ def copy_dynamic_target(static_sandbox, _dynamic_target, dynamic_sandbox)
25
+ command = "ln -sf #{static_sandbox.root}/#{@spec.name} #{dynamic_sandbox.root}"
26
+ `#{command}`
27
+ end
28
+
29
+ alias write_pod_project_t write_pod_project
30
+ def write_pod_project(dynamic_project, dynamic_sandbox)
31
+ UI.message "- Writing Xcode project file to #{UI.path dynamic_sandbox.project_path}" do
32
+ dynamic_project.pods.remove_from_project if dynamic_project.pods.empty?
33
+ dynamic_project.development_pods.remove_from_project if dynamic_project.development_pods.empty?
34
+ dynamic_project.sort(:groups_position => :below)
35
+ dynamic_project.recreate_user_schemes(false)
36
+
37
+ # Edit search paths so that we can find our dependency headers
38
+ dynamic_project.targets.first.build_configuration_list.build_configurations.each do |config|
39
+ header_path = Dir.glob("#{Dir.pwd}/Pods/Static/Headers/*/*")
40
+ header_path.push "#{Dir.pwd}/Pods/Static/Headers/Public"
41
+ header_path.push "#{Dir.pwd}/Pods/Static/Headers/Private"
42
+ header_path.reject! {|item|item.split('/').last == dynamic_project.targets.first.name}
43
+ header_path = header_path.join " "
44
+ config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) #{header_path}"
45
+ config.build_settings['USER_HEADER_SEARCH_PATHS'] = "$(inherited) #{header_path}"
46
+ config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -ObjC'
47
+
48
+ if ENV['DISABLE_BITCODE']
49
+ config.build_settings['ENABLE_BITCODE'] = 'NO'
50
+ end
51
+ end
52
+ dynamic_project.save
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsPackagerExt
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.23"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-packager-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - kyle.zhou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-23 00:00:00.000000000 Z
11
+ date: 2021-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: cocoapods-packager
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
47
+ version: 1.5.1
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 1.5.1
55
55
  description: A short description of cocoapods-packager-ext.
56
56
  email:
57
57
  - kyle.zhou@qq.com
@@ -70,8 +70,9 @@ files:
70
70
  - lib/cocoapods-packager-ext/command/install_ext.rb
71
71
  - lib/cocoapods-packager-ext/command/package_ext.rb
72
72
  - lib/cocoapods-packager-ext/ext/builder.rb
73
- - lib/cocoapods-packager-ext/ext/downloader/path.rb
73
+ - lib/cocoapods-packager-ext/ext/downloader/lnpath.rb
74
74
  - lib/cocoapods-packager-ext/ext/downloader_ext.rb
75
+ - lib/cocoapods-packager-ext/ext/pod_utils.rb
75
76
  - lib/cocoapods-packager-ext/gem_version.rb
76
77
  - lib/cocoapods_plugin.rb
77
78
  - spec/command/ext_spec.rb