cocoapods-fy-bin 0.1.4 → 0.1.7
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/lib/cocoapods-fy-bin/command/bin/archive.rb +3 -0
- data/lib/cocoapods-fy-bin/command/bin/auto.rb +5 -0
- data/lib/cocoapods-fy-bin/gem_version.rb +1 -1
- data/lib/cocoapods-fy-bin/helpers/build_helper.rb +3 -1
- data/lib/cocoapods-fy-bin/helpers/framework_builder.rb +29 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13aea44a3df6b1152903861c988a0948530492998ca3a42dbc7d550738113e55
|
4
|
+
data.tar.gz: a4413ae28980ddb2514f123b4ea67c0e31e4a4d7cb4abe8015cc3c2de4de67ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 295bd244987a22fd3a533e7a00e2decfac0d0109d3bf30ccf96dedebf094b90092075b701aa1a8ee4fca282deb90382fd588073196ca6fd31f610b71365264b5
|
7
|
+
data.tar.gz: 726e293169a845811539fd8132d598c73b57fb3b843d592ff8af008cc80090bcabfb217e2897329e3f8bf7116ef1e7ea839937b624390a80007a6c39360c0779
|
@@ -33,6 +33,7 @@ module Pod
|
|
33
33
|
['--env', "该组件上传的环境 %w[debug release]"],
|
34
34
|
['--archs', "需要二进制组件的架构"],
|
35
35
|
['--pre_build_shell', "xcodebuild前的脚本命令"],
|
36
|
+
['--suf_build_shell', "xcodebuild后的脚本命令"],
|
36
37
|
['--toolchain', "设置toolchain"]
|
37
38
|
].concat(Pod::Command::Gen.options).concat(super).uniq
|
38
39
|
end
|
@@ -57,6 +58,7 @@ module Pod
|
|
57
58
|
@platform = Platform.new(:ios)
|
58
59
|
@archs = argv.option('archs', 'armv7,arm64')
|
59
60
|
@pre_build_shell = argv.option('pre_build_shell') || ''
|
61
|
+
@suf_build_shell = argv.option('suf_build_shell') || ''
|
60
62
|
@toolchain = argv.option('toolchain') || ''
|
61
63
|
@config = argv.option('configuration', 'Release')
|
62
64
|
|
@@ -93,6 +95,7 @@ module Pod
|
|
93
95
|
@spec,
|
94
96
|
@archs,
|
95
97
|
@pre_build_shell,
|
98
|
+
@suf_build_shell,
|
96
99
|
@toolchain,
|
97
100
|
CBin::Config::Builder.instance.white_pod_list.include?(@spec.name),
|
98
101
|
@config)
|
@@ -23,6 +23,7 @@ module Pod
|
|
23
23
|
['--env', "该组件上传的环境 %w[debug release]"],
|
24
24
|
['--archs', "需要二进制组件的架构"],
|
25
25
|
['--pre_build_shell', "xcodebuild前的脚本命令"],
|
26
|
+
['--suf_build_shell', "xcodebuild后的脚本命令"],
|
26
27
|
['--toolchain', "设置toolchain"]
|
27
28
|
].concat(Pod::Command::Gen.options).concat(super).uniq
|
28
29
|
end
|
@@ -42,6 +43,7 @@ module Pod
|
|
42
43
|
@verbose = argv.flag?('verbose', true)
|
43
44
|
@archs = argv.flag?('archs', 'arm64')
|
44
45
|
@pre_build_shell = argv.option('pre_build_shell') || ''
|
46
|
+
@suf_build_shell = argv.option('suf_build_shell') || ''
|
45
47
|
@toolchain = argv.option('toolchain') || ''
|
46
48
|
@config = argv.option('configuration', 'Debug')
|
47
49
|
@additional_args = argv.remainder!
|
@@ -133,6 +135,9 @@ module Pod
|
|
133
135
|
if @pre_build_shell
|
134
136
|
argvs += ["--pre_build_shell=#{@pre_build_shell}"]
|
135
137
|
end
|
138
|
+
if @suf_build_shell
|
139
|
+
argvs += ["--suf_build_shell=#{@suf_build_shell}"]
|
140
|
+
end
|
136
141
|
if @toolchain
|
137
142
|
argvs += ["--toolchain=#{@toolchain}"]
|
138
143
|
end
|
@@ -21,6 +21,7 @@ module CBin
|
|
21
21
|
rootSpec,
|
22
22
|
archs,
|
23
23
|
pre_build_shell,
|
24
|
+
suf_build_shell,
|
24
25
|
toolchain,
|
25
26
|
skip_archive = false,
|
26
27
|
build_model="Release")
|
@@ -31,6 +32,7 @@ module CBin
|
|
31
32
|
@isRootSpec = rootSpec.name == spec.name
|
32
33
|
@archs = archs
|
33
34
|
@pre_build_shell = pre_build_shell
|
35
|
+
@suf_build_shell = suf_build_shell
|
34
36
|
@toolchain = toolchain
|
35
37
|
@skip_archive = skip_archive
|
36
38
|
@framework_output = framework_output
|
@@ -60,7 +62,7 @@ module CBin
|
|
60
62
|
source_dir = Dir.pwd
|
61
63
|
file_accessor = Sandbox::FileAccessor.new(Pathname.new('.').expand_path, @spec.consumer(@platform))
|
62
64
|
Dir.chdir(workspace_directory) do
|
63
|
-
builder = CBin::Framework::Builder.new(@spec, file_accessor, @platform, source_dir, @archs, @pre_build_shell, @toolchain, @isRootSpec, @build_model)
|
65
|
+
builder = CBin::Framework::Builder.new(@spec, file_accessor, @platform, source_dir, @archs, @pre_build_shell, @suf_build_shell, @toolchain, @isRootSpec, @build_model)
|
64
66
|
@@build_defines = builder.build if @isRootSpec
|
65
67
|
begin
|
66
68
|
@framework_path = builder.lipo_build(@@build_defines) unless @skip_archive
|
@@ -10,7 +10,7 @@ module CBin
|
|
10
10
|
class Builder
|
11
11
|
include Pod
|
12
12
|
#Debug下还待完成
|
13
|
-
def initialize(spec, file_accessor, platform, source_dir, archs, pre_build_shell, toolchain, isRootSpec = true, build_model="Debug")
|
13
|
+
def initialize(spec, file_accessor, platform, source_dir, archs, pre_build_shell, suf_build_shell, toolchain, isRootSpec = true, build_model="Debug")
|
14
14
|
@spec = spec
|
15
15
|
@source_dir = source_dir
|
16
16
|
@file_accessor = file_accessor
|
@@ -19,6 +19,7 @@ module CBin
|
|
19
19
|
@isRootSpec = isRootSpec
|
20
20
|
@archs = archs
|
21
21
|
@pre_build_shell = pre_build_shell
|
22
|
+
@suf_build_shell = suf_build_shell
|
22
23
|
@toolchain = toolchain
|
23
24
|
#vendored_static_frameworks 只有 xx.framework 需要拼接为 xx.framework/xx by slj
|
24
25
|
vendored_static_frameworks = file_accessor.vendored_static_frameworks.map do |framework|
|
@@ -80,7 +81,7 @@ module CBin
|
|
80
81
|
archs.map do |arch|
|
81
82
|
xcodebuild(defines, "-sdk iphonesimulator ARCHS=\'#{arch}\' ", "build-#{arch}",@build_model)
|
82
83
|
end
|
83
|
-
|
84
|
+
suf_build_command
|
84
85
|
end
|
85
86
|
|
86
87
|
|
@@ -169,12 +170,13 @@ module CBin
|
|
169
170
|
end
|
170
171
|
|
171
172
|
def compile
|
172
|
-
defines = "
|
173
|
-
defines += " SWIFT_ACTIVE_COMPILATION_CONDITIONS='$(inherited)' "
|
174
|
-
defines += @spec.consumer(@platform).compiler_flags.join(' ')
|
173
|
+
defines = ""
|
175
174
|
unless @toolchain.empty? then
|
176
175
|
defines += "-toolchain \"#{@toolchain}\""
|
177
176
|
end
|
177
|
+
defines += "GCC_PREPROCESSOR_DEFINITIONS='$(inherited)'"
|
178
|
+
defines += " SWIFT_ACTIVE_COMPILATION_CONDITIONS='$(inherited)' "
|
179
|
+
defines += @spec.consumer(@platform).compiler_flags.join(' ')
|
178
180
|
options = ios_build_options
|
179
181
|
# if is_debug_model
|
180
182
|
archs = ios_architectures
|
@@ -184,6 +186,7 @@ module CBin
|
|
184
186
|
# -fembed-bitcode支持bitcode BUILD_LIBRARY_FOR_DISTRIBUTION=YES 构建向后兼容的framework
|
185
187
|
xcodebuild(defines, "ARCHS=\'#{arch}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\' DEBUG_INFORMATION_FORMAT=\'dwarf-with-dsym\' BUILD_LIBRARY_FOR_DISTRIBUTION=YES","build-#{arch}",@build_model)
|
186
188
|
end
|
189
|
+
suf_build_command
|
187
190
|
# else
|
188
191
|
# xcodebuild(defines,options)
|
189
192
|
# end
|
@@ -225,6 +228,26 @@ module CBin
|
|
225
228
|
end
|
226
229
|
end
|
227
230
|
|
231
|
+
# 编译后需执行的的shell脚本
|
232
|
+
def suf_build_command
|
233
|
+
unless @suf_build_shell.empty? then
|
234
|
+
command = "sh #{@suf_build_shell}"
|
235
|
+
puts command
|
236
|
+
UI.message "command = #{command}"
|
237
|
+
output = `#{command}`.lines.to_a
|
238
|
+
|
239
|
+
if $CHILD_STATUS.exitstatus != 0
|
240
|
+
raise <<~EOF
|
241
|
+
Shell command failed: #{command}
|
242
|
+
Output:
|
243
|
+
#{output.map { |line| " #{line}" }.join}
|
244
|
+
EOF
|
245
|
+
|
246
|
+
Process.exit
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
228
251
|
def xcodebuild(defines = '', args = '', build_dir = 'build', build_model = 'Debug')
|
229
252
|
|
230
253
|
unless File.exist?("Pods.xcodeproj") #cocoapods-generate v2.0.0
|
@@ -239,6 +262,7 @@ module CBin
|
|
239
262
|
output = `#{command}`.lines.to_a
|
240
263
|
|
241
264
|
if $CHILD_STATUS.exitstatus != 0
|
265
|
+
suf_build_command
|
242
266
|
raise <<~EOF
|
243
267
|
Build command failed: #{command}
|
244
268
|
Output:
|