cocoapods-fy-bin 0.0.8 → 0.0.9
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 +4 -1
- data/lib/cocoapods-fy-bin/command/bin/auto.rb +7 -1
- data/lib/cocoapods-fy-bin/gem_version.rb +1 -1
- data/lib/cocoapods-fy-bin/helpers/build_helper.rb +4 -2
- data/lib/cocoapods-fy-bin/helpers/framework_builder.rb +26 -1
- data/lib/cocoapods-fy-bin/helpers/library_builder.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 349f56acd81d29471129eed2a459165a89fbd3b8558b118f9b531441bae5d8cc
|
4
|
+
data.tar.gz: 21b8eca394a490c8df72db1aed106272ad877065e18b6420da0a75e75edfc930
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 238a5aca517a885d3d08ac700c8af22607511e1c3dc7beb4d1f199b3afdaadec6e57d0974463f14db8f4e22ce88a6d3028179102ccbb77b8a6d68ceff4e992b2
|
7
|
+
data.tar.gz: ce69f0aa064cbac03c582852b1b667b69838d8042eb15a5b6fe3e4c3a06afb7165dfdc576853352086ace3ef29f5a4d62224336565440bee826004f5ee8b14c5
|
@@ -31,7 +31,8 @@ module Pod
|
|
31
31
|
['--no-zip', '不压缩静态库 为 zip'],
|
32
32
|
['--configuration', 'Build the specified configuration (e.g. Debug). Defaults to Release'],
|
33
33
|
['--env', "该组件上传的环境 %w[debug release]"],
|
34
|
-
['--archs', "需要二进制组件的架构"]
|
34
|
+
['--archs', "需要二进制组件的架构"],
|
35
|
+
['--pre_build_shells', "xcodebuild前的脚本命令"]
|
35
36
|
].concat(Pod::Command::Gen.options).concat(super).uniq
|
36
37
|
end
|
37
38
|
|
@@ -54,6 +55,7 @@ module Pod
|
|
54
55
|
@sources = argv.option('sources') || []
|
55
56
|
@platform = Platform.new(:ios)
|
56
57
|
@archs = argv.option('archs', 'armv7,arm64')
|
58
|
+
@pre_build_shells = argv.option('pre_build_shells', '')
|
57
59
|
@config = argv.option('configuration', 'Release')
|
58
60
|
|
59
61
|
@framework_path
|
@@ -88,6 +90,7 @@ module Pod
|
|
88
90
|
@zip,
|
89
91
|
@spec,
|
90
92
|
@archs,
|
93
|
+
@pre_build_shells,
|
91
94
|
CBin::Config::Builder.instance.white_pod_list.include?(@spec.name),
|
92
95
|
@config)
|
93
96
|
builder.build
|
@@ -21,7 +21,8 @@ module Pod
|
|
21
21
|
['--all-make', '对该组件的依赖库,全部制作为二进制组件'],
|
22
22
|
['--configuration', 'Build the specified configuration (e.g. Release ). Defaults to Debug'],
|
23
23
|
['--env', "该组件上传的环境 %w[debug release]"],
|
24
|
-
['--archs', "需要二进制组件的架构"]
|
24
|
+
['--archs', "需要二进制组件的架构"],
|
25
|
+
['--pre_build_shells', "xcodebuild前的脚本命令"]
|
25
26
|
].concat(Pod::Command::Gen.options).concat(super).uniq
|
26
27
|
end
|
27
28
|
|
@@ -39,9 +40,11 @@ module Pod
|
|
39
40
|
@all_make = argv.flag?('all-make', false)
|
40
41
|
@verbose = argv.flag?('verbose', true)
|
41
42
|
@archs = argv.flag?('archs', 'arm64')
|
43
|
+
@pre_build_shells = argv.flag?('pre_build_shells', '')
|
42
44
|
@config = argv.option('configuration', 'Debug')
|
43
45
|
@additional_args = argv.remainder!
|
44
46
|
|
47
|
+
|
45
48
|
super
|
46
49
|
end
|
47
50
|
|
@@ -125,6 +128,9 @@ module Pod
|
|
125
128
|
if @archs
|
126
129
|
argvs += ["--archs=#{@archs}"]
|
127
130
|
end
|
131
|
+
if @pre_build_shells
|
132
|
+
argvs += ["--pre_build_shells=#{@pre_build_shells}"]
|
133
|
+
end
|
128
134
|
argvs += ["--configuration=#{@config}"]
|
129
135
|
|
130
136
|
archive = Pod::Command::Bin::Archive.new(CLAide::ARGV.new(argvs))
|
@@ -20,6 +20,7 @@ module CBin
|
|
20
20
|
zip,
|
21
21
|
rootSpec,
|
22
22
|
archs,
|
23
|
+
pre_build_shells,
|
23
24
|
skip_archive = false,
|
24
25
|
build_model="Release")
|
25
26
|
@spec = spec
|
@@ -28,6 +29,7 @@ module CBin
|
|
28
29
|
@rootSpec = rootSpec
|
29
30
|
@isRootSpec = rootSpec.name == spec.name
|
30
31
|
@archs = archs
|
32
|
+
@pre_build_shells = pre_build_shells
|
31
33
|
@skip_archive = skip_archive
|
32
34
|
@framework_output = framework_output
|
33
35
|
@zip = zip
|
@@ -56,7 +58,7 @@ module CBin
|
|
56
58
|
source_dir = Dir.pwd
|
57
59
|
file_accessor = Sandbox::FileAccessor.new(Pathname.new('.').expand_path, @spec.consumer(@platform))
|
58
60
|
Dir.chdir(workspace_directory) do
|
59
|
-
builder = CBin::Framework::Builder.new(@spec, file_accessor, @platform, source_dir, @archs, @isRootSpec, @build_model)
|
61
|
+
builder = CBin::Framework::Builder.new(@spec, file_accessor, @platform, source_dir, @archs, @pre_build_shells, @isRootSpec, @build_model)
|
60
62
|
@@build_defines = builder.build if @isRootSpec
|
61
63
|
begin
|
62
64
|
@framework_path = builder.lipo_build(@@build_defines) unless @skip_archive
|
@@ -70,7 +72,7 @@ module CBin
|
|
70
72
|
source_dir = zip_dir
|
71
73
|
file_accessor = Sandbox::FileAccessor.new(Pathname.new('.').expand_path, @spec.consumer(@platform))
|
72
74
|
Dir.chdir(workspace_directory) do
|
73
|
-
builder = CBin::Library::Builder.new(@spec, file_accessor, @platform, source_dir , @archs, @framework_path)
|
75
|
+
builder = CBin::Library::Builder.new(@spec, file_accessor, @platform, source_dir , @archs, @pre_build_shells, @framework_path)
|
74
76
|
builder.build
|
75
77
|
end
|
76
78
|
end
|
@@ -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, isRootSpec = true, build_model="Debug")
|
13
|
+
def initialize(spec, file_accessor, platform, source_dir, archs, pre_build_shells, isRootSpec = true, build_model="Debug")
|
14
14
|
@spec = spec
|
15
15
|
@source_dir = source_dir
|
16
16
|
@file_accessor = file_accessor
|
@@ -18,6 +18,7 @@ module CBin
|
|
18
18
|
@build_model = build_model
|
19
19
|
@isRootSpec = isRootSpec
|
20
20
|
@archs = archs
|
21
|
+
@pre_build_commands = pre_build_shells
|
21
22
|
#vendored_static_frameworks 只有 xx.framework 需要拼接为 xx.framework/xx by slj
|
22
23
|
vendored_static_frameworks = file_accessor.vendored_static_frameworks.map do |framework|
|
23
24
|
path = framework
|
@@ -74,6 +75,7 @@ module CBin
|
|
74
75
|
|
75
76
|
# archs = %w[i386 x86_64]
|
76
77
|
archs = ios_architectures_sim
|
78
|
+
pre_build_shell
|
77
79
|
archs.map do |arch|
|
78
80
|
xcodebuild(defines, "-sdk iphonesimulator ARCHS=\'#{arch}\' ", "build-#{arch}",@build_model)
|
79
81
|
end
|
@@ -174,6 +176,7 @@ module CBin
|
|
174
176
|
# if is_debug_model
|
175
177
|
archs = ios_architectures
|
176
178
|
# archs = %w[arm64 armv7 armv7s]
|
179
|
+
pre_build_shell
|
177
180
|
archs.map do |arch|
|
178
181
|
# -fembed-bitcode支持bitcode BUILD_LIBRARY_FOR_DISTRIBUTION=YES 构建向后兼容的framework
|
179
182
|
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)
|
@@ -199,6 +202,27 @@ module CBin
|
|
199
202
|
end
|
200
203
|
end
|
201
204
|
|
205
|
+
# 编译前需执行的的shell脚本
|
206
|
+
def pre_build_shell
|
207
|
+
command_args = @pre_build_commands.split(",")
|
208
|
+
command_args.each do |command_arg|
|
209
|
+
command = "sh #{command_arg}"
|
210
|
+
puts command
|
211
|
+
UI.message "command = #{command}"
|
212
|
+
output = `#{command}`.lines.to_a
|
213
|
+
|
214
|
+
if $CHILD_STATUS.exitstatus != 0
|
215
|
+
raise <<~EOF
|
216
|
+
Shell command failed: #{command}
|
217
|
+
Output:
|
218
|
+
#{output.map { |line| " #{line}" }.join}
|
219
|
+
EOF
|
220
|
+
|
221
|
+
Process.exit
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
202
226
|
def xcodebuild(defines = '', args = '', build_dir = 'build', build_model = 'Debug')
|
203
227
|
|
204
228
|
unless File.exist?("Pods.xcodeproj") #cocoapods-generate v2.0.0
|
@@ -206,6 +230,7 @@ module CBin
|
|
206
230
|
puts command
|
207
231
|
else
|
208
232
|
command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{build_model} -target #{target_name} -project ./Pods.xcodeproj 2>&1"
|
233
|
+
puts command
|
209
234
|
end
|
210
235
|
|
211
236
|
UI.message "command = #{command}"
|
@@ -11,13 +11,14 @@ module CBin
|
|
11
11
|
class Builder
|
12
12
|
include Pod
|
13
13
|
|
14
|
-
def initialize(spec, file_accessor, platform, source_dir, archs, framework_path)
|
14
|
+
def initialize(spec, file_accessor, platform, source_dir, archs, pre_build_shells, framework_path)
|
15
15
|
@spec = spec
|
16
16
|
@source_dir = source_dir
|
17
17
|
@file_accessor = file_accessor
|
18
18
|
@platform = platform
|
19
19
|
@framework = framework_path
|
20
20
|
@archs = archs
|
21
|
+
@pre_build_shells = pre_build_shells
|
21
22
|
@source_files = "#{@source_dir}/#{library.name_path}"
|
22
23
|
@source_zip_file = "#{@source_files}.zip"
|
23
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-fy-bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|