cocoapods-packager-ext 0.0.22 → 0.0.27

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: 9d1533e3a81379cabda6ffb6cf8a0ec7ac1e044d42af7f41e94344cd480bd38f
4
- data.tar.gz: 53da1e28b909db61fa9cdabf3cb242307d2eea126da42dd0381ce481c2e07bea
3
+ metadata.gz: 0ef9bb3e65c3e233810884f3717314f0f57e7339c0c1033b7860671e9aaab58e
4
+ data.tar.gz: 3ee71ef36791f0abc2d00d0edd60bbeed3a05e691aa1e2a4a3d16e272e2e5879
5
5
  SHA512:
6
- metadata.gz: 4ba30867ac2e65c3e0540e9897cbcf06306493786233333b8a90c5ca593c277f7bec718b054c47bd68f79417da06a600a15e46a880280d4905885b5516c74093
7
- data.tar.gz: 247481474b4035c2c7bbe819edf2080e05f9af133a0c4fea4800b880eb34b44031582290ef0d22e018487e0a37d3ce2f87eca052f891ae42ae856ce9a7880f4e
6
+ metadata.gz: df0bf8fc80d5fa9249c8141cad9dee3e6c80df4864ce15816dfc3e34fc07ffb7b01d06517b01d80ffc183b450c14d6784c3cd90bab5d3600f2a26f8980bc357f
7
+ data.tar.gz: c7576dd9cb0dc25541b8f58efb2b49ee7e9911f7b9410f9032bf969ca7c8527d61b6be88268ed09d8f286c37d55a790b33f47bdf922fe968df2bc232c8e9c1b3
@@ -65,16 +65,34 @@ module Pod
65
65
  begin
66
66
  perform_build(platform, static_sandbox, dynamic_sandbox, static_installer)
67
67
  ensure # in case the build fails; see Builder#xcodebuild.
68
- if ENV['ENABLE_BACKUP_WORKSPACE']
69
- target_dir = "#{@source_dir}/#{@spec.name}-#{@spec.version}/workspace_#{platform}"
70
- Dir.mkdir target_dir
71
- `mv "#{Dir.pwd}" "#{target_dir}"`
68
+ if ENV['ENABLE_BACKUP_WORKSPACE'] && (ENV['ENABLE_BACKUP_WORKSPACE'].upcase == 'YES' || ENV['ENABLE_BACKUP_WORKSPACE'].upcase == 'TRUE')
69
+ else
70
+ Pathname.new(config.sandbox_root).rmtree
71
+ FileUtils.rm_f('Podfile.lock')
72
72
  end
73
- Pathname.new(config.sandbox_root).rmtree
74
- FileUtils.rm_f('Podfile.lock')
75
73
  end
76
74
  end
77
75
 
76
+ def spec_library(platform)
77
+ spec = <<RB
78
+ s.#{platform.name.to_s}.deployment_target = '#{platform.deployment_target}'
79
+ s.#{platform.name.to_s}.vendored_libraries = ['#{platform.name.to_s}/*.a']
80
+ s.#{platform.name.to_s}.public_header_files = ['#{platform.name.to_s}/Headers/*.{h}']
81
+ s.#{platform.name.to_s}.source_files = ['#{platform.name.to_s}/Headers/*.{h}']
82
+ s.#{platform.name.to_s}.resource = ['#{platform.name.to_s}/Resources/*.bundle']
83
+ s.#{platform.name.to_s}.module_map = "#{platform.name.to_s}/Modules/module.modulemap"
84
+ RB
85
+ end
86
+
87
+ def spec_framework(platform)
88
+ spec = <<RB
89
+ s.#{platform.name.to_s}.public_header_files = ['#{platform.name.to_s}/Headers/*.{h}']
90
+ s.#{platform.name.to_s}.source_files = ['#{platform.name.to_s}/**/Headers/*.{h}']
91
+ s.#{platform.name.to_s}.resource = ['#{platform.name.to_s}/**/Resources/*.bundle']
92
+ s.#{platform.name.to_s}.module_map = "#{platform.name.to_s}/**/Modules/module.modulemap"
93
+ RB
94
+ end
95
+
78
96
  alias build_package_t build_package
79
97
  def build_package
80
98
  if @platform == ''
@@ -87,7 +105,13 @@ module Pod
87
105
  if @platform.include?(platform.name.to_s)
88
106
  UI.puts 'build package platform:'+platform.name.to_s
89
107
  build_in_sandbox(platform)
90
- newspec += builder.spec_platform(platform)
108
+ if @library
109
+ newspec += spec_library(platform)
110
+ else
111
+ newspec += builder.spec_platform(platform)
112
+ end
113
+
114
+
91
115
  else
92
116
  UI.puts 'jump build platforms:'+platform.to_s
93
117
  end
@@ -2,7 +2,22 @@ require "fileutils"
2
2
 
3
3
  module Pod
4
4
  class Builder
5
-
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
6
21
  alias build_static_library_for_ios_t build_static_library_for_ios
7
22
  def build_static_library_for_ios(output)
