cocoapods-fy-bin 0.1.0 → 0.1.3
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 +6 -3
- data/lib/cocoapods-fy-bin/command/bin/auto.rb +9 -4
- data/lib/cocoapods-fy-bin/gem_version.rb +1 -1
- data/lib/cocoapods-fy-bin/helpers/build_helper.rb +6 -4
- data/lib/cocoapods-fy-bin/helpers/framework_builder.rb +11 -8
- data/lib/cocoapods-fy-bin/helpers/library_builder.rb +2 -2
- 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: dfbe15f09b3aece53749debbbdbe6dd608e3aa2d4e1eb28f1b50a489126f3649
|
4
|
+
data.tar.gz: ba4f8ed697e8ba9c1042b02c5b013babc4ce92f392be0d5a7d768ed995277ef6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad083e5e22c74dc74c4d1b65a91bbbd0ae7e945e00b279c17b8337f2f8bfb83ea5d94534ab0af984f4f0359e514f886acfe8f58f9606acc5294760b4732d2cb5
|
7
|
+
data.tar.gz: 8efa614a3381cca34b80c129c226ca709e99b0e9444328cdbea906fecf5e575c7f505aa4586faa7dc1d725a7a1e361a19d38bc0b79d1815180ea24520db82e14
|
@@ -32,7 +32,8 @@ 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
|
-
['--
|
35
|
+
['--pre_build_shell', "xcodebuild前的脚本命令"],
|
36
|
+
['--toolchain', "设置toolchain"]
|
36
37
|
].concat(Pod::Command::Gen.options).concat(super).uniq
|
37
38
|
end
|
38
39
|
|
@@ -55,7 +56,8 @@ module Pod
|
|
55
56
|
@sources = argv.option('sources') || []
|
56
57
|
@platform = Platform.new(:ios)
|
57
58
|
@archs = argv.option('archs', 'armv7,arm64')
|
58
|
-
@
|
59
|
+
@pre_build_shell = argv.option('pre_build_shell') || ''
|
60
|
+
@toolchain = argv.option('toolchain') || ''
|
59
61
|
@config = argv.option('configuration', 'Release')
|
60
62
|
|
61
63
|
@framework_path
|
@@ -90,7 +92,8 @@ module Pod
|
|
90
92
|
@zip,
|
91
93
|
@spec,
|
92
94
|
@archs,
|
93
|
-
@
|
95
|
+
@pre_build_shell,
|
96
|
+
@toolchain,
|
94
97
|
CBin::Config::Builder.instance.white_pod_list.include?(@spec.name),
|
95
98
|
@config)
|
96
99
|
builder.build
|
@@ -22,7 +22,8 @@ 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
|
-
['--
|
25
|
+
['--pre_build_shell', "xcodebuild前的脚本命令"],
|
26
|
+
['--toolchain', "设置toolchain"]
|
26
27
|
].concat(Pod::Command::Gen.options).concat(super).uniq
|
27
28
|
end
|
28
29
|
|
@@ -40,7 +41,8 @@ module Pod
|
|
40
41
|
@all_make = argv.flag?('all-make', false)
|
41
42
|
@verbose = argv.flag?('verbose', true)
|
42
43
|
@archs = argv.flag?('archs', 'arm64')
|
43
|
-
@
|
44
|
+
@pre_build_shell = argv.option('pre_build_shell') || ''
|
45
|
+
@toolchain = argv.option('toolchain') || ''
|
44
46
|
@config = argv.option('configuration', 'Debug')
|
45
47
|
@additional_args = argv.remainder!
|
46
48
|
|
@@ -128,8 +130,11 @@ module Pod
|
|
128
130
|
if @archs
|
129
131
|
argvs += ["--archs=#{@archs}"]
|
130
132
|
end
|
131
|
-
if @
|
132
|
-
argvs += ["--
|
133
|
+
if @pre_build_shell
|
134
|
+
argvs += ["--pre_build_shell=#{@pre_build_shell}"]
|
135
|
+
end
|
136
|
+
if @toolchain
|
137
|
+
argvs += ["--toolchain=#{@toolchain}"]
|
133
138
|
end
|
134
139
|
argvs += ["--configuration=#{@config}"]
|
135
140
|
|
@@ -20,7 +20,8 @@ module CBin
|
|
20
20
|
zip,
|
21
21
|
rootSpec,
|
22
22
|
archs,
|
23
|
-
|
23
|
+
pre_build_shell,
|
24
|
+
toolchain,
|
24
25
|
skip_archive = false,
|
25
26
|
build_model="Release")
|
26
27
|
@spec = spec
|
@@ -29,7 +30,8 @@ module CBin
|
|
29
30
|
@rootSpec = rootSpec
|
30
31
|
@isRootSpec = rootSpec.name == spec.name
|
31
32
|
@archs = archs
|
32
|
-
@
|
33
|
+
@pre_build_shell = pre_build_shell
|
34
|
+
@toolchain = toolchain
|
33
35
|
@skip_archive = skip_archive
|
34
36
|
@framework_output = framework_output
|
35
37
|
@zip = zip
|
@@ -58,7 +60,7 @@ module CBin
|
|
58
60
|
source_dir = Dir.pwd
|
59
61
|
file_accessor = Sandbox::FileAccessor.new(Pathname.new('.').expand_path, @spec.consumer(@platform))
|
60
62
|
Dir.chdir(workspace_directory) do
|
61
|
-
builder = CBin::Framework::Builder.new(@spec, file_accessor, @platform, source_dir, @archs, @
|
63
|
+
builder = CBin::Framework::Builder.new(@spec, file_accessor, @platform, source_dir, @archs, @pre_build_shell, @toolchain, @isRootSpec, @build_model)
|
62
64
|
@@build_defines = builder.build if @isRootSpec
|
63
65
|
begin
|
64
66
|
@framework_path = builder.lipo_build(@@build_defines) unless @skip_archive
|
@@ -72,7 +74,7 @@ module CBin
|
|
72
74
|
source_dir = zip_dir
|
73
75
|
file_accessor = Sandbox::FileAccessor.new(Pathname.new('.').expand_path, @spec.consumer(@platform))
|
74
76
|
Dir.chdir(workspace_directory) do
|
75
|
-
builder = CBin::Library::Builder.new(@spec, file_accessor, @platform, source_dir , @archs, @
|
77
|
+
builder = CBin::Library::Builder.new(@spec, file_accessor, @platform, source_dir , @archs, @pre_build_shell, @framework_path)
|
76
78
|
builder.build
|
77
79
|
end
|
78
80
|
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,
|
13
|
+
def initialize(spec, file_accessor, platform, source_dir, archs, pre_build_shell, toolchain, isRootSpec = true, build_model="Debug")
|
14
14
|
@spec = spec
|
15
15
|
@source_dir = source_dir
|
16
16
|
@file_accessor = file_accessor
|
@@ -18,7 +18,8 @@ module CBin
|
|
18
18
|
@build_model = build_model
|
19
19
|
@isRootSpec = isRootSpec
|
20
20
|
@archs = archs
|
21
|
-
@
|
21
|
+
@pre_build_shell = pre_build_shell
|
22
|
+
@toolchain = toolchain
|
22
23
|
#vendored_static_frameworks 只有 xx.framework 需要拼接为 xx.framework/xx by slj
|
23
24
|
vendored_static_frameworks = file_accessor.vendored_static_frameworks.map do |framework|
|
24
25
|
path = framework
|
@@ -75,7 +76,7 @@ module CBin
|
|
75
76
|
|
76
77
|
# archs = %w[i386 x86_64]
|
77
78
|
archs = ios_architectures_sim
|
78
|
-
|
79
|
+
pre_build_command
|
79
80
|
archs.map do |arch|
|
80
81
|
xcodebuild(defines, "-sdk iphonesimulator ARCHS=\'#{arch}\' ", "build-#{arch}",@build_model)
|
81
82
|
end
|
@@ -171,12 +172,14 @@ module CBin
|
|
171
172
|
defines = "GCC_PREPROCESSOR_DEFINITIONS='$(inherited)'"
|
172
173
|
defines += " SWIFT_ACTIVE_COMPILATION_CONDITIONS='$(inherited)' "
|
173
174
|
defines += @spec.consumer(@platform).compiler_flags.join(' ')
|
174
|
-
|
175
|
+
unless @toolchain.empty? then
|
176
|
+
defines += "-toolchain \"#{@toolchain}\""
|
177
|
+
end
|
175
178
|
options = ios_build_options
|
176
179
|
# if is_debug_model
|
177
180
|
archs = ios_architectures
|
178
181
|
# archs = %w[arm64 armv7 armv7s]
|
179
|
-
|
182
|
+
pre_build_command
|
180
183
|
archs.map do |arch|
|
181
184
|
# -fembed-bitcode支持bitcode BUILD_LIBRARY_FOR_DISTRIBUTION=YES 构建向后兼容的framework
|
182
185
|
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)
|
@@ -203,9 +206,9 @@ module CBin
|
|
203
206
|
end
|
204
207
|
|
205
208
|
# 编译前需执行的的shell脚本
|
206
|
-
def
|
207
|
-
@
|
208
|
-
command = "sh #{
|
209
|
+
def pre_build_command
|
210
|
+
unless @pre_build_shell.empty? then
|
211
|
+
command = "sh #{@pre_build_shell}"
|
209
212
|
puts command
|
210
213
|
UI.message "command = #{command}"
|
211
214
|
output = `#{command}`.lines.to_a
|
@@ -11,14 +11,14 @@ module CBin
|
|
11
11
|
class Builder
|
12
12
|
include Pod
|
13
13
|
|
14
|
-
def initialize(spec, file_accessor, platform, source_dir, archs,
|
14
|
+
def initialize(spec, file_accessor, platform, source_dir, archs, pre_build_shell, 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
|
-
@
|
21
|
+
@pre_build_shell = pre_build_shell
|
22
22
|
@source_files = "#{@source_dir}/#{library.name_path}"
|
23
23
|
@source_zip_file = "#{@source_files}.zip"
|
24
24
|
end
|