cocoapods-fy-bin 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cde9c2113365214bafc0dc783ae238b2547753c74c7f53541ff4f780b11608b
4
- data.tar.gz: fcd9346532f14f66642cf518c0ad66ec373e269d5c7a246823d57bb9289966d7
3
+ metadata.gz: 051f76a29803d0b551a611de84c54c8c818e64f3fbd93289be027f8392640c88
4
+ data.tar.gz: 8183208c3b697a7a664dd692bc720a83595c56ea7546ef08e34b11af2fc2f100
5
5
  SHA512:
6
- metadata.gz: 852a379929907b914d0f5af1b92211e03b8bceb174a8d160705cd22c1d158ecf63f7c9df0bf0bd168c365e9d09bd79e7f63d7fb97939d11a8623bb1b18a1f91c
7
- data.tar.gz: 54cff8f722c75f1bb9e9836ffe16e55022cdf1ddace2e568824d84678168c8db4abf388f1a3938df16fbaec28ebc29db028ec5bb1ca0119ad933b3c3d0e49553
6
+ metadata.gz: 0b5e192c7d09eca7258698ac67a12a1ccee679e963b013a753d2ba38cfacf94d34b524e0cfa4401844c38bda11248cedd012cb7cc65c11498f75abd14d31b560
7
+ data.tar.gz: 2a644bd033819e45445cc657700fa8abb4d853dd8cd1cd3ec0e98dd1677cf8b332ac4dfc4d1d9306278484aa43a735ad91b6a7bdbec98598705b59c4aa9d8e4d
@@ -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.4'
3
+ VERSION = '0.1.5'
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 = "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"
253
+ 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"
232
254
  puts command
233
255
  else
234
- command = "sudo xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{build_model} -target #{target_name} -project ./Pods.xcodeproj 2>&1"
256
+ command = "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.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - dr