8
23
  if @exclude_dep_items.length > 0
@@ -46,7 +61,7 @@ module Pod
46
61
  end
47
62
 
48
63
  def ios_build_options
49
- if ENV['DISABLE_BITCODE']
64
+ if ENV['DISABLE_BITCODE'] && (ENV['DISABLE_BITCODE'].upcase == 'YES' || ENV['DISABLE_BITCODE'].upcase == 'TRUE')
50
65
  "ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-Qunused-arguments\'"
51
66
  else
52
67
  "ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
@@ -92,12 +107,20 @@ module Pod
92
107
  return ios_architectures_t
93
108
  end
94
109
  end
110
+
95
111
  alias copy_headers_t copy_headers
96
112
  def copy_headers
113
+ copy_headers_to_target @fwk.headers_path
114
+ end
115
+
116
+ def copy_headers_to_target(headers_target_path = nil ,module_map_target_path = nil )
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
+
97
120
  headers_source_root = "#{@public_headers_root}/#{@spec.name}"
98
121
 
99
122
  Dir.glob("#{headers_source_root}/**/*.h").
100
- each { |h| `ditto #{h} #{@fwk.headers_path}/#{h.sub(headers_source_root, '')}` }
123
+ each { |h| `ditto #{h} #{headers_target_path}/#{h.sub(headers_source_root, '')}` }
101
124
 
102
125
  # If custom 'module_map' is specified add it to the framework distribution
103
126
  # otherwise check if a header exists that is equal to 'spec.name', if so
@@ -116,10 +139,10 @@ framework module #{@spec.name} {
116
139
  MAP
117
140
  else
118
141
 
119
- f = File.new(File.join("#{@fwk.headers_path}","#{@spec.name}.h"), "w+")
142
+ f = File.new(File.join("#{headers_target_path}","#{@spec.name}.h"), "w+")
120
143
  f.puts("#import <UIKit/UIKit.h>")
121
144
  f.puts("#import <Foundation/Foundation.h>")
122
- Dir.foreach(@fwk.headers_path) do |filename|
145
+ Dir.foreach(headers_target_path) do |filename|
123
146
  if filename != "." and filename != ".."
124
147
  f.puts("#import \"#{filename}\"")
125
148
  end
@@ -137,13 +160,17 @@ MAP
137
160
  end
138
161
 
139
162
  unless module_map.nil?
140
- @fwk.module_map_path.mkpath unless @fwk.module_map_path.exist?
141
- File.write("#{@fwk.module_map_path}/module.modulemap", module_map)
163
+ module_map_target_path.mkpath unless module_map_target_path.exist?
164
+ File.write("#{module_map_target_path}/module.modulemap", module_map)
142
165
  end
143
166
  end
144
167
 
145
168
  alias copy_resources_t copy_resources
146
169
  def copy_resources
170
+ copy_resources_to_target @fwk.resources_path unless @dynamic
171
+ end
172
+ def copy_resources_to_target(resources_target_path = nil )
173
+ resources_target_path = @fwk.resources_path if resources_target_path.nil?
147
174
  if @exclude_deps
148
175
  bundles = @static_installer.pod_targets.flat_map(&:file_accessors).flat_map{|item|item.resources}
149
176
  else
@@ -154,14 +181,23 @@ MAP
154
181
  bundles.tap{|path| FileUtils.cp_r path,resources_path}
155
182
  `cp -rp #{@static_sandbox_root}/build/*.bundle #{resources_path} 2>&1`
156
183
  else
157
- `cp -rp #{@static_sandbox_root}/build/*.bundle #{@fwk.resources_path} 2>&1`
184
+ `cp -rp #{@static_sandbox_root}/build/*.bundle #{resources_path} 2>&1`
158
185
  resources = expand_paths(@spec.consumer(@platform).resources)
159
186
  if resources.count == 0 && bundles.count == 0
160
- @fwk.delete_resources
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
161
194
  return
162
195
  end
163
196
  if resources.count > 0
164
- `cp -rp #{resources.join(' ')} #{@fwk.resources_path}`
197
+ `cp -rp #{resources.join(' ')} #{resources_target_path}`
198
+ end
199
+ if bundles.count > 0
200
+ `cp -rp #{bundles.join(' ')} #{resources_target_path}`
165
201
  end
166
202
  end
167
203
  end
@@ -45,7 +45,7 @@ module Pod
45
45
  config.build_settings['USER_HEADER_SEARCH_PATHS'] = "$(inherited) #{header_path}"
46
46
  config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -ObjC'
47
47
 
48
- if ENV['DISABLE_BITCODE']
48
+ if ENV['DISABLE_BITCODE'] && (ENV['DISABLE_BITCODE'].upcase == 'YES' || ENV['DISABLE_BITCODE'].upcase == 'TRUE')
49
49
  config.build_settings['ENABLE_BITCODE'] = 'NO'
50
50
  end
51
51
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsPackagerExt
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.27"
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.22
4
+ version: 0.0.27
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-05-14 00:00:00.000000000 Z
11
+ date: 2021-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler