cocoapods-fy-bin 0.1.3 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfbe15f09b3aece53749debbbdbe6dd608e3aa2d4e1eb28f1b50a489126f3649
4
- data.tar.gz: ba4f8ed697e8ba9c1042b02c5b013babc4ce92f392be0d5a7d768ed995277ef6
3
+ metadata.gz: a0366cd54caf14a564266fc214c5d60fbe97d96773b4354ea0e69a0696160f41
4
+ data.tar.gz: 6f8122f4f8f4e067f4e8f18163a930612fb8c5f2a452b7b8e81da4b98c6034b4
5
5
  SHA512:
6
- metadata.gz: ad083e5e22c74dc74c4d1b65a91bbbd0ae7e945e00b279c17b8337f2f8bfb83ea5d94534ab0af984f4f0359e514f886acfe8f58f9606acc5294760b4732d2cb5
7
- data.tar.gz: 8efa614a3381cca34b80c129c226ca709e99b0e9444328cdbea906fecf5e575c7f505aa4586faa7dc1d725a7a1e361a19d38bc0b79d1815180ea24520db82e14
6
+ metadata.gz: 0eb16f11626788cda94240af0e863cd41b1654a0245305c520c543205cdcfdf88f371cb96f680061f7ed0f9224e991b4a646ea5b197c3b373649cf57a3dd21f4
7
+ data.tar.gz: f0a5bc9d0e07d5aa3edd87a9a21b1c1cb76d776b3e3b4acebfaa928f0c3194b2fd8218b31ed2852c2ce67ca405d96b4fa4bab8078d2b7b8475f4e1ebb26068aa
@@ -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
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.6'
4
4
  end
5
5
 
6
6
  module Pod
@@ -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 = "GCC_PREPROCESSOR_DEFINITIONS='$(inherited)'"
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
@@ -225,13 +227,33 @@ module CBin
225
227
  end
226
228
  end
227
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
+
228
250
  def xcodebuild(defines = '', args = '', build_dir = 'build', build_model = 'Debug')
229
251
 
230
252
  unless File.exist?("Pods.xcodeproj") #cocoapods-generate v2.0.0
231
- command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{File.join(File.expand_path("..", build_dir), File.basename(build_dir))} clean build -configuration #{build_model} -target #{target_name} -project ./Pods/Pods.xcodeproj 2>&1"
253
+ command = "sudo xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{File.join(File.expand_path("..", build_dir), File.basename(build_dir))} clean build -configuration #{build_model} -target #{target_name} -project ./Pods/Pods.xcodeproj 2>&1"
232
254
  puts command
233
255
  else
234
- command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{build_model} -target #{target_name} -project ./Pods.xcodeproj 2>&1"
256
+ command = "sudo xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{build_model} -target #{target_name} -project ./Pods.xcodeproj 2>&1"
235
257
  puts command
236
258
  end
237
259
 
@@ -239,6 +261,7 @@ module CBin
239
261
  output = `#{command}`.lines.to_a
240
262
 
241
263
  if $CHILD_STATUS.exitstatus != 0
264
+ suf_build_command
242
265
  raise <<~EOF
243
266
  Build command failed: #{command}
244
267
  Output:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-fy-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - dr