cocoapods-xcframework 0.1.1 → 0.2.0

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: 46213903938512037adf189a5077b72a22de58a58772079b6ed51e3d69819848
4
- data.tar.gz: 4ca7fdc2a9eb9614a82ba357b97d109ee5c1039373432f3b6e93a2ccaa51a15c
3
+ metadata.gz: 524f3dacc9713030c4d5e2cd2d74d2ef6437a4301940484c12dd9596c89f85f5
4
+ data.tar.gz: 5eb3da5b46a72827d9af811173ac3c7b08f1403c6ea3310c4c9afc98dd4b0473
5
5
  SHA512:
6
- metadata.gz: ed4aa32df78147ee139baa3041ff87bfd02b751a65062d8732361bca189478b0733f0df62be1ff6ad7dcdc6e1e0b5bce985a4996e2c1edae796aded3c6c8b7b4
7
- data.tar.gz: 7b63fd3315add0ca97f5ac408bbd6a6fc2ef7bcc002f361abce8f042302c4321ecde12d8cb05db97211b854e94cb5de1a49fb8d86158f6e189fd2077c986fe91
6
+ metadata.gz: cfd6763d22e5d26f70c50daf23c4f6e872ab7748e1fbb91cde884df34f9997e83a55eb369710fe52aa4733043a6e0364e29e37dc644c5a9c5097ffd05b623b4e
7
+ data.tar.gz: 23380b32ba90686046afffa29fe2ca63c030e8a62b0fada553a9e28f5cc444ea074143638c0fc1c8cf8ea7b9291cf68289acf7d65e495805a119b6dcdd3690c0
@@ -32,7 +32,8 @@ module Pod
32
32
  ['--spec-sources=private,https://github.com/CocoaPods/Specs.git', 'The sources to pull dependent pods from (defaults to https://github.com/CocoaPods/Specs.git)'],
33
33
  ['--subspecs', 'Only include the given subspecs'],
34
34
  ['--use-modular-headers', 'pakcage uses modular headers during packaging'],
35
- ['--no-static-library', 'package not use static library']
35
+ ['--no-static-library', 'package not use static library'],
36
+ ['--enalbe-bitcode', 'package enable bitcode']
36
37
  ].concat super
37
38
  end
38
39
 
@@ -46,6 +47,7 @@ module Pod
46
47
  @use_modular_headers = argv.option('use-modular-headers', true)
47
48
  @force = argv.flag?('force', true)
48
49
  @use_static_library = argv.flag?('static-library',true)
50
+ @enable_bitcode = argv.flag?('enable-bitcode',false)
49
51
  config.static_library_enable = @use_static_library
50
52
  super
51
53
  end
@@ -56,7 +58,7 @@ module Pod
56
58
  end
57
59
 
58
60
  def run
59
- frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers)
61
+ frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode)
60
62
  frameworker.run
61
63
  end
62
64
  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)
6
+ def initialize(name, source, spec_sources, subspecs, configuration, force, use_modular_headers, enable_bitcode)
7
7
  @name = name
8
8
  @source = source
9
9
  @spec_sources = spec_sources
@@ -11,6 +11,7 @@ module Pod
11
11
  @configuration = configuration
12
12
  @force = force
13
13
  @use_modular_headers = use_modular_headers
14
+ @enable_bitcode = enable_bitcode
14
15
  end
15
16
 
16
17
  def run
@@ -36,7 +37,8 @@ module Pod
36
37
  spec,
37
38
  @subspecs,
38
39
  @spec_sources,
39
- @use_modular_headers
40
+ @use_modular_headers,
41
+ @enable_bitcode
40
42
  )
41
43
 
