cocoapods-fy-bin 0.1.2 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-fy-bin/command/bin/archive.rb +7 -1
- data/lib/cocoapods-fy-bin/command/bin/auto.rb +11 -1
- data/lib/cocoapods-fy-bin/gem_version.rb +1 -1
- data/lib/cocoapods-fy-bin/helpers/build_helper.rb +5 -1
- data/lib/cocoapods-fy-bin/helpers/framework_builder.rb +30 -4
- 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: 051f76a29803d0b551a611de84c54c8c818e64f3fbd93289be027f8392640c88
|
4
|
+
data.tar.gz: 8183208c3b697a7a664dd692bc720a83595c56ea7546ef08e34b11af2fc2f100
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b5e192c7d09eca7258698ac67a12a1ccee679e963b013a753d2ba38cfacf94d34b524e0cfa4401844c38bda11248cedd012cb7cc65c11498f75abd14d31b560
|
7
|
+
data.tar.gz: 2a644bd033819e45445cc657700fa8abb4d853dd8cd1cd3ec0e98dd1677cf8b332ac4dfc4d1d9306278484aa43a735ad91b6a7bdbec98598705b59c4aa9d8e4d
|
@@ -32,7 +32,9 @@ module Pod
|
|
32
32
|
['--configuration', 'Build the specified configuration (e.g. Debug). Defaults to Release'],
|
33
33
|
['--env', "该组件上传的环境 %w[debug release]"],
|
34
34
|
['--archs', "需要二进制组件的架构"],
|
35
|
-
['--pre_build_shell', "xcodebuild前的脚本命令"]
|
35
|
+
['--pre_build_shell', "xcodebuild前的脚本命令"],
|
36
|
+
['--suf_build_shell', "xcodebuild后的脚本命令"],
|
37
|
+
['--toolchain', "设置toolchain"]
|
36
38
|
].concat(Pod::Command::Gen.options).concat(super).uniq
|
37
39
|
end
|
38
40
|
|
@@ -56,6 +58,8 @@ module Pod
|
|
56
58
|
@platform = Platform.new(:ios)
|
57
59
|
@archs = argv.option('archs', 'armv7,arm64')
|
58
60
|
@pre_build_shell = argv.option('pre_build_shell') || ''
|
61
|
+
@suf_build_shell = argv.option('suf_build_shell') || ''
|
62
|
+
@toolchain = argv.option('toolchain') || ''
|
59
63
|
@config = argv.option('configuration', 'Release')
|
60
64
|
|
61
65
|
@framework_path
|
@@ -91,6 +95,8 @@ module Pod
|
|
91
95
|
@spec,
|
92
96
|
@archs,
|
93
97
|
@pre_build_shell,
|
98
|
+
@suf_build_shell,
|
99
|
+
@toolchain,
|
94
100
|
CBin::Config::Builder.instance.white_pod_list.include?(@spec.name),
|
95
101
|
@config)
|
96
102
|
builder.build
|
@@ -22,7 +22,9 @@ module Pod
|
|
22
22
|
['--configuration', 'Build the specified configuration (e.g. Release ). Defaults to Debug'],
|
23
23
|
['--env', "该组件上传的环境 %w[debug release]"],
|
24
24
|
['--archs', "需要二进制组件的架构"],
|
25
|
-
['--pre_build_shell', "xcodebuild前的脚本命令"]
|
25
|
+
['--pre_build_shell', "xcodebuild前的脚本命令"],
|
26
|
+
['--suf_build_shell', "xcodebuild后的脚本命令"],
|
27
|
+
['--toolchain', "设置toolchain"]
|
26
28
|
].concat(Pod::Command::Gen.options).concat(super).uniq
|
27
29
|
end
|
28
30
|
|
@@ -41,6 +43,8 @@ module Pod
|
|
41
43
|
@verbose = argv.flag?('verbose', true)
|
42
44
|
@archs = argv.flag?('archs', 'arm64')
|
43
45
|
@pre_build_shell = argv.option('pre_build_shell') || ''
|
46
|
+
@suf_build_shell = argv.option('suf_build_shell') || ''
|
47
|
+
@toolchain = argv.option('toolchain') || ''
|
44
48
|
@config = argv.option('configuration', 'Debug')
|
45
49
|
@additional_args = argv.remainder!
|
46
50
|
|
@@ -131,6 +135,12 @@ module Pod
|
|
131
135
|
if @pre_build_shell
|
132
136
|
argvs += ["--pre_build_shell=#{@pre_build_shell}"]
|
133
137
|
end
|
138
|
+
if @suf_build_shell
|
139
|
+
argvs += ["--suf_build_shell=#{@suf_build_shell}"]
|
140
|
+
end
|
141
|
+
if @toolchain
|
142
|
+
argvs += ["--toolchain=#{@toolchain}"]
|
143
|
+
end
|
134
144
|
argvs += ["--configuration=#{@config}"]
|
135
145
|
|
136
146
|
archive = Pod::Command::Bin::Archive.new(CLAide::ARGV.new(argvs))
|
@@ -21,6 +21,8 @@ module CBin
|
|
21
21
|
rootSpec,
|
22
22
|
archs,
|
23
23
|
pre_build_shell,
|
24
|
+
suf_build_shell,
|
25
|
+
toolchain,
|
24
26
|
skip_archive = false,
|
25
27
|
build_model="Release")
|
26
28
|
@spec = spec
|
@@ -30,6 +32,8 @@ module CBin
|
|
30
32
|
@isRootSpec = rootSpec.name == spec.name
|
31
33
|
@archs = archs
|
32
34
|
@pre_build_shell = pre_build_shell
|
35
|
+
@suf_build_shell = suf_build_shell
|
36
|
+
@toolchain = toolchain
|
33
37
|
@skip_archive = skip_archive
|
34
38
|
@framework_output = framework_output
|
35
39
|
@zip = zip
|
@@ -58,7 +62,7 @@ module CBin
|
|
58
62
|
source_dir = Dir.pwd
|
59
63
|
file_accessor = Sandbox::FileAccessor.new(Pathname.new('.').expand_path, @spec.consumer(@platform))
|
60
64
|
Dir.chdir(workspace_directory) do
|
61
|
-
builder = CBin::Framework::Builder.new(@spec, file_accessor, @platform, source_dir, @archs, @pre_build_shell, @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)
|
62
66
|
@@build_defines = builder.build if @isRootSpec
|
63
67
|
begin
|
64
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, 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,8 @@ 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
|
23
|
+
@toolchain = toolchain
|
22
24
|
#vendored_static_frameworks 只有 xx.framework 需要拼接为 xx.framework/xx by slj
|
23
25
|
vendored_static_frameworks = file_accessor.vendored_static_frameworks.map do |framework|
|
24
26
|
path = framework
|
@@ -79,7 +81,7 @@ module CBin
|
|
79
81
|
archs.map do |arch|
|
80
82
|
xcodebuild(defines, "-sdk iphonesimulator ARCHS=\'#{arch}\' ", "build-#{arch}",@build_model)
|
81
83
|
end
|
82
|
-
|
84
|
+
suf_build_command
|
83
85
|
end
|
84
86
|
|
85
87
|
|
@@ -168,10 +170,13 @@ module CBin
|
|
168
170
|
end
|
169
171
|
|
170
172
|
def compile
|
171
|
-
defines = "
|
173
|
+
defines = ""
|
174
|
+
unless @toolchain.empty? then
|
175
|
+
defines += "-toolchain \"#{@toolchain}\""
|
176
|
+
end
|
177
|
+
defines += "GCC_PREPROCESSOR_DEFINITIONS='$(inherited)'"
|
172
178
|
defines += " SWIFT_ACTIVE_COMPILATION_CONDITIONS='$(inherited)' "
|
173
179
|
defines += @spec.consumer(@platform).compiler_flags.join(' ')
|
174
|
-
|
175
180
|
options = ios_build_options
|
176
181
|
# if is_debug_model
|
177
182
|
archs = ios_architectures
|
@@ -222,6 +227,26 @@ module CBin
|
|
222
227
|
end
|
223
228
|
end
|
224
229
|
|
230
|
+
# 编译后需执行的的shell脚本
|
231
|
+
def suf_build_command
|
232
|
+
unless @suf_build_shell.empty? then
|
233
|
+
command = "sh #{@suf_build_shell}"
|
234
|
+
puts command
|
235
|
+
UI.message "command = #{command}"
|
236
|
+
output = `#{command}`.lines.to_a
|
237
|
+
|
238
|
+
if $CHILD_STATUS.exitstatus != 0
|
239
|
+
raise <<~EOF
|
240
|
+
Shell command failed: #{command}
|
241
|
+
Output:
|
242
|
+
#{output.map { |line| " #{line}" }.join}
|
243
|
+
EOF
|
244
|
+
|
245
|
+
Process.exit
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
225
250
|
def xcodebuild(defines = '', args = '', build_dir = 'build', build_model = 'Debug')
|
226
251
|
|
227
252
|
unless File.exist?("Pods.xcodeproj") #cocoapods-generate v2.0.0
|
@@ -236,6 +261,7 @@ module CBin
|
|
236
261
|
output = `#{command}`.lines.to_a
|
237
262
|
|
238
263
|
if $CHILD_STATUS.exitstatus != 0
|
264
|
+
suf_build_command
|
239
265
|
raise <<~EOF
|
240
266
|
Build command failed: #{command}
|
241
267
|
Output:
|