cocoapods-bb-xcframework 0.1.0 → 0.2.3

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: f51e31cd2ec034bbc893a17b6335b903273fcd3eb0054cecd270bdf89c4483d3
4
- data.tar.gz: 9ca7be68bdb56db497bd8c6a99e5870663f98458de65ddf9697c22a993bc5636
3
+ metadata.gz: 1808be7db5b29f023bb71b3a2dac198bc5651ec4e06047996f8613621ab7b5b9
4
+ data.tar.gz: 83643d9bc5b96c87791c5988137f2e48c5b10bc6cb8cb5c14bb7802b92efaba3
5
5
  SHA512:
6
- metadata.gz: 2bc9b6c6c2051a583719ff4e10971387beecbb1a16662ca1c944beebbc9ca70963193e10d2dab59d18abd60d5483dae20c0c99067291441fa80f5b930dd55569
7
- data.tar.gz: ddd788e2dbee253c008251002bb13c21417cf9b60049316e8b8cfefa1410bd9300b1116546b69347f087ac22059d3777877e8c4fdcfb0cc877358b58b6a166cc
6
+ metadata.gz: f6648a147455b340a1ac3cb0502b3c304f2fd94f08cc190dd6777dd7651753ec5469d6292efbd064b48e23d3d146fd6a5477065c69580bfe3f3c0b2c6a25b103
7
+ data.tar.gz: 807879ca0a363cd4eab601d97258127cbcb065ca2e6bff224ffb7890bd257b1c853886c7227bf05e70373758d1fd7aa42833104569e7de5935b169cd11a60f16
@@ -34,7 +34,8 @@ module Pod
34
34
  ['--use-modular-headers', 'pakcage uses modular headers during packaging'],
35
35
  ['--no-static-library', 'package not use static library'],
36
36
  ['--enable-bitcode', 'package enable bitcode'],
37
- ['--no-symbols', 'package not use symbols'] # 符号表
37
+ ['--no-symbols', 'package not use symbols'], # 符号表
38
+ ['--no-support-maccatalyst', 'package support generate MacCatalyst'] # 是否支持MacCatalyst方式支持iOS应用在mac平台运行库生成
38
39
  ].concat super
39
40
  end
40
41
 
@@ -50,6 +51,7 @@ module Pod
50
51
  @use_static_library = argv.flag?('static-library',true)
51
52
  @enable_bitcode = argv.flag?('enable-bitcode',false)
52
53
  @symbols = argv.flag?('symbols',true)
54
+ @support_maccatalyst = argv.flag?('support-maccatalyst',true)
53
55
  config.static_library_enable = @use_static_library
54
56
  super
55
57
  end
@@ -60,7 +62,7 @@ module Pod
60
62
  end
61
63
 
62
64
  def run
63
- frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols)
65
+ frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols, @support_maccatalyst)
64
66
  frameworker.run
65
67
  end
66
68
  end
@@ -3,7 +3,7 @@ module Pod
3
3
  include PodUtil
4
4
  include DirUtil
5
5
  include Config::Mixin
6
- def initialize(name, source, spec_sources, subspecs, configuration, force, use_modular_headers=true, enable_bitcode=false, symbols=true)
6
+ def initialize(name, source, spec_sources, subspecs, configuration, force, use_modular_headers=true, enable_bitcode=false, symbols=true, support_maccatalyst=true)
7
7
  @name = name
8
8
  @source = source
9
9
  @spec_sources = spec_sources
@@ -13,6 +13,7 @@ module Pod
13
13
  @use_modular_headers = use_modular_headers
14
14
  @enable_bitcode = enable_bitcode
15
15
  @symbols = symbols
16
+ @support_maccatalyst = support_maccatalyst
16
17
  end
17
18
 
18
19
  def run
@@ -60,7 +61,8 @@ module Pod
60
61
  sandbox_root,
61
62
  spec,
62
63
  @configuration,
63
- @symbols
64
+ @symbols,
65
+ @support_maccatalyst
64
66
  )
65
67
  builder.build
66
68
  builder.outputs target_dir
@@ -1,3 +1,3 @@
1
1
  module CocoapodsXCFramework
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -84,6 +84,9 @@ module Pod
84
84
  configuration.build_settings['ENABLE_BITCODE'] = 'YES'
85
85
  configuration.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'
86
86
  end
87
+ ### support MacCatalyst 默认生成工程不支持 by hm 21/11/3
88
+ configuration.build_settings['SUPPORTS_MACCATALYST'] = 'YES'
89
+ ### support MacCatalyst end
87
90
  end
88
91
  if target.name == spec.name
89
92
  target.build_configurations.each do |configuration|
@@ -117,6 +120,9 @@ module Pod
117
120
  configuration.build_settings['ENABLE_BITCODE'] = 'YES'
118
121
  configuration.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'
119
122
  end
123
+ ### support MacCatalyst 默认生成工程不支持 by hm 21/11/3
124
+ configuration.build_settings['SUPPORTS_MACCATALYST'] = 'YES'
125
+ ### support MacCatalyst end
120
126
  end
121
127
  if specs.include? target.name
122
128
  target.build_configurations.each do |configuration|
@@ -1,13 +1,39 @@
1
1
  module Pod
2
2
  class XBuilder
3
3
  module XcodeXBuilder
