cocoapods-bb-bin 0.1.9.2 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-bb-bin/command/bin/auto.rb +4 -3
- data/lib/cocoapods-bb-bin/command/bin/tag.rb +136 -0
- data/lib/cocoapods-bb-bin/command/bin.rb +1 -0
- data/lib/cocoapods-bb-bin/gem_version.rb +1 -1
- data/lib/cocoapods-bb-bin/helpers/build_helper.rb +15 -0
- data/lib/cocoapods-bb-bin/helpers/push_spec_helper.rb +64 -0
- data/lib/cocoapods-bb-bin/helpers/spec_source_creator.rb +9 -0
- data/lib/cocoapods-bb-bin/helpers/upload_helper.rb +12 -27
- data/lib/cocoapods-bb-bin/native/podfile_generator.rb +70 -52
- metadata +15 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a39abb3bb7a0878383ec7f7b2a475b6af98f0c01f99cb1d85af3c5290fbd1deb
|
4
|
+
data.tar.gz: a50b6bd120d0e08571e4ed59c1a3be63c43e1684edb64c2c2a694ce714e2c831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '049d6a31b67b09bd3d4fcc24d408d6dbe1f778069c6230d61517038fd9d71584162d950e6b0de3a6609475e99de560e893d208709e742d25c99b771ac8399205'
|
7
|
+
data.tar.gz: 7ebb743aef0db3971d28250e7571edcda3fb3c7d27d1a9bb81c2f34d23e4fba5392b836aa84cee9109833fcd34648f8a0850ca8263157688597125f227ce9481
|
@@ -21,7 +21,8 @@ module Pod
|
|
21
21
|
['--no-zip', '不压缩静态 framework 为 zip'],
|
22
22
|
['--all-make', '对该组件的依赖库,全部制作为二进制组件'],
|
23
23
|
['--configuration', 'Build the specified configuration (e.g. Release ). Defaults to Debug'],
|
24
|
-
['--env', "该组件上传的环境 %w[dev debug_iphoneos release_iphoneos]"]
|
24
|
+
['--env', "该组件上传的环境 %w[dev debug_iphoneos release_iphoneos]"],
|
25
|
+
['--all-push', '上传二进制同时,允许同时推送源码索引'],
|
25
26
|
].concat(Pod::Command::Gen.options).concat(super).uniq
|
26
27
|
end
|
27
28
|
|
@@ -40,6 +41,7 @@ module Pod
|
|
40
41
|
@allow_prerelease = argv.flag?('allow-prerelease')
|
41
42
|
@framework_output = argv.flag?('framework-output', false )
|
42
43
|
@xcframework_output = argv.flag?('xcframework-output', false )
|
44
|
+
@pushsourcespec = argv.flag?('all-push', false )
|
43
45
|
@clean = argv.flag?('clean', true)
|
44
46
|
@zip = argv.flag?('zip', true)
|
45
47
|
@all_make = argv.flag?('all-make', false )
|
@@ -64,7 +66,7 @@ module Pod
|
|
64
66
|
fail_push_specs = []
|
65
67
|
sources_sepc.uniq.each do |spec|
|
66
68
|
begin
|
67
|
-
fail_push_specs << spec unless CBin::Upload::Helper.new(spec,@code_dependencies,@sources).upload
|
69
|
+
fail_push_specs << spec unless CBin::Upload::Helper.new(spec,@code_dependencies,@sources,@pushsourcespec).upload
|
68
70
|
rescue Object => exception
|
69
71
|
UI.puts exception
|
70
72
|
fail_push_specs << spec
|
@@ -84,7 +86,6 @@ module Pod
|
|
84
86
|
auto_success += "#{spec.name} | #{spec.version}\n"
|
85
87
|
UI.warn "===【 #{spec.name} | #{spec.version} 】二进制组件制作完成 !!! "
|
86
88
|
end
|
87
|
-
puts "============== auto_success"
|
88
89
|
puts auto_success
|
89
90
|
ENV['auto_success'] = auto_success
|
90
91
|
end
|
@@ -0,0 +1,136 @@
|
|
1
|
+
require 'cocoapods-bb-bin/native/podfile'
|
2
|
+
require 'cocoapods/command/gen'
|
3
|
+
require 'cocoapods/generate'
|
4
|
+
require 'xcodeproj'
|
5
|
+
require 'cocoapods-bb-bin/helpers/push_spec_helper'
|
6
|
+
require 'cocoapods-bb-bin/helpers/build_helper'
|
7
|
+
|
8
|
+
module Pod
|
9
|
+
class Command
|
10
|
+
class Bin < Command
|
11
|
+
class Tag < Bin
|
12
|
+
self.summary = '推送标签.'
|
13
|
+
|
14
|
+
self.arguments = [
|
15
|
+
CLAide::Argument.new('NAME.podspec', false)
|
16
|
+
]
|
17
|
+
def self.options
|
18
|
+
[
|
19
|
+
['--sources', '私有源地址,多个用分号区分'],
|
20
|
+
['--no-clean', '保留构建中间产物'],
|
21
|
+
].concat(Pod::Command::Gen.options).concat(super).uniq
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(argv)
|
25
|
+
@help = argv.flag?('help', false )
|
26
|
+
if @help
|
27
|
+
else
|
28
|
+
@env = argv.option('env') || 'dev'
|
29
|
+
CBin.config.set_configuration_env(@env)
|
30
|
+
|
31
|
+
@podspec = argv.shift_argument || find_podspec
|
32
|
+
@sources = argv.option('sources') || []
|
33
|
+
@clean = argv.flag?('no-clean', false)
|
34
|
+
@platform = Platform.new(:ios)
|
35
|
+
end
|
36
|
+
super
|
37
|
+
end
|
38
|
+
|
39
|
+
def validate!
|
40
|
+
help! "未找到 podspec文件" unless @podspec
|
41
|
+
super
|
42
|
+
end
|
43
|
+
|
44
|
+
def run
|
45
|
+
|
46
|
+
# 清除之前的缓存
|
47
|
+
CBin::Config::Builder.instance.clean
|
48
|
+
|
49
|
+
@spec = Specification.from_file(@podspec)
|
50
|
+
generate_project
|
51
|
+
swift_pods_buildsetting
|
52
|
+
if build_root_spec
|
53
|
+
# 工程编译ok,进行标签推送
|
54
|
+
push_helper = CBin::Push::Helper.new()
|
55
|
+
push_helper.push_source_repo(@podspec)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
#Dir.glob 可替代
|
60
|
+
def find_podspec
|
61
|
+
name = nil
|
62
|
+
Pathname.pwd.children.each do |child|
|
63
|
+
# puts child
|
64
|
+
if File.file?(child)
|
65
|
+
if child.extname == '.podspec'
|
66
|
+
name = File.basename(child)
|
67
|
+
unless name.include?("binary-template")
|
68
|
+
return name
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
raise Informative, "podspec File no exist, please check" unless name
|
74
|
+
return name
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
def build_root_spec
|
79
|
+
builder = CBin::Build::Helper.new(@spec,
|
80
|
+
@platform,
|
81
|
+
false,
|
82
|
+
false,
|
83
|
+
@sources,
|
84
|
+
true,
|
85
|
+
@spec,
|
86
|
+
CBin::Config::Builder.instance.white_pod_list.include?(@spec.name),
|
87
|
+
'Release')
|
88
|
+
builder.build
|
89
|
+
builder.clean_workspace if @clean && !@all_make
|
90
|
+
return builder.is_build_finish
|
91
|
+
end
|
92
|
+
def swift_pods_buildsetting
|
93
|
+
# swift_project_link_header
|
94
|
+
worksppace_path = File.expand_path("#{CBin::Config::Builder.instance.gen_dir}/#{@spec.name}")
|
95
|
+
path = File.join(worksppace_path, "Pods.xcodeproj")
|
96
|
+
path = File.join(worksppace_path, "Pods/Pods.xcodeproj") unless File.exist?(path)
|
97
|
+
raise Informative, "#{path} File no exist, please check" unless File.exist?(path)
|
98
|
+
project = Xcodeproj::Project.open(path)
|
99
|
+
project.build_configurations.each do |x|
|
100
|
+
x.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = true #设置生成swift inter
|
101
|
+
end
|
102
|
+
project.save
|
103
|
+
end
|
104
|
+
|
105
|
+
def generate_project
|
106
|
+
Podfile.execute_with_bin_plugin do
|
107
|
+
Podfile.execute_with_use_binaries(!@code_dependencies) do
|
108
|
+
argvs = [
|
109
|
+
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
110
|
+
"--gen-directory=#{CBin::Config::Builder.instance.gen_dir}",
|
111
|
+
'--clean',
|
112
|
+
"--verbose",
|
113
|
+
*@additional_args
|
114
|
+
]
|
115
|
+
podfile_path = Pod::Config.instance.podfile_path
|
116
|
+
if podfile_path && File.exist?(podfile_path)
|
117
|
+
argvs += ['--use-podfile']
|
118
|
+
end
|
119
|
+
|
120
|
+
if CBin::Build::Utils.uses_frameworks? # 组件库重新生成pod工程引入静态库需要使用该选项,否则报cocoapods中verify_no_static_framework_transitive_dependencies验证无法通过 by hm 21/10/18
|
121
|
+
argvs += ['--use-libraries']
|
122
|
+
end
|
123
|
+
|
124
|
+
argvs << @podspec if @podspec
|
125
|
+
# UI.puts "argvs:#{argvs}"
|
126
|
+
gen = Pod::Command::Gen.new(CLAide::ARGV.new(argvs))
|
127
|
+
gen.validate!
|
128
|
+
gen.run
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
@@ -7,6 +7,7 @@ require 'cocoapods-bb-bin/command/bin/code'
|
|
7
7
|
require 'cocoapods-bb-bin/command/bin/update'
|
8
8
|
require 'cocoapods-bb-bin/command/bin/install'
|
9
9
|
require 'cocoapods-bb-bin/command/bin/imy'
|
10
|
+
require 'cocoapods-bb-bin/command/bin/tag'
|
10
11
|
|
11
12
|
require 'cocoapods-bb-bin/helpers'
|
12
13
|
|
@@ -68,6 +68,21 @@ module CBin
|
|
68
68
|
|
69
69
|
end
|
70
70
|
|
71
|
+
def is_build_finish
|
72
|
+
if is_build_xcframework
|
73
|
+
path = xcframework_name_zip
|
74
|
+
else
|
75
|
+
path = framework_name_zip
|
76
|
+
end
|
77
|
+
output_path = File.join(zip_dir, path)
|
78
|
+
unless File.exist?(xcframework_name)
|
79
|
+
UI.puts "工程文件编译成功"
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
UI.puts "工程文件编译失败"
|
83
|
+
return false
|
84
|
+
end
|
85
|
+
|
71
86
|
# 是否编译xcframework库
|
72
87
|
def is_build_xcframework
|
73
88
|
if @xcframework_output == true
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'cocoapods-bb-bin/native/podfile'
|
2
|
+
require 'cocoapods/command/gen'
|
3
|
+
require 'cocoapods/generate'
|
4
|
+
require 'cocoapods-bb-bin/helpers/framework_builder'
|
5
|
+
require 'cocoapods-bb-bin/helpers/library_builder'
|
6
|
+
require 'cocoapods-bb-bin/helpers/sources_helper'
|
7
|
+
require 'cocoapods-bb-bin/command/bin/repo/push'
|
8
|
+
|
9
|
+
module CBin
|
10
|
+
class Push
|
11
|
+
class Helper
|
12
|
+
include CBin::SourcesHelper
|
13
|
+
|
14
|
+
def initialize()
|
15
|
+
end
|
16
|
+
|
17
|
+
# 上传二进制 podspec
|
18
|
+
def push_binary_repo(binary_podsepc_json)
|
19
|
+
argvs = [
|
20
|
+
"#{binary_source.name}", # repo
|
21
|
+
"#{binary_podsepc_json}", # spec
|
22
|
+
"--binary",
|
23
|
+
"--sources=#{binary_source},https:\/\/cdn.cocoapods.org",
|
24
|
+
"--skip-import-validation",
|
25
|
+
"--use-libraries",
|
26
|
+
"--allow-warnings",
|
27
|
+
"--verbose",
|
28
|
+
"--code-dependencies",
|
29
|
+
'--no-cocoapods-validator', #不采用cocoapods验证
|
30
|
+
]
|
31
|
+
if @verbose
|
32
|
+
argvs += ['--verbose']
|
33
|
+
end
|
34
|
+
Pod::UI.message "上传二进制 argvs: #{argvs}"
|
35
|
+
push = Pod::Command::Bin::Repo::Push.new(CLAide::ARGV.new(argvs))
|
36
|
+
push.validate!
|
37
|
+
push.run
|
38
|
+
end
|
39
|
+
|
40
|
+
# 上传源码podspec
|
41
|
+
def push_source_repo(source_podsepc_json)
|
42
|
+
argvs = [
|
43
|
+
"#{code_source.name}", # repo
|
44
|
+
"#{source_podsepc_json}", # spec
|
45
|
+
"--sources=#{code_source},https:\/\/cdn.cocoapods.org",
|
46
|
+
"--skip-import-validation",
|
47
|
+
"--use-libraries",
|
48
|
+
"--allow-warnings",
|
49
|
+
"--verbose",
|
50
|
+
"--code-dependencies",
|
51
|
+
'--no-cocoapods-validator', #不采用cocoapods验证
|
52
|
+
]
|
53
|
+
if @verbose
|
54
|
+
argvs += ['--verbose']
|
55
|
+
end
|
56
|
+
Pod::UI.message "上传源码 argvs: #{argvs}"
|
57
|
+
push = Pod::Command::Bin::Repo::Push.new(CLAide::ARGV.new(argvs))
|
58
|
+
push.validate!
|
59
|
+
push.run
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -43,15 +43,24 @@ module CBin
|
|
43
43
|
end
|
44
44
|
|
45
45
|
@filename = file
|
46
|
+
# Pod::UI::puts "===copy origin file: #{file}"
|
47
|
+
# Pod::UI::puts "===copy desc file: #{sourceSpecFilePath}"
|
48
|
+
# 拷贝二进制spec到源码spec by hm 22/1/19
|
49
|
+
`cp -fa #{file} #{sourceSpecFilePath}`
|
46
50
|
end
|
47
51
|
|
48
52
|
def clear_spec_file
|
49
53
|
File.delete(filename) if File.exist?(filename)
|
50
54
|
end
|
51
55
|
|
56
|
+
# 二进制spec路径
|
52
57
|
def filename
|
53
58
|
@filename ||= "#{CBin::Config::Builder.instance.binary_json_dir_name}/#{spec.name}.binary.podspec.json"
|
54
59
|
end
|
60
|
+
# 源码spec路径(指向二进制库)
|
61
|
+
def sourceSpecFilePath
|
62
|
+
@sourcefilename ||= "#{CBin::Config::Builder.instance.binary_json_dir_name}/#{spec.name}.podspec.json"
|
63
|
+
end
|
55
64
|
|
56
65
|
private
|
57
66
|
|
@@ -8,17 +8,18 @@ require 'cocoapods/generate'
|
|
8
8
|
require 'cocoapods-bb-bin/helpers/framework_builder'
|
9
9
|
require 'cocoapods-bb-bin/helpers/library_builder'
|
10
10
|
require 'cocoapods-bb-bin/helpers/sources_helper'
|
11
|
-
require 'cocoapods-bb-bin/
|
11
|
+
require 'cocoapods-bb-bin/helpers/push_spec_helper'
|
12
12
|
|
13
13
|
module CBin
|
14
14
|
class Upload
|
15
15
|
class Helper
|
16
16
|
include CBin::SourcesHelper
|
17
17
|
|
18
|
-
def initialize(spec,code_dependencies,sources)
|
18
|
+
def initialize(spec,code_dependencies,sources, pushsourcespec = false)
|
19
19
|
@spec = spec
|
20
20
|
@code_dependencies = code_dependencies
|
21
21
|
@sources = sources
|
22
|
+
@pushsourcespec = pushsourcespec # 推送源码
|
22
23
|
end
|
23
24
|
|
24
25
|
def upload
|
@@ -29,7 +30,14 @@ module CBin
|
|
29
30
|
res_zip = curl_zip
|
30
31
|
if res_zip
|
31
32
|
filename = spec_creator
|
32
|
-
|
33
|
+
Pod::UI.message "上传二进制 podspec: #{filename}"
|
34
|
+
push_helper = CBin::Push::Helper.new()
|
35
|
+
push_helper.push_binary_repo(filename)
|
36
|
+
# 上传源码 podspec
|
37
|
+
if @pushsourcespec
|
38
|
+
Pod::UI.message "上传源码 podspec: #{@spec_creator.sourceSpecFilePath}"
|
39
|
+
push_helper.push_source_repo(@spec_creator.sourceSpecFilePath)
|
40
|
+
end
|
33
41
|
end
|
34
42
|
res_zip
|
35
43
|
end
|
@@ -37,6 +45,7 @@ module CBin
|
|
37
45
|
|
38
46
|
def spec_creator
|
39
47
|
spec_creator = CBin::SpecificationSource::Creator.new(@spec)
|
48
|
+
@spec_creator = spec_creator
|
40
49
|
spec_creator.create
|
41
50
|
spec_creator.write_spec_file
|
42
51
|
spec_creator.filename
|
@@ -69,30 +78,6 @@ EOF
|
|
69
78
|
res
|
70
79
|
end
|
71
80
|
|
72
|
-
|
73
|
-
# 上传二进制 podspec
|
74
|
-
def push_binary_repo(binary_podsepc_json)
|
75
|
-
argvs = [
|
76
|
-
"#{binary_source.name}", # repo
|
77
|
-
"#{binary_podsepc_json}", # spec
|
78
|
-
"--binary",
|
79
|
-
"--sources=#{sources_option(@code_dependencies, @sources)},https:\/\/cdn.cocoapods.org",
|
80
|
-
"--skip-import-validation",
|
81
|
-
"--use-libraries",
|
82
|
-
"--allow-warnings",
|
83
|
-
"--verbose",
|
84
|
-
"--code-dependencies",
|
85
|
-
'--no-cocoapods-validator', #不采用cocoapods验证
|
86
|
-
]
|
87
|
-
if @verbose
|
88
|
-
argvs += ['--verbose']
|
89
|
-
end
|
90
|
-
|
91
|
-
push = Pod::Command::Bin::Repo::Push.new(CLAide::ARGV.new(argvs))
|
92
|
-
push.validate!
|
93
|
-
push.run
|
94
|
-
end
|
95
|
-
|
96
81
|
end
|
97
82
|
end
|
98
83
|
end
|
@@ -15,18 +15,16 @@ module Pod
|
|
15
15
|
class PodfileGenerator
|
16
16
|
# @return [Podfile] a podfile suitable for installing the given spec
|
17
17
|
#
|
18
|
-
# @param [Specification]
|
18
|
+
# @param [Array<Specification>] specs
|
19
19
|
#
|
20
|
-
|
21
|
-
|
22
|
-
def podfile_for_spec(spec)
|
20
|
+
def podfile_for_specs(specs)
|
23
21
|
generator = self
|
24
|
-
dir = configuration.
|
25
|
-
project_name = configuration.
|
22
|
+
dir = configuration.gen_dir_for_specs(specs)
|
23
|
+
project_name = configuration.project_name_for_specs(specs)
|
26
24
|
|
27
25
|
Pod::Podfile.new do
|
28
26
|
project "#{project_name}.xcodeproj"
|
29
|
-
workspace "#{
|
27
|
+
workspace "#{project_name}.xcworkspace"
|
30
28
|
|
31
29
|
plugin 'cocoapods-generate'
|
32
30
|
|
@@ -35,8 +33,8 @@ module Pod
|
|
35
33
|
generator.podfile_plugins.each do |name, options|
|
36
34
|
plugin(*[name, options].compact)
|
37
35
|
end
|
38
|
-
|
39
|
-
use_frameworks!(generator.
|
36
|
+
|
37
|
+
use_frameworks!(generator.use_frameworks_value)
|
40
38
|
|
41
39
|
if (supported_swift_versions = generator.supported_swift_versions)
|
42
40
|
supports_swift_versions(supported_swift_versions)
|
@@ -49,44 +47,51 @@ module Pod
|
|
49
47
|
|
50
48
|
self.defined_in_file = dir.join('CocoaPods.podfile.yaml')
|
51
49
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
50
|
+
test_specs_by_spec = Hash[specs.map do |spec|
|
51
|
+
[spec, spec.recursive_subspecs.select(&:test_specification?)]
|
52
|
+
end]
|
53
|
+
app_specs_by_spec = Hash[specs.map do |spec|
|
54
|
+
app_specs = if spec.respond_to?(:app_specification?)
|
55
|
+
spec.recursive_subspecs.select(&:app_specification?)
|
56
|
+
else
|
57
|
+
[]
|
58
|
+
end
|
59
|
+
[spec, app_specs]
|
60
|
+
end]
|
58
61
|
|
59
62
|
# Stick all of the transitive dependencies in an abstract target.
|
60
63
|
# This allows us to force CocoaPods to use the versions / sources / external sources
|
61
64
|
# that we want.
|
62
|
-
|
63
|
-
|
65
|
+
|
64
66
|
# 会导致多个dependencies出现, 注释by slj
|
65
67
|
# abstract_target 'Transitive Dependencies' do
|
66
|
-
# pods_for_transitive_dependencies =
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
68
|
+
# pods_for_transitive_dependencies = specs.flat_map do |spec|
|
69
|
+
# [spec.name]
|
70
|
+
# .concat(test_specs_by_spec.keys.map(&:name))
|
71
|
+
# .concat(test_specs_by_spec.values.flatten.flat_map { |ts| ts.dependencies.flat_map(&:name) })
|
72
|
+
# .concat(app_specs_by_spec.keys.map(&:name))
|
73
|
+
# .concat(app_specs_by_spec.values.flatten.flat_map { |as| as.dependencies.flat_map(&:name) })
|
74
|
+
# end
|
75
|
+
# pods_for_transitive_dependencies.uniq!
|
76
|
+
|
77
|
+
# spec_names = specs.map { |s| s.root.name }.to_set
|
72
78
|
# dependencies = generator
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
|
79
|
+
# .transitive_dependencies_by_pod
|
80
|
+
# .values_at(*pods_for_transitive_dependencies)
|
81
|
+
# .compact
|
82
|
+
# .flatten(1)
|
83
|
+
# .uniq
|
84
|
+
# .sort_by(&:name)
|
85
|
+
# .reject { |d| spec_names.include?(d.root_name) }
|
86
|
+
|
81
87
|
# dependencies.each do |dependency|
|
82
88
|
# pod_args = generator.pod_args_for_dependency(self, dependency)
|
83
89
|
# pod(*pod_args)
|
84
90
|
# end
|
85
91
|
# end
|
86
92
|
|
87
|
-
# Add platform-specific concrete targets that inherit the
|
88
|
-
|
89
|
-
spec_platform_names = spec.available_platforms.map(&:string_name).flatten.each.reject do |platform_name|
|
93
|
+
# Add platform-specific concrete targets that inherit the `pod` declaration for the local pod.
|
94
|
+
spec_platform_names = specs.flat_map { |s| s.available_platforms.map(&:string_name) }.uniq.each.reject do |platform_name|
|
90
95
|
!generator.configuration.platforms.nil? && !generator.configuration.platforms.include?(platform_name.downcase)
|
91
96
|
end
|
92
97
|
|
@@ -98,8 +103,16 @@ module Pod
|
|
98
103
|
|
99
104
|
# this block has to come _before_ inhibit_all_warnings! / use_modular_headers!,
|
100
105
|
# and the local `pod` declaration
|
101
|
-
#
|
102
|
-
|
106
|
+
# current_target_definition.instance_exec do
|
107
|
+
# transitive_dependencies = children.find { |c| c.name == 'Transitive Dependencies' }
|
108
|
+
|
109
|
+
# %w[use_modular_headers inhibit_warnings].each do |key|
|
110
|
+
# Pod::UI::puts "====key:#{key} value:#{value}"
|
111
|
+
# value = transitive_dependencies.send(:internal_hash).delete(key)
|
112
|
+
# next if value.blank?
|
113
|
+
# set_hash_value(key, value)
|
114
|
+
# end
|
115
|
+
# end
|
103
116
|
|
104
117
|
inhibit_all_warnings! if generator.inhibit_all_warnings?
|
105
118
|
# use_modular_headers! if generator.use_modular_headers?
|
@@ -112,15 +125,18 @@ module Pod
|
|
112
125
|
use_modular_headers!
|
113
126
|
end
|
114
127
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
{ testspecs: test_specs, appspecs: app_specs }.each do |key, specs|
|
120
|
-
pod_options[key] = specs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort unless specs.empty?
|
121
|
-
end
|
128
|
+
specs.each do |spec|
|
129
|
+
# This is the pod declaration for the local pod,
|
130
|
+
# it will be inherited by the concrete target definitions below
|
131
|
+
pod_options = generator.dependency_compilation_kwargs(spec.name)
|
122
132
|
|
123
|
-
|
133
|
+
path = spec.defined_in_file.relative_path_from(dir).to_s
|
134
|
+
pod_options[:path] = path
|
135
|
+
{ testspecs: test_specs_by_spec[spec], appspecs: app_specs_by_spec[spec] }.each do |key, subspecs|
|
136
|
+
pod_options[key] = subspecs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort unless subspecs.blank?
|
137
|
+
end
|
138
|
+
pod spec.name, **pod_options
|
139
|
+
end
|
124
140
|
|
125
141
|
if Pod::Config.instance.podfile
|
126
142
|
target_definitions['Pods'].instance_exec do
|
@@ -187,14 +203,16 @@ module Pod
|
|
187
203
|
|
188
204
|
# Implement local-sources option to set up dependencies to podspecs in the local filesystem.
|
189
205
|
next if generator.configuration.local_sources.empty?
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
206
|
+
specs.each do |spec|
|
207
|
+
generator.transitive_local_dependencies(spec, generator.configuration.local_sources).sort_by(&:first).each do |dependency, podspec_file|
|
208
|
+
pod_options = generator.dependency_compilation_kwargs(dependency.name)
|
209
|
+
pod_options[:path] = if podspec_file[0] == '/' # absolute path
|
210
|
+
podspec_file
|
211
|
+
else
|
212
|
+
'../../' + podspec_file
|
213
|
+
end
|
214
|
+
pod dependency.name, **pod_options
|
215
|
+
end
|
198
216
|
end
|
199
217
|
end
|
200
218
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-bb-bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- humin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -48,16 +48,22 @@ dependencies:
|
|
48
48
|
name: cocoapods-generate
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.2'
|
54
|
+
- - "<"
|
52
55
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
56
|
+
version: '3.0'
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
|
-
- - "
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '2.2'
|
64
|
+
- - "<"
|
59
65
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
66
|
+
version: '3.0'
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: cocoapods-bb-xcframework
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -131,6 +137,7 @@ files:
|
|
131
137
|
- lib/cocoapods-bb-bin/command/bin/repo/push.rb
|
132
138
|
- lib/cocoapods-bb-bin/command/bin/repo/update.rb
|
133
139
|
- lib/cocoapods-bb-bin/command/bin/spec/create.rb
|
140
|
+
- lib/cocoapods-bb-bin/command/bin/tag.rb
|
134
141
|
- lib/cocoapods-bb-bin/command/bin/update.rb
|
135
142
|
- lib/cocoapods-bb-bin/config/config.rb
|
136
143
|
- lib/cocoapods-bb-bin/config/config_asker.rb
|
@@ -146,6 +153,7 @@ files:
|
|
146
153
|
- lib/cocoapods-bb-bin/helpers/framework_builder.rb
|
147
154
|
- lib/cocoapods-bb-bin/helpers/library.rb
|
148
155
|
- lib/cocoapods-bb-bin/helpers/library_builder.rb
|
156
|
+
- lib/cocoapods-bb-bin/helpers/push_spec_helper.rb
|
149
157
|
- lib/cocoapods-bb-bin/helpers/sources_helper.rb
|
150
158
|
- lib/cocoapods-bb-bin/helpers/spec_creator.rb
|
151
159
|
- lib/cocoapods-bb-bin/helpers/spec_files_helper.rb
|
@@ -197,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
205
|
- !ruby/object:Gem::Version
|
198
206
|
version: '0'
|
199
207
|
requirements: []
|
200
|
-
rubygems_version: 3.
|
208
|
+
rubygems_version: 3.3.5
|
201
209
|
signing_key:
|
202
210
|
specification_version: 4
|
203
211
|
summary: cocoapods-bb-bin is a plugin which helps develpers switching pods between
|