42
44
  perform_build(
@@ -1,3 +1,3 @@
1
1
  module CocoapodsFramework
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,6 +1,21 @@
1
1
  module Pod
2
2
  module PodUtil
3
3
  include Config::Mixin
4
+
5
+ def to_native_platform name
6
+ case name
7
+ when 'iphoneos' then 'ios'
8
+ when 'macOS' then 'osx'
9
+ when 'appletvos' then 'tvos'
10
+ when 'watchos' then 'watchos'
11
+ when 'ios' then 'ios'
12
+ when 'macos' then 'osx'
13
+ when 'tvos' then 'tvos'
14
+ else
15
+ name
16
+ end
17
+ end
18
+
4
19
  def muti_config_with_file(path)
5
20
  return nil if path.nil?
6
21
  path = Pathname.new(path)
@@ -48,7 +63,7 @@ module Pod
48
63
  Sandbox.new(config.sandbox_root)
49
64
  end
50
65
 
51
- def installation_root sandbox, spec, subspecs, sources,use_frameworks = true,use_modular_headers = true
66
+ def installation_root sandbox, spec, subspecs, sources,use_frameworks = true,use_modular_headers = true, enable_bitcode = false
52
67
  podfile = podfile_from_spec(
53
68
  @path,
54
69
  spec,
@@ -64,6 +79,9 @@ module Pod
64
79
 
65
80
  unless installer.nil?
66
81
  installer.pods_project.targets.each do |target|
82
+ if enable_bitcode
83
+ configuration.build_settings['ENABLE_BITCODE'] = 'YES'
84
+ end
67
85
  if target.name == spec.name
68
86
  target.build_configurations.each do |configuration|
69
87
  configuration.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO'
@@ -75,7 +93,7 @@ module Pod
75
93
  installer
76
94
  end
77
95
 
78
- def installation_root_muti sandbox, configs, sources, use_frameworks = true, use_modular_headers = true
96
+ def installation_root_muti sandbox, configs, sources, use_frameworks = true, use_modular_headers = true, enable_bitcode = false
79
97
  podfile = podfile_from_muti_configs(
80
98
  configs,
81
99
  sources,
@@ -91,6 +109,9 @@ module Pod
91
109
  end
92
110
  unless installer.nil?
93
111
  installer.pods_project.targets.each do |target|
112
+ if enable_bitcode
113
+ configuration.build_settings['ENABLE_BITCODE'] = 'YES'
114
+ end
94
115
  if specs.include? target.name
95
116
  target.build_configurations.each do |configuration|
96
117
  configuration.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO'
@@ -202,5 +223,28 @@ module Pod
202
223
  end
203
224
  spec_hash
204
225
  end
226
+
227
+ def fix_header_file spec_hash, xcframework_path
228
+ puts "Dir.glob(#{xcframework_path}/*/) : #{Dir.glob("#{xcframework_path}/*/")}"
229
+ Dir.glob("#{xcframework_path}/*/").each do |file|
230
+ ['ios','macos','tvos', 'watchos'].each do |prefix|
231
+ last_path = file.split("/").last
232
+ if last_path =~ /#{prefix}/ and not last_path =~ /simulator/
233
+ platform = to_native_platform prefix
234
+ if spec_hash[platform]
235
+ spec_hash[platform]["public_header_files"] = "#{spec_hash[:vendored_frameworks]}/#{last_path}/*/Headers/*.h"
236
+ spec_hash[platform]["source_files"] = "#{spec_hash[:vendored_frameworks]}/#{last_path}/*/Headers/*.h"
237
+ else
238
+ spec_hash[platform] = {
239
+ "public_header_files" => "#{spec_hash[:vendored_frameworks]}/#{last_path}/*/Headers/*.h",
240
+ "source_files" => "#{spec_hash[:vendored_frameworks]}/#{last_path}/*/Headers/*.h"
241
+ }
242
+ end
243
+ end
244
+ end
245
+ end
246
+ puts spec_hash.to_json
247
+ spec_hash
248
+ end
205
249
  end
206
250
  end
@@ -159,6 +159,7 @@ module Pod
159
159
  outputs_bundle target_dir
160
160
  new_spec_hash = generic_new_podspec_hash @spec
161
161
  new_spec_hash[:vendored_frameworks] = "#{@spec.name}.xcframework"
162
+ new_spec_hash = fix_header_file new_spec_hash, "#{target_dir}/#{@spec.name}.xcframework"
162
163
  find_bundles(target_dir).each do |plat, value|
163
164
  if new_spec_hash[plat]
164
165
  new_spec_hash[plat]["resource_bundles"] = value
@@ -225,6 +226,7 @@ module Pod
225
226
  podspec = Pod::Specification.from_file podspec_path
226
227
  new_spec_hash = generic_new_podspec_hash podspec
227
228
  new_spec_hash[:vendored_frameworks] = "#{podspec.name}.xcframework"
229
+ new_spec_hash = fix_header_file new_spec_hash, "#{target_dir}/#{@spec.name}.xcframework"
228
230
  find_bundles("#{target_dir}/#{podspec.name}").each do |plat, value|
229
231
  if new_spec_hash[plat]
230
232
  new_spec_hash[plat]["resource_bundles"] = value
@@ -2,6 +2,7 @@ require 'xcodeproj'
2
2
  module Pod
3
3
  class XBuilder
4
4
  module XcodeProjHelper
5
+ include PodUtil
5
6
  def modify_xcode_project_sdk_to_simullator path
6
7
  sdks = xcode_sdks
7
8
  project = Xcodeproj::Project.open path
@@ -18,17 +19,6 @@ module Pod
18
19
  project.save
19
20
  end
20
21
 
21
- def to_native_platform name
22
- case name
23
- when 'iphoneos' then 'ios'
24
- when 'macOS' then 'osx'
25
- when 'appletvos' then 'tvos'
26
- when 'watchos' then 'watchos'
27
- else
28
- name
29
- end
30
- end
31
-
32
22
  private
33
23
  def xcode_sdks
34
24
  return @x_sdks if @x_sdks
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-xcframework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 戴易超
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-12 00:00:00.000000000 Z
11
+ date: 2021-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -92,14 +92,6 @@ files:
92
92
  - lib/cocoapods-framework/xbuilder/xcodeproj_helper.rb
93
93
  - lib/cocoapods_plugin.rb
94
94
  - pic/allplatform.png
95
- - pkg/cocoapods-framework-0.0.1.gem
96
- - pkg/cocoapods-framework-0.0.2.gem
97
- - pkg/cocoapods-framework-0.0.3.gem
98
- - pkg/cocoapods-xcframework-0.0.4.gem
99
- - pkg/cocoapods-xcframework-0.0.6.gem
100
- - pkg/cocoapods-xcframework-0.0.7.gem
101
- - pkg/cocoapods-xcframework-0.0.8.gem
102
- - pkg/cocoapods-xcframework-0.1.0.gem
103
95
  - spec/command/framework_spec.rb
104
96
  - spec/spec_helper.rb
105
97
  homepage: https://github.com/TyrantDante/cocoapods-framework
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file