4
- def xcode_xbuild(defines, configuration, work_dir, build_dir = 'export')
4
+ def xcode_xbuild(defines, configuration, work_dir, build_dir = 'export', platform = 'iOS', project = nil, scheme = nil, skip_install = false)
5
5
  if defined?(Pod::DONT_CODESIGN)
6
6
  defines = "#{defines} CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO"
7
7
  end
8
8
  pwd = Pathname.pwd
9
9
  Dir.chdir work_dir
10
- command = "xcodebuild #{defines} BUILD_DIR=#{build_dir} BUILD_LIBRARY_FOR_DISTRIBUTION=YES clean build -configuration #{configuration} -alltargets 2>&1"
10
+
11
+ if platform == 'macOS'
12
+ destination = 'generic/platform=macOS,variant=Mac Catalyst,name=Any Mac'
13
+ archs = 'x86_64 arm64'
14
+ elsif platform == 'iOS Simulator'
15
+ destination = 'generic/platform=iOS Simulator'
16
+ # archs = 'x86_64 arm64'
17
+ archs = 'x86_64 i386 arm64' # swift库针对M1芯片移除x86架构,故模拟器添加i386,解决maccatalyst能正常生成
18
+ else
19
+ destination = 'generic/platform=iOS'
20
+ archs = 'arm64 armv7'
21
+ end
22
+ if skip_install
23
+ skip_install = 'YES'
24
+ else
25
+ skip_install = 'NO'
26
+ end
27
+ if not project.nil?
28
+ # if not scheme.nil?
29
+ # command = "xcodebuild #{defines} BUILD_DIR=#{build_dir} BUILD_LIBRARY_FOR_DISTRIBUTION=YES clean build -configuration #{configuration} -project '#{project}' -scheme '#{scheme}' -destination '#{destination}' ARCHS='#{archs}' SKIP_INSTALL=#{skip_install} | xcpretty 2>&1"
30
+ # else
31
+ # command = "xcodebuild #{defines} BUILD_DIR=#{build_dir} BUILD_LIBRARY_FOR_DISTRIBUTION=YES clean build -configuration #{configuration} -alltargets -scheme '#{scheme}' -destination '#{destination}' ARCHS='#{archs}' SKIP_INSTALL=#{skip_install} | xcpretty 2>&1"
32
+ # end
33
+ command = "xcodebuild #{defines} BUILD_DIR=#{build_dir} BUILD_LIBRARY_FOR_DISTRIBUTION=YES clean build -configuration #{configuration} -alltargets -scheme '#{scheme}' -destination '#{destination}' ARCHS='#{archs}' SKIP_INSTALL=#{skip_install} | xcpretty 2>&1"
34
+ else
35
+ command = "xcodebuild #{defines} BUILD_DIR=#{build_dir} BUILD_LIBRARY_FOR_DISTRIBUTION=YES clean build -configuration #{configuration} -alltargets -destination '#{destination}' ARCHS='#{archs}' SKIP_INSTALL=#{skip_install} | xcpretty 2>&1"
36
+ end
11
37
  UI.puts("XBuilder command:#{command}")
12
38
  output = `#{command}`.lines.to_a
13
39
  Dir.chdir pwd
@@ -6,7 +6,7 @@ module Pod
6
6
  include XcodeProjHelper
7
7
  include PodUtil
8
8
  include Config::Mixin
9
- def initialize(installer, source_dir, sandbox_root, spec, configuration, symbols=true)
9
+ def initialize(installer, source_dir, sandbox_root, spec, configuration, symbols=true, support_maccatalyst=true)
10
10
  # def initialize(platform, installer, source_dir, sandbox_root, spec, config)
11
11
  # @platform = platform
12
12
  @installer = installer
@@ -20,6 +20,7 @@ module Pod
20
20
  @configuration = configuration
21
21
  @outputs = Hash.new
22
22
  @symbols = symbols
23
+ @support_maccatalyst = support_maccatalyst
23
24
  end
24
25
 
25
26
  def build
@@ -137,6 +138,7 @@ module Pod
137
138
  # build general first because simulator will exchange SDKROOT to simulat sdk
138
139
  build_general_device defines
139
140
  build_simulator_device defines
141
+ build_MacCatalyst_device defines if @support_maccatalyst
140
142
  end
141
143
 
142
144
  def build_general_device defines
@@ -154,7 +156,22 @@ module Pod
154
156
  xcode_xbuild(
155
157
  defines,
156
158
  @configuration,
157
- @sandbox_root
159
+ @sandbox_root,
160
+ 'export',
161
+ 'iOS Simulator'
162
+ )
163
+ end
164
+
165
+ def build_MacCatalyst_device defines
166
+ UI.puts("--- Building framework #{@spec} with MacCatalyst device")
167
+ xcode_xbuild(
168
+ defines,
169
+ @configuration,
170
+ @sandbox_root,
171
+ 'export', # build_dir
172
+ 'macOS', # platform
173
+ "#{@sandbox_root}/Pods.xcodeproj", # project
174
+ "#{@spec.name}" # scheme
158
175
  )
159
176
  end
160
177
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-xcframework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-15 00:00:00.000000000 Z
11
+ date: 2021-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
- rubygems_version: 3.1.4
109
+ rubygems_version: 3.2.30
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: 把podspec打包成xcframework的小工具。packager pod to a xcframework