cocoapods-fy-bin 0.0.8 → 0.1.1

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: 741a281f7c86d496d69f78cf55db447151ff55b0a0f5991ffeff2b02d73b12ed
4
- data.tar.gz: e938cde22e3e875c2524f53e19d35d5333e2e6a0469f7b92cfc0645301015f3b
3
+ metadata.gz: 903d552160f64b602e42d047b1fe988fa929552de5367eec788a8504aa728f8f
4
+ data.tar.gz: a4dea89c78f4f46bcdaf23727edc749985bcf005ad2e259d0fca24a6e66a6c73
5
5
  SHA512:
6
- metadata.gz: b40aa1d3d0ba6fd1f91d3d3cbb455e6a1590443c3c242be681aaf3cbb0f29feb2b32158a0b37a1bb522e8c5928d0f6ffecb3ad301640d41fdc931ffe826ea4eb
7
- data.tar.gz: 17d3aaec0bba07097f8ae52b62e1fc2b0b264ccced9f0dd8bbe09fbc27449dbd98c3e3f83b7c8fdee54c339bc7c04bf7820e2f6ad287818088d9cf7b69441ed8
6
+ metadata.gz: 63973a62bbe459379dd395d2115c063839d4dce25c9262f4809ab00cd1a17623f664965a972ffd1ef26322c550d07717db84a471d75bd8e53f92836d39aa777d
7
+ data.tar.gz: 82f61369e2eaa1159b8f13bb51fb12b1c033c13ed6e86cfbe68d1caf18af0a6d6cac7da9eb7cb80dcc17d22cc5e265435709e0a930057e66cd27936b653d8a42
@@ -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_shell', "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_shell = argv.option('pre_build_shell') || ''
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_shell,
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_shell', "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_shell = argv.option('pre_build_shell') || ''
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_shell
132
+ argvs += ["--pre_build_shell=#{@pre_build_shell}"]
133
+ end
128
134
  argvs += ["--configuration=#{@config}"]
129
135
 
130
136
  archive = Pod::Command::Bin::Archive.new(CLAide::ARGV.new(argvs))
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.0.8'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
 
6
6
  module Pod
@@ -20,6 +20,7 @@ module CBin
20
20
  zip,
21
21
  rootSpec,
22
22
  archs,
23
+ pre_build_shell,
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_shell = pre_build_shell
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_shell, @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_shell, @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_shell, 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_shell = pre_build_shell
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_command
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_command
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,24 @@ module CBin
199
202
  end
200
203
  end
201
204
 
205
+ # 编译前需执行的的shell脚本
206
+ def pre_build_command
207
+ command = "sh #{@pre_build_shell}"
208
+ puts command
209
+ UI.message "command = #{command}"
210
+ output = `#{command}`.lines.to_a
211
+
212
+ if $CHILD_STATUS.exitstatus != 0
213
+ raise <<~EOF
214
+ Shell command failed: #{command}
215
+ Output:
216
+ #{output.map { |line| " #{line}" }.join}
217
+ EOF
218
+
219
+ Process.exit
220
+ end
221
+ end
222
+
202
223
  def xcodebuild(defines = '', args = '', build_dir = 'build', build_model = 'Debug')
203
224
 
204
225
  unless File.exist?("Pods.xcodeproj") #cocoapods-generate v2.0.0
@@ -206,6 +227,7 @@ module CBin
206
227
  puts command
207
228
  else
208
229
  command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{build_model} -target #{target_name} -project ./Pods.xcodeproj 2>&1"
230
+ puts command
209
231
  end
210
232
 
211
233
  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_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
+ @pre_build_shell = pre_build_shell
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.8
4
+ version: 0.1.1
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-06 00:00:00.000000000 Z
11
+ date: 2022-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel