cocoapods-imy-bin 0.2.6 → 0.3.0.11
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/README.md +0 -540
- data/lib/cocoapods-imy-bin/command/bin/archive.rb +43 -4
- data/lib/cocoapods-imy-bin/command/bin/auto.rb +9 -7
- data/lib/cocoapods-imy-bin/command/bin/code.rb +1 -6
- data/lib/cocoapods-imy-bin/command/bin/local.rb +16 -7
- data/lib/cocoapods-imy-bin/config/config.rb +1 -1
- data/lib/cocoapods-imy-bin/config/config_builder.rb +39 -2
- data/lib/cocoapods-imy-bin/gem_version.rb +1 -1
- data/lib/cocoapods-imy-bin/helpers.rb +1 -0
- data/lib/cocoapods-imy-bin/helpers/Info.plist +0 -0
- data/lib/cocoapods-imy-bin/helpers/build_helper.rb +15 -7
- data/lib/cocoapods-imy-bin/helpers/build_utils.rb +63 -0
- data/lib/cocoapods-imy-bin/helpers/framework.rb +25 -2
- data/lib/cocoapods-imy-bin/helpers/framework_builder.rb +172 -57
- data/lib/cocoapods-imy-bin/helpers/library.rb +2 -2
- data/lib/cocoapods-imy-bin/helpers/local/local_build_helper.rb +38 -6
- data/lib/cocoapods-imy-bin/helpers/local/local_framework.rb +20 -0
- data/lib/cocoapods-imy-bin/helpers/local/local_framework_builder.rb +91 -38
- data/lib/cocoapods-imy-bin/helpers/sources_helper.rb +5 -2
- data/lib/cocoapods-imy-bin/helpers/spec_source_creator.rb +65 -8
- data/lib/cocoapods-imy-bin/helpers/upload_helper.rb +8 -3
- data/lib/cocoapods-imy-bin/native.rb +4 -0
- data/lib/cocoapods-imy-bin/native/analyzer.rb +2 -0
- data/lib/cocoapods-imy-bin/native/file_accessor.rb +28 -0
- data/lib/cocoapods-imy-bin/native/pod_target_installer.rb +94 -0
- data/lib/cocoapods-imy-bin/native/podfile_generator.rb +11 -2
- data/lib/cocoapods-imy-bin/native/target_validator.rb +41 -0
- data/lib/cocoapods-imy-bin/native/validator.rb +1 -38
- metadata +7 -2
@@ -12,31 +12,55 @@ module CBin
|
|
12
12
|
class Builder
|
13
13
|
include Pod
|
14
14
|
#Debug下还待完成
|
15
|
-
def initialize(spec, file_accessor, platform, local_build_dir_name, local_build_dir)
|
15
|
+
def initialize(spec, file_accessor, platform, local_build_dir_name, local_build_dir, is_library = true, framework_BuildProductsPath = "")
|
16
16
|
@spec = spec
|
17
17
|
@file_accessor = file_accessor
|
18
18
|
@platform = platform
|
19
19
|
@local_build_dir_name = local_build_dir_name
|
20
20
|
@local_build_dir = local_build_dir
|
21
|
+
@is_library = is_library
|
22
|
+
@framework_BuildProductsPath = framework_BuildProductsPath
|
21
23
|
end
|
22
24
|
|
23
25
|
def create
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
begin
|
27
|
+
#如果是.a 文件, 或者 swift下,是.a文件的
|
28
|
+
if @is_library || (!@is_library && @framework_BuildProductsPath != framework_name)
|
29
|
+
|
30
|
+
UI.section("Building static library #{@spec}") do
|
31
|
+
output = framework.versions_path + Pathname.new(@spec.name)
|
32
|
+
build_static_library_for_ios(output)
|
33
|
+
res = copy_headers
|
34
|
+
# maybe fails for copy_headers
|
35
|
+
if res
|
36
|
+
copy_resources
|
37
|
+
cp_to_source_dir
|
38
|
+
else
|
39
|
+
FileUtils.remove_dir(framework.fwk_path) if File.exist?(framework.fwk_path)
|
40
|
+
return nil
|
41
|
+
end
|
42
|
+
end
|
28
43
|
|
29
|
-
|
30
|
-
|
44
|
+
else
|
45
|
+
UI.section("Building static framework #{@spec}") do
|
46
|
+
output = File.join(CBin::Config::Builder.instance.zip_dir,"#{@spec.name}.framework")
|
47
|
+
build_static_framework_for_ios(output)
|
48
|
+
end
|
49
|
+
end
|
31
50
|
|
32
|
-
|
51
|
+
rescue StandardError
|
52
|
+
UI.warn "【#{spec.name} | #{spec.version}】组件二进制版本组装失败 ."
|
33
53
|
end
|
54
|
+
|
34
55
|
framework
|
35
56
|
end
|
36
57
|
|
37
58
|
private
|
38
59
|
|
39
60
|
def cp_to_source_dir
|
61
|
+
# 删除Versions 软链接
|
62
|
+
framework.remove_current_version if CBin::Build::Utils.is_swift_module(@spec)
|
63
|
+
|
40
64
|
target_dir = File.join(CBin::Config::Builder.instance.root_dir,CBin::Config::Builder.instance.framework_file(@spec))
|
41
65
|
FileUtils.rm_rf(target_dir) if File.exist?(target_dir)
|
42
66
|
|
@@ -46,58 +70,80 @@ module CBin
|
|
46
70
|
`cp -fa #{@platform}/#{CBin::Config::Builder.instance.framework_name(@spec)} #{target_dir}`
|
47
71
|
end
|
48
72
|
|
73
|
+
|
49
74
|
def copy_headers
|
50
75
|
#by slj 如果没有头文件,去 "Headers/Public"拿
|
51
76
|
# if public_headers.empty?
|
52
77
|
Dir.chdir(File.join(Pod::Config.instance.installation_root,'Pods')) do
|
53
78
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
headers = Dir.glob('*.h')
|
58
|
-
headers.each do |h|
|
59
|
-
public_headers << Pathname.new(File.join(Dir.pwd,h))
|
60
|
-
end
|
61
|
-
end
|
79
|
+
if File.exist?("./Headers/Public/#{@spec.name}")
|
80
|
+
#走 podsepc中的public_headers
|
81
|
+
public_headers = Array.new
|
62
82
|
|
63
|
-
|
83
|
+
Dir.chdir("./Headers/Public/#{@spec.name}") do
|
84
|
+
headers = Dir.glob('*.h')
|
85
|
+
headers.each do |h|
|
86
|
+
public_headers << Pathname.new(File.join(Dir.pwd,h))
|
87
|
+
end
|
88
|
+
end
|
64
89
|
|
65
|
-
|
66
|
-
`ditto #{h} #{framework.headers_path}/#{h.basename}`
|
67
|
-
end
|
90
|
+
UI.message "Copying public headers #{public_headers.map(&:basename).map(&:to_s)}"
|
68
91
|
|
69
|
-
|
70
|
-
|
71
|
-
# create a default 'module_map' one using it.
|
72
|
-
if !@spec.module_map.nil?
|
73
|
-
module_map_file = @file_accessor.module_map
|
74
|
-
if Pathname(module_map_file).exist?
|
75
|
-
module_map = File.read(module_map_file)
|
92
|
+
public_headers.each do |h|
|
93
|
+
`ditto #{h} #{framework.headers_path}/#{h.basename}`
|
76
94
|
end
|
77
|
-
|
78
|
-
module_map
|
95
|
+
|
96
|
+
# If custom 'module_map' is specified add it to the framework distribution
|
97
|
+
# otherwise check if a header exists that is equal to 'spec.name', if so
|
98
|
+
# create a default 'module_map' one using it.
|
99
|
+
if !@spec.module_map.nil?
|
100
|
+
module_map_file = @file_accessor.module_map
|
101
|
+
if Pathname(module_map_file).exist?
|
102
|
+
module_map = File.read(module_map_file)
|
103
|
+
end
|
104
|
+
elsif public_headers.map(&:basename).map(&:to_s).include?("#{@spec.name}-umbrella.h")
|
105
|
+
module_map = <<-MAP
|
79
106
|
framework module #{@spec.name} {
|
80
|
-
umbrella header "#{@spec.name}.h"
|
107
|
+
umbrella header "#{@spec.name}-umbrella.h"
|
81
108
|
|
82
109
|
export *
|
83
110
|
module * { export * }
|
84
111
|
}
|
85
|
-
|
86
|
-
|
112
|
+
MAP
|
113
|
+
end
|
87
114
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
115
|
+
unless module_map.nil?
|
116
|
+
UI.message "Writing module map #{module_map}"
|
117
|
+
unless framework.module_map_path.exist?
|
118
|
+
framework.module_map_path.mkpath
|
119
|
+
end
|
120
|
+
File.write("#{framework.module_map_path}/module.modulemap", module_map)
|
121
|
+
|
122
|
+
# unless framework.swift_module_path.exist?
|
123
|
+
# framework.swift_module_path.mkpath
|
124
|
+
# end
|
125
|
+
# DO BuildProductsPath swiftModule拷贝到 framework.swift_module_path
|
126
|
+
swiftmodule_path = File.join(@framework_BuildProductsPath, "#{@spec.name}.swiftmodule")
|
127
|
+
if File.directory?(swiftmodule_path)
|
128
|
+
FileUtils.cp_r("#{swiftmodule_path}/.", framework.swift_module_path)
|
129
|
+
end
|
130
|
+
swift_Compatibility_Header = "#{@framework_BuildProductsPath}/Swift\ Compatibility\ Header/#{@spec.name}-Swift.h"
|
131
|
+
FileUtils.cp(swift_Compatibility_Header,framework.headers_path) if File.exist?(swift_Compatibility_Header)
|
132
|
+
info_plist_file = File.join(File.dirname(File.dirname(__FILE__)),"info.plist")
|
133
|
+
FileUtils.cp(info_plist_file,framework.fwk_path)
|
92
134
|
end
|
93
|
-
|
135
|
+
else
|
136
|
+
UI.warn "== Headers/Public/#{@spec.name} no exist"
|
137
|
+
return false
|
94
138
|
end
|
95
139
|
|
96
140
|
end
|
141
|
+
return true
|
97
142
|
end
|
98
143
|
|
99
144
|
def copy_resources
|
100
145
|
|
146
|
+
|
101
147
|
Dir.chdir(Pod::Config.instance.sandbox_root) do
|
102
148
|
|
103
149
|
bundles = Dir.glob('./build/*.bundle')
|
@@ -126,7 +172,7 @@ module CBin
|
|
126
172
|
expand_paths(real_source_dir, spec.consumer(@platform).resources)
|
127
173
|
end.compact.uniq
|
128
174
|
|
129
|
-
if resources.count == 0 && bundles.count == 0
|
175
|
+
if (resources.count == 0 || (resources.count == 1 && resources[0].count == 0)) && bundles.count == 0
|
130
176
|
framework.delete_resources
|
131
177
|
return
|
132
178
|
end
|
@@ -150,10 +196,17 @@ module CBin
|
|
150
196
|
`cp -rp #{library_name} #{output}`
|
151
197
|
end
|
152
198
|
|
199
|
+
def build_static_framework_for_ios(output)
|
200
|
+
FileUtils.cp_r(framework_name, output)
|
201
|
+
end
|
202
|
+
|
153
203
|
def library_name
|
154
204
|
File.join(@local_build_dir, "lib#{@spec.name}.a")
|
155
205
|
end
|
156
206
|
|
207
|
+
def framework_name
|
208
|
+
File.join(@local_build_dir, "#{@spec.name}.framework")
|
209
|
+
end
|
157
210
|
|
158
211
|
def expand_paths(source_dir, path_specs)
|
159
212
|
path_specs.map do |path_spec|
|
@@ -21,8 +21,11 @@ module CBin
|
|
21
21
|
# 只允许二进制的 specification subspec 比源码的 specification subspec 多
|
22
22
|
#
|
23
23
|
def valid_sources(code_dependencies = false)
|
24
|
-
sources = [
|
25
|
-
|
24
|
+
sources = [code_source]
|
25
|
+
unless code_dependencies
|
26
|
+
sources << binary_source
|
27
|
+
sources.reverse!
|
28
|
+
end
|
26
29
|
sources
|
27
30
|
end
|
28
31
|
|
@@ -20,12 +20,12 @@ module CBin
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def create
|
23
|
-
spec =
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
# spec = nil
|
24
|
+
if CBin::Build::Utils.is_framework(@code_spec)
|
25
|
+
spec = create_framework_from_code_spec
|
26
|
+
else
|
27
|
+
spec = create_from_code_spec
|
28
|
+
end
|
29
29
|
|
30
30
|
spec
|
31
31
|
end
|
@@ -121,12 +121,69 @@ module CBin
|
|
121
121
|
@spec.vendored_libraries = binary_vendored_libraries
|
122
122
|
@spec.resources = binary_resources if @spec.attributes_hash.keys.include?("resources")
|
123
123
|
@spec.description = <<-EOF
|
124
|
-
「 converted automatically by plugin cocoapods-imy-bin
|
124
|
+
「 converted automatically by plugin cocoapods-imy-bin @厦门美柚 - slj 」
|
125
|
+
#{@spec.description}
|
126
|
+
EOF
|
127
|
+
@spec
|
128
|
+
end
|
129
|
+
|
130
|
+
def create_framework_from_code_spec
|
131
|
+
@spec = code_spec.dup
|
132
|
+
# vendored_frameworks | resources | source | source_files | public_header_files
|
133
|
+
# license | resource_bundles | vendored_libraries
|
134
|
+
|
135
|
+
# Project Linkin
|
136
|
+
@spec.vendored_frameworks = "#{code_spec.root.name}.framework"
|
137
|
+
|
138
|
+
# Resources
|
139
|
+
extnames = []
|
140
|
+
extnames << '*.bundle' if code_spec_consumer.resource_bundles.any?
|
141
|
+
if code_spec_consumer.resources.any?
|
142
|
+
extnames += code_spec_consumer.resources.map { |r| File.basename(r) }
|
143
|
+
end
|
144
|
+
if extnames.any?
|
145
|
+
@spec.resources = framework_contents('Resources').flat_map { |r| extnames.map { |e| "#{r}/#{e}" } }
|
146
|
+
end
|
147
|
+
|
148
|
+
# Source Location
|
149
|
+
@spec.source = binary_source
|
150
|
+
|
151
|
+
# Source Code
|
152
|
+
# @spec.source_files = framework_contents('Headers/*')
|
153
|
+
# @spec.public_header_files = framework_contents('Headers/*')
|
154
|
+
|
155
|
+
# Unused for binary
|
156
|
+
spec_hash = @spec.to_hash
|
157
|
+
# spec_hash.delete('license')
|
158
|
+
spec_hash.delete('resource_bundles')
|
159
|
+
spec_hash.delete('exclude_files')
|
160
|
+
spec_hash.delete('preserve_paths')
|
161
|
+
# 这里不确定 vendored_libraries 指定的时动态/静态库
|
162
|
+
# 如果是静态库的话,需要移除,否则就不移除
|
163
|
+
# 最好是静态库都独立成 Pod ,cocoapods-package 打静态库去 collect 目标文件时好做过滤
|
164
|
+
# 这里统一只对命名后缀 .a 文件做处理
|
165
|
+
# spec_hash.delete('vendored_libraries')
|
166
|
+
# libraries 只能假设为动态库不做处理了,如果有例外,需要开发者自行处理
|
167
|
+
vendored_libraries = spec_hash.delete('vendored_libraries')
|
168
|
+
vendored_libraries = Array(vendored_libraries).reject { |l| l.end_with?('.a') }
|
169
|
+
if vendored_libraries.any?
|
170
|
+
spec_hash['vendored_libraries'] = vendored_libraries
|
171
|
+
end
|
172
|
+
|
173
|
+
# Filter platforms
|
174
|
+
platforms = spec_hash['platforms']
|
175
|
+
selected_platforms = platforms.select { |k, _v| @platforms.include?(k) }
|
176
|
+
spec_hash['platforms'] = selected_platforms.empty? ? platforms : selected_platforms
|
177
|
+
|
178
|
+
@spec = Pod::Specification.from_hash(spec_hash)
|
179
|
+
@spec.description = <<-EOF
|
180
|
+
「 converted automatically by plugin cocoapods-imy-bin @厦门美柚 - slj 」
|
125
181
|
#{@spec.description}
|
126
|
-
EOF
|
182
|
+
EOF
|
127
183
|
@spec
|
128
184
|
end
|
129
185
|
|
186
|
+
|
130
187
|
def binary_source
|
131
188
|
{ http: format(CBin.config.binary_download_url, code_spec.root.name, code_spec.version), type: CBin.config.download_file_type }
|
132
189
|
end
|
@@ -47,14 +47,19 @@ module CBin
|
|
47
47
|
def curl_zip
|
48
48
|
zip_file = "#{CBin::Config::Builder.instance.library_file(@spec)}.zip"
|
49
49
|
res = File.exist?(zip_file)
|
50
|
-
|
50
|
+
unless res
|
51
|
+
zip_file = CBin::Config::Builder.instance.framework_zip_file(@spec) + ".zip"
|
52
|
+
res = File.exist?(zip_file)
|
53
|
+
end
|
54
|
+
if res
|
55
|
+
print <<EOF
|
51
56
|
上传二进制文件
|
52
57
|
curl #{CBin.config.binary_upload_url} -F "name=#{@spec.name}" -F "version=#{@spec.version}" -F "annotate=#{@spec.name}_#{@spec.version}_log" -F "file=@#{zip_file}"
|
53
58
|
EOF
|
54
|
-
|
59
|
+
`curl #{CBin.config.binary_upload_url} -F "name=#{@spec.name}" -F "version=#{@spec.version}" -F "annotate=#{@spec.name}_#{@spec.version}_log" -F "file=@#{zip_file}"` if res
|
60
|
+
end
|
55
61
|
|
56
62
|
res
|
57
|
-
|
58
63
|
end
|
59
64
|
|
60
65
|
|
@@ -16,4 +16,8 @@ if Pod.match_version?('~> 1.4')
|
|
16
16
|
require 'cocoapods-imy-bin/native/acknowledgements'
|
17
17
|
require 'cocoapods-imy-bin/native/sandbox_analyzer'
|
18
18
|
require 'cocoapods-imy-bin/native/podspec_finder'
|
19
|
+
require 'cocoapods-imy-bin/native/file_accessor'
|
20
|
+
require 'cocoapods-imy-bin/native/pod_target_installer'
|
21
|
+
require 'cocoapods-imy-bin/native/target_validator'
|
22
|
+
|
19
23
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'macho'
|
2
|
+
require 'cocoapods'
|
3
|
+
|
4
|
+
module Pod
|
5
|
+
class Sandbox
|
6
|
+
class FileAccessor
|
7
|
+
|
8
|
+
# swift动态库 需要设置为true
|
9
|
+
def dynamic_binary?(binary)
|
10
|
+
@cached_dynamic_binary_results ||= {}
|
11
|
+
return @cached_dynamic_binary_results[binary] unless @cached_dynamic_binary_results[binary].nil?
|
12
|
+
return false unless binary.file?
|
13
|
+
|
14
|
+
@cached_dynamic_binary_results[binary] = MachO.open(binary).dylib?
|
15
|
+
rescue MachO::MachOError
|
16
|
+
@cached_dynamic_binary_results[binary] = true
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
# def expanded_paths(patterns, options = {})
|
21
|
+
# return [] if patterns.empty?
|
22
|
+
# path_list.glob(patterns, options).flatten.compact.uniq
|
23
|
+
# end
|
24
|
+
|
25
|
+
#-----------------------------------------------------------------------#
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
module Pod
|
2
|
+
class Installer
|
3
|
+
class Xcode
|
4
|
+
class PodsProjectGenerator
|
5
|
+
# Creates the target for the Pods libraries in the Pods project and the
|
6
|
+
# relative support files.
|
7
|
+
#
|
8
|
+
class PodTargetInstaller < TargetInstaller
|
9
|
+
require 'cocoapods/installer/xcode/pods_project_generator/app_host_installer'
|
10
|
+
|
11
|
+
# Adds a shell script phase, intended only for library targets that contain swift,
|
12
|
+
# to copy the ObjC compatibility header (the -Swift.h file that the swift compiler generates)
|
13
|
+
# to the built products directory. Additionally, the script phase copies the module map, appending a `.Swift`
|
14
|
+
# submodule that references the (moved) compatibility header. Since the module map has been moved, the umbrella header
|
15
|
+
# is _also_ copied, so that it is sitting next to the module map. This is necessary for a successful archive build.
|
16
|
+
#
|
17
|
+
# @param [PBXNativeTarget] native_target
|
18
|
+
# the native target to add the Swift static library script phase into.
|
19
|
+
#
|
20
|
+
# @return [Void]
|
21
|
+
#
|
22
|
+
alias old_add_swift_library_compatibility_header_phase add_swift_library_compatibility_header_phase
|
23
|
+
|
24
|
+
def add_swift_library_compatibility_header_phase(native_target)
|
25
|
+
UI.warn("========= swift add_swift_library_compatibility_header_phase")
|
26
|
+
if $ARGV[1] == "auto"
|
27
|
+
UI.warn("========= auto swift add_swift_library_compatibility_header_phase")
|
28
|
+
|
29
|
+
if custom_module_map
|
30
|
+
raise Informative, 'Using Swift static libraries with custom module maps is currently not supported. ' \
|
31
|
+
"Please build `#{target.label}` as a framework or remove the custom module map."
|
32
|
+
end
|
33
|
+
|
34
|
+
build_phase = native_target.new_shell_script_build_phase('Copy generated compatibility header')
|
35
|
+
|
36
|
+
relative_module_map_path = target.module_map_path.relative_path_from(target.sandbox.root)
|
37
|
+
relative_umbrella_header_path = target.umbrella_header_path.relative_path_from(target.sandbox.root)
|
38
|
+
|
39
|
+
build_phase.shell_script = <<-SH.strip_heredoc
|
40
|
+
COMPATIBILITY_HEADER_PATH="${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h"
|
41
|
+
MODULE_MAP_PATH="${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap"
|
42
|
+
|
43
|
+
ditto "${DERIVED_SOURCES_DIR}/${PRODUCT_MODULE_NAME}-Swift.h" "${COMPATIBILITY_HEADER_PATH}"
|
44
|
+
ditto "${PODS_ROOT}/#{relative_module_map_path}" "${MODULE_MAP_PATH}"
|
45
|
+
ditto "${PODS_ROOT}/#{relative_umbrella_header_path}" "${BUILT_PRODUCTS_DIR}"
|
46
|
+
|
47
|
+
COPY_PATH="${PODS_CONFIGURATION_BUILD_DIR}/${PRODUCT_MODULE_NAME}"
|
48
|
+
UMBRELLA_PATH="${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}-umbrella.h"
|
49
|
+
SWIFTMODULE_PATH="${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.swiftmodule"
|
50
|
+
|
51
|
+
ditto "${MODULE_MAP_PATH}" "${PODS_CONFIGURATION_BUILD_DIR}/${PRODUCT_MODULE_NAME}/${PRODUCT_MODULE_NAME}.modulemap"
|
52
|
+
ditto "${COMPATIBILITY_HEADER_PATH}" "${COPY_PATH}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h"
|
53
|
+
ditto "${COMPATIBILITY_HEADER_PATH}" "${COPY_PATH}"
|
54
|
+
ditto "${UMBRELLA_PATH}" "${COPY_PATH}"
|
55
|
+
ditto "${SWIFTMODULE_PATH}" "${COPY_PATH}/${PRODUCT_MODULE_NAME}.swiftmodule"
|
56
|
+
ditto "${SWIFTMODULE_PATH}" "${COPY_PATH}/${PRODUCT_MODULE_NAME}.swiftmodule"
|
57
|
+
|
58
|
+
if [ ${PRODUCT_MODULE_NAME} != ${PRODUCT_NAME} ] ; then
|
59
|
+
ditto "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}-umbrella.h" "${COPY_PATH}"
|
60
|
+
ditto "${COPY_PATH}" "${PODS_CONFIGURATION_BUILD_DIR}/${PRODUCT_NAME}"
|
61
|
+
fi
|
62
|
+
|
63
|
+
MODULE_MAP_SEARCH_PATH = "${PODS_CONFIGURATION_BUILD_DIR}/${PRODUCT_MODULE_NAME}/${PRODUCT_MODULE_NAME}.modulemap"
|
64
|
+
|
65
|
+
if [${MODULE_MAP_PATH} != ${MODULE_MAP_SEARCH_PATH}] ; then
|
66
|
+
printf "\\n\\nmodule ${PRODUCT_MODULE_NAME}.Swift {\\n header \\"${COPY_PATH}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h\\"\\n requires objc\\n}\\n" >> "${MODULE_MAP_SEARCH_PATH}"
|
67
|
+
fi
|
68
|
+
|
69
|
+
printf "\\n\\nmodule ${PRODUCT_MODULE_NAME}.Swift {\\n header \\"${COMPATIBILITY_HEADER_PATH}\\"\\n requires objc\\n}\\n" >> "${MODULE_MAP_PATH}"
|
70
|
+
|
71
|
+
SH
|
72
|
+
build_phase.input_paths = %W(
|
73
|
+
${DERIVED_SOURCES_DIR}/${PRODUCT_MODULE_NAME}-Swift.h
|
74
|
+
${PODS_ROOT}/#{relative_module_map_path}
|
75
|
+
${PODS_ROOT}/#{relative_umbrella_header_path}
|
76
|
+
)
|
77
|
+
build_phase.output_paths = %W(
|
78
|
+
${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap
|
79
|
+
${BUILT_PRODUCTS_DIR}/#{relative_umbrella_header_path.basename}
|
80
|
+
${BUILT_PRODUCTS_DIR}/Swift\ Compatibility\ Header/${PRODUCT_MODULE_NAME}-Swift.h
|
81
|
+
)
|
82
|
+
else
|
83
|
+
UI.warn("========= null swift add_swift_library_compatibility_header_phase")
|
84
|
+
old_add_swift_library_compatibility_header_phase(native_target)
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
#-----------------------------------------------------------------------#
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|