cocoapods-packager-ext 0.0.21 → 0.0.26
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 +4 -4
- data/cocoapods-packager-ext.gemspec +1 -1
- data/lib/cocoapods-packager-ext/command/package_ext.rb +56 -10
- data/lib/cocoapods-packager-ext/ext/builder.rb +183 -71
- data/lib/cocoapods-packager-ext/ext/pod_utils.rb +57 -0
- data/lib/cocoapods-packager-ext/gem_version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23cd72018e39de209dccf062d026da054ae4019c38b0fb57ca0a7437efd4b565
|
4
|
+
data.tar.gz: ed3fc72518c0d7163c9ed6a19d760c28d76968890bd7047611807f9852e41ade
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9a31f722da895eb96d120a86f408b5e2ae97e4a48da9fdc41ed1e88335e1a655e5156d8fc2721e5f3d6a4cc3c3784c7dd9d488e44c248e1d19f8f5259629e37
|
7
|
+
data.tar.gz: b8f915b856efeed8eeff81368bfe086323083469f05f6d73bbf85f9a225b5a9932d57c406ed32647a3151cb6f3374c4751a4071b5bc9215c00baa0ba882ba81a
|
@@ -20,6 +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_runtime_dependency(%q<cocoapods-packager>.freeze,["1.5.1"])
|
23
|
+
spec.add_runtime_dependency(%q<cocoapods-packager>.freeze,["1.5.1.alpha.0"])
|
24
24
|
|
25
25
|
end
|
@@ -1,5 +1,7 @@
|
|
1
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
|
@@ -26,9 +28,7 @@ module Pod
|
|
26
28
|
alias options_t options
|
27
29
|
def options
|
28
30
|
o = options_t
|
29
|
-
o.push(['--all-deps','embedded all-depends'])
|
30
31
|
o.push(['--archs','select archs'])
|
31
|
-
o.push(['--black-deps','select exclude deps'])
|
32
32
|
o.push(['--podfile','select deps version from podfile'])
|
33
33
|
o.push(['--platform','select platform'])
|
34
34
|
o.concat(super)
|
@@ -42,14 +42,57 @@ module Pod
|
|
42
42
|
|
43
43
|
alias initialize_t initialize
|
44
44
|
def initialize(argv)
|
45
|
-
@
|
45
|
+
@exclude_dep_items = argv.option('exclude-deps','').split(',')
|
46
46
|
@select_archs = argv.option('archs','').split(',')
|
47
|
-
@black_deps = argv.option('black-deps','').split(',')
|
48
47
|
@podfile = argv.option('podfile','')
|
49
48
|
@platform = argv.option('platform','')
|
50
49
|
initialize_t argv
|
51
50
|
end
|
52
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 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
|
+
end
|
73
|
+
end
|
74
|
+
end
|
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
|
+
|
53
96
|
alias build_package_t build_package
|
54
97
|
def build_package
|
55
98
|
if @platform == ''
|
@@ -62,7 +105,13 @@ module Pod
|
|
62
105
|
if @platform.include?(platform.name.to_s)
|
63
106
|
UI.puts 'build package platform:'+platform.name.to_s
|
64
107
|
build_in_sandbox(platform)
|
65
|
-
|
108
|
+
if @library
|
109
|
+
newspec += spec_library(platform)
|
110
|
+
else
|
111
|
+
newspec += builder.spec_platform(platform)
|
112
|
+
end
|
113
|
+
|
114
|
+
|
66
115
|
else
|
67
116
|
UI.puts 'jump build platforms:'+platform.to_s
|
68
117
|
end
|
@@ -72,13 +121,11 @@ module Pod
|
|
72
121
|
File.open(@spec.name + '.podspec', 'w') { |file| file.write(newspec) }
|
73
122
|
end
|
74
123
|
|
75
|
-
|
76
|
-
|
77
124
|
end
|
78
125
|
|
79
126
|
alias perform_build_t perform_build
|
80
127
|
def perform_build(platform, static_sandbox, dynamic_sandbox,static_installer)
|
81
|
-
if @
|
128
|
+
if @select_archs.length > 0 || @exclude_dep_items.length > 0
|
82
129
|
static_sandbox_root = config.sandbox_root.to_s
|
83
130
|
|
84
131
|
if @dynamic
|
@@ -100,8 +147,7 @@ module Pod
|
|
100
147
|
@config,
|
101
148
|
@bundle_identifier,
|
102
149
|
@exclude_deps,
|
103
|
-
@
|
104
|
-
@black_deps,
|
150
|
+
@exclude_dep_items,
|
105
151
|
@select_archs
|
106
152
|
)
|
107
153
|
|
@@ -2,81 +2,103 @@ require "fileutils"
|
|
2
2
|
|
3
3
|
module Pod
|
4
4
|
class Builder
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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
51
|
|
51
|
-
alias
|
52
|
-
def
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
UI.puts "links statics:#{static_libs.join(' ')}, sim_libs:#{sim_libs.join(' ')}"
|
66
|
-
`xcrun -r libtool -no_warning_for_no_symbols -static -o #{output} #{static_libs.join(' ')} #{sim_libs.join(' ')}`
|
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' }
|
61
|
+
end
|
62
|
+
|
63
|
+
def ios_build_options
|
64
|
+
if ENV['DISABLE_BITCODE'] && (ENV['DISABLE_BITCODE'].upcase == 'YES' || ENV['DISABLE_BITCODE'].upcase == 'TRUE')
|
65
|
+
"ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-Qunused-arguments\'"
|
67
66
|
else
|
68
|
-
|
67
|
+
"ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
|
69
68
|
end
|
70
69
|
end
|
71
70
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
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
|
+
|
80
102
|
alias ios_architectures_t ios_architectures
|
81
103
|
def ios_architectures
|
82
104
|
if @select_archs.size != 0
|
@@ -86,6 +108,100 @@ module Pod
|
|
86
108
|
end
|
87
109
|
end
|
88
110
|
|
111
|
+
alias copy_headers_t copy_headers
|
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
|
+
|
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}\"")
|
148
|
+
end
|
149
|
+
end
|
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 = nil )
|
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`
|
183
|
+
else
|
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
|
199
|
+
if bundles.count > 0
|
200
|
+
`cp -rp #{bundles.join(' ')} #{resources_target_path}`
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
89
205
|
alias build_sim_libraries_t build_sim_libraries
|
90
206
|
def build_sim_libraries(defines)
|
91
207
|
if @select_archs.size != 0 && !@select_archs.include?('i386') && !@select_archs.include?('x86_64')
|
@@ -97,13 +213,9 @@ module Pod
|
|
97
213
|
end
|
98
214
|
|
99
215
|
alias initialize_t initialize
|
100
|
-
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,
|
101
|
-
@
|
102
|
-
@black_deps = black_deps
|
216
|
+
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=[])
|
217
|
+
@exclude_dep_items = exclude_dep_items
|
103
218
|
@select_archs = select_archs
|
104
|
-
@target_type_ext = ['.a','.bundle']
|
105
|
-
@target_dir_ext_ext = "#{static_sandbox_root}/build"
|
106
|
-
@black_list_ext = ["#{static_sandbox_root}/build","#{static_sandbox_root}/build-sim"]
|
107
219
|
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)
|
108
220
|
end
|
109
221
|
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'] && (ENV['DISABLE_BITCODE'].upcase == 'YES' || ENV['DISABLE_BITCODE'].upcase == 'TRUE')
|
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
|
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.
|
4
|
+
version: 0.0.26
|
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-
|
11
|
+
date: 2021-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.5.1
|
47
|
+
version: 1.5.1.alpha.0
|
48
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: 1.5.1
|
54
|
+
version: 1.5.1.alpha.0
|
55
55
|
description: A short description of cocoapods-packager-ext.
|
56
56
|
email:
|
57
57
|
- kyle.zhou@qq.com
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- lib/cocoapods-packager-ext/ext/builder.rb
|
73
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
|