cocoapods-xcframework 0.1.1 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-framework/command/framework.rb +4 -2
- data/lib/cocoapods-framework/frameworker.rb +5 -2
- data/lib/cocoapods-framework/gem_version.rb +1 -1
- data/lib/cocoapods-framework/util/pod_util.rb +52 -2
- data/lib/cocoapods-framework/xbuilder/xcodeproj_helper.rb +1 -11
- data/lib/cocoapods-framework/xbuilder.rb +2 -0
- metadata +3 -11
- data/pkg/cocoapods-framework-0.0.1.gem +0 -0
- data/pkg/cocoapods-framework-0.0.2.gem +0 -0
- data/pkg/cocoapods-framework-0.0.3.gem +0 -0
- data/pkg/cocoapods-xcframework-0.0.4.gem +0 -0
- data/pkg/cocoapods-xcframework-0.0.6.gem +0 -0
- data/pkg/cocoapods-xcframework-0.0.7.gem +0 -0
- data/pkg/cocoapods-xcframework-0.0.8.gem +0 -0
- data/pkg/cocoapods-xcframework-0.1.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e99edf4417908f688037fcf392a9f8d6f3052104e8014556caaa0a62c2c21d05
|
4
|
+
data.tar.gz: 0e04af6b8c148080de1475f8439c2507d220e55e47c3996fa3a6e5b6a7d8b4cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b18234bff2cce7ce5dd8382f5bb5ad09a14b42e17cd2efe5dff32f7cb3f3897f99110ad6ff438029ca7e504436e459a8b0f5c6e58af319137140ad97bdf52101
|
7
|
+
data.tar.gz: 73d534c46d058a22726bbc63495ab77862066dd4547a4d221421ccb6bca5b53034d3d76aedb6103760a960952d969346598f7ab31fff3c3b755967bb9c82df62
|
@@ -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
|
+
['--enable-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,9 @@ module Pod
|
|
36
37
|
spec,
|
37
38
|
@subspecs,
|
38
39
|
@spec_sources,
|
39
|
-
|
40
|
+
true,
|
41
|
+
@use_modular_headers,
|
42
|
+
@enable_bitcode
|
40
43
|
)
|
41
44
|
|
42
45
|
perform_build(
|
@@ -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,12 @@ module Pod
|
|
64
79
|
|
65
80
|
unless installer.nil?
|
66
81
|
installer.pods_project.targets.each do |target|
|
82
|
+
target.build_configurations.each do |configuration|
|
83
|
+
if enable_bitcode && configuration.name == "Release"
|
84
|
+
configuration.build_settings['ENABLE_BITCODE'] = 'YES'
|
85
|
+
configuration.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'
|
86
|
+
end
|
87
|
+
end
|
67
88
|
if target.name == spec.name
|
68
89
|
target.build_configurations.each do |configuration|
|
69
90
|
configuration.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO'
|
@@ -75,7 +96,7 @@ module Pod
|
|
75
96
|
installer
|
76
97
|
end
|
77
98
|
|
78
|
-
def installation_root_muti sandbox, configs, sources, use_frameworks = true, use_modular_headers = true
|
99
|
+
def installation_root_muti sandbox, configs, sources, use_frameworks = true, use_modular_headers = true, enable_bitcode = false
|
79
100
|
podfile = podfile_from_muti_configs(
|
80
101
|
configs,
|
81
102
|
sources,
|
@@ -91,6 +112,12 @@ module Pod
|
|
91
112
|
end
|
92
113
|
unless installer.nil?
|
93
114
|
installer.pods_project.targets.each do |target|
|
115
|
+
target.build_configurations.each do |configuration|
|
116
|
+
if enable_bitcode && configuration.name == "Release"
|
117
|
+
configuration.build_settings['ENABLE_BITCODE'] = 'YES'
|
118
|
+
configuration.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'
|
119
|
+
end
|
120
|
+
end
|
94
121
|
if specs.include? target.name
|
95
122
|
target.build_configurations.each do |configuration|
|
96
123
|
configuration.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO'
|
@@ -202,5 +229,28 @@ module Pod
|
|
202
229
|
end
|
203
230
|
spec_hash
|
204
231
|
end
|
232
|
+
|
233
|
+
def fix_header_file spec_hash, xcframework_path
|
234
|
+
puts "Dir.glob(#{xcframework_path}/*/) : #{Dir.glob("#{xcframework_path}/*/")}"
|
235
|
+
Dir.glob("#{xcframework_path}/*/").each do |file|
|
236
|
+
['ios','macos','tvos', 'watchos'].each do |prefix|
|
237
|
+
last_path = file.split("/").last
|
238
|
+
if last_path =~ /#{prefix}/ and not last_path =~ /simulator/
|
239
|
+
platform = to_native_platform prefix
|
240
|
+
if spec_hash[platform]
|
241
|
+
spec_hash[platform]["public_header_files"] = "#{spec_hash[:vendored_frameworks]}/#{last_path}/*/Headers/*.h"
|
242
|
+
spec_hash[platform]["source_files"] = "#{spec_hash[:vendored_frameworks]}/#{last_path}/*/Headers/*.h"
|
243
|
+
else
|
244
|
+
spec_hash[platform] = {
|
245
|
+
"public_header_files" => "#{spec_hash[:vendored_frameworks]}/#{last_path}/*/Headers/*.h",
|
246
|
+
"source_files" => "#{spec_hash[:vendored_frameworks]}/#{last_path}/*/Headers/*.h"
|
247
|
+
}
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
251
|
+
end
|
252
|
+
puts spec_hash.to_json
|
253
|
+
spec_hash
|
254
|
+
end
|
205
255
|
end
|
206
256
|
end
|
@@ -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
|
@@ -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
|
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.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 戴易超
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-16 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
|
@@ -121,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
113
|
- !ruby/object:Gem::Version
|
122
114
|
version: '0'
|
123
115
|
requirements: []
|
124
|
-
rubygems_version: 3.0.3
|
116
|
+
rubygems_version: 3.0.3.1
|
125
117
|
signing_key:
|
126
118
|
specification_version: 4
|
127
119
|
summary: 把podspec打包成xcframework的小工具。packager pod to a xcframework
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|