cocoapods-imy-bin 0.3.1.3 → 0.3.1.21
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 +4 -4
- data/README.md +3 -0
- data/lib/cocoapods-imy-bin/command/bin/archive.rb +18 -20
- data/lib/cocoapods-imy-bin/command/bin/auto.rb +12 -9
- data/lib/cocoapods-imy-bin/command/bin/clean.rb +126 -0
- data/lib/cocoapods-imy-bin/command/bin/local.rb +169 -0
- data/lib/cocoapods-imy-bin/command/bin/update.rb +14 -3
- data/lib/cocoapods-imy-bin/command/bin.rb +2 -0
- data/lib/cocoapods-imy-bin/config/config.rb +8 -0
- data/lib/cocoapods-imy-bin/gem_version.rb +1 -1
- data/lib/cocoapods-imy-bin/helpers/build_utils.rb +40 -9
- data/lib/cocoapods-imy-bin/helpers/framework_builder.rb +1 -1
- data/lib/cocoapods-imy-bin/helpers/local/loca_llibrary.rb +57 -0
- data/lib/cocoapods-imy-bin/helpers/local/local_build_helper.rb +183 -0
- data/lib/cocoapods-imy-bin/helpers/local/local_framework.rb +85 -0
- data/lib/cocoapods-imy-bin/helpers/local/local_framework_builder.rb +227 -0
- data/lib/cocoapods-imy-bin/helpers/local/local_library_builder.rb +96 -0
- data/lib/cocoapods-imy-bin/helpers/spec_source_creator.rb +10 -4
- data/lib/cocoapods-imy-bin/helpers/upload_helper.rb +5 -3
- data/lib/cocoapods-imy-bin/native/Downloader.rb +68 -0
- data/lib/cocoapods-imy-bin/native/Lockfile.rb +36 -0
- data/lib/cocoapods-imy-bin/native/installer.rb +6 -0
- data/lib/cocoapods-imy-bin/native/podfile.rb +7 -0
- data/lib/cocoapods-imy-bin/native/podfile_env.rb +5 -0
- data/lib/cocoapods-imy-bin/native/resolver.rb +10 -5
- data/lib/cocoapods-imy-bin/native.rb +3 -1
- data/lib/cocoapods-imy-bin/post_install_hook.rb +110 -0
- data/lib/cocoapods-imy-bin/source_provider_hook.rb +3 -0
- data/lib/cocoapods_plugin.rb +1 -0
- metadata +16 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8437b35eb1e2e055b25903d650608ff5efded69cdcb33f31d511ed8c5c5779c7
|
4
|
+
data.tar.gz: ab134be81f4b228d7d6456f8afb15171170c99797aabfc4fbdb90eb645bb3db3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4a3e25504e6d3c2083c0ff460e2d4ab05016124655df9ee293abd08ecd2097ec0b6704cb299d71138458521237b560795efb64a7beb75288b4812567115f7fa
|
7
|
+
data.tar.gz: 634b5f9bfa23d62d1d201429dc117c115edeaa3d9d80cb21f69c838d8078db41eed61382809e0ebd8a1464a935bf3a7dca8084d892a24d1b59b4836c23882c43
|
data/README.md
CHANGED
@@ -63,24 +63,23 @@ module Pod
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def run
|
66
|
-
|
67
|
-
CBin::Config::Builder.instance.
|
66
|
+
#清除之前的缓存
|
67
|
+
zip_dir = CBin::Config::Builder.instance.zip_dir
|
68
|
+
FileUtils.rm_rf(zip_dir) if File.exist?(zip_dir)
|
68
69
|
|
69
70
|
@spec = Specification.from_file(spec_file)
|
70
71
|
generate_project
|
71
72
|
|
72
73
|
swift_pods_buildsetting
|
74
|
+
source_specs = Array.new
|
75
|
+
source_specs.concat(build_root_spec)
|
76
|
+
source_specs.concat(build_dependencies) if @all_make
|
73
77
|
|
74
|
-
|
75
|
-
|
76
|
-
sources_sepc = Array.new
|
77
|
-
sources_sepc << @spec
|
78
|
-
sources_sepc.concat(build_dependencies) if @all_make
|
79
|
-
|
80
|
-
sources_sepc
|
78
|
+
source_specs
|
81
79
|
end
|
82
80
|
|
83
81
|
def build_root_spec
|
82
|
+
source_specs = []
|
84
83
|
builder = CBin::Build::Helper.new(@spec,
|
85
84
|
@platform,
|
86
85
|
@framework_output,
|
@@ -90,12 +89,15 @@ module Pod
|
|
90
89
|
@config)
|
91
90
|
builder.build
|
92
91
|
builder.clean_workspace if @clean && !@all_make
|
92
|
+
source_specs << @spec unless CBin::Config::Builder.instance.white_pod_list.include?(@spec.name)
|
93
|
+
|
94
|
+
source_specs
|
93
95
|
end
|
94
96
|
|
95
97
|
def build_dependencies
|
96
98
|
@build_finshed = true
|
97
99
|
#如果没要求,就清空依赖库数据
|
98
|
-
|
100
|
+
source_specs = []
|
99
101
|
@@missing_binary_specs.uniq.each do |spec|
|
100
102
|
next if spec.name.include?('/')
|
101
103
|
next if spec.name == @spec.name
|
@@ -115,11 +117,11 @@ module Pod
|
|
115
117
|
next if spec.attributes_hash['vendored_frameworks'] && @spec.name != spec.name #过滤带有vendored_frameworks的
|
116
118
|
next if spec.attributes_hash['ios.vendored_frameworks'] && @spec.name != spec.name #过滤带有vendored_frameworks的
|
117
119
|
#获取没有制作二进制版本的spec集合
|
118
|
-
|
120
|
+
source_specs << spec
|
119
121
|
end
|
120
122
|
|
121
123
|
fail_build_specs = []
|
122
|
-
|
124
|
+
source_specs.uniq.each do |spec|
|
123
125
|
begin
|
124
126
|
builder = CBin::Build::Helper.new(spec,
|
125
127
|
@platform,
|
@@ -140,7 +142,7 @@ module Pod
|
|
140
142
|
UI.warn "【#{spec.name} | #{spec.version}】组件二进制版本编译失败 ."
|
141
143
|
end
|
142
144
|
end
|
143
|
-
|
145
|
+
source_specs - fail_build_specs
|
144
146
|
end
|
145
147
|
|
146
148
|
# 解析器传过来的
|
@@ -157,18 +159,14 @@ module Pod
|
|
157
159
|
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
158
160
|
"--gen-directory=#{CBin::Config::Builder.instance.gen_dir}",
|
159
161
|
'--clean',
|
160
|
-
"--verbose",
|
161
162
|
*@additional_args
|
162
163
|
]
|
163
164
|
|
164
|
-
|
165
|
+
podfile= File.join(Pathname.pwd, "Podfile")
|
166
|
+
if File.exist?(podfile)
|
165
167
|
argvs += ['--use-podfile']
|
166
168
|
end
|
167
|
-
|
168
|
-
unless CBin::Build::Utils.uses_frameworks?
|
169
|
-
argvs += ['--use-libraries']
|
170
|
-
end
|
171
|
-
|
169
|
+
|
172
170
|
argvs << spec_file if spec_file
|
173
171
|
|
174
172
|
gen = Pod::Command::Gen.new(CLAide::ARGV.new(argvs))
|
@@ -54,10 +54,13 @@ module Pod
|
|
54
54
|
def run
|
55
55
|
@specification = Specification.from_file(@podspec)
|
56
56
|
|
57
|
+
unless @podspec
|
58
|
+
raise Informative, "未找到 podspec文件"
|
59
|
+
end
|
57
60
|
sources_sepc = run_archive
|
58
61
|
|
59
62
|
fail_push_specs = []
|
60
|
-
|
63
|
+
source_specs.uniq.each do |spec|
|
61
64
|
begin
|
62
65
|
fail_push_specs << spec unless CBin::Upload::Helper.new(spec,@code_dependencies,@sources).upload
|
63
66
|
rescue Object => exception
|
@@ -72,7 +75,7 @@ module Pod
|
|
72
75
|
end
|
73
76
|
end
|
74
77
|
|
75
|
-
success_specs =
|
78
|
+
success_specs = source_specs - fail_push_specs
|
76
79
|
if success_specs.any?
|
77
80
|
auto_success = ""
|
78
81
|
success_specs.uniq.each do |spec|
|
@@ -123,11 +126,11 @@ module Pod
|
|
123
126
|
argvs += ["--env=#{@env}"]
|
124
127
|
end
|
125
128
|
argvs += ["--configuration=#{@config}"]
|
126
|
-
|
129
|
+
|
127
130
|
archive = Pod::Command::Bin::Archive.new(CLAide::ARGV.new(argvs))
|
128
131
|
archive.validate!
|
129
|
-
|
130
|
-
|
132
|
+
source_specs = archive.run
|
133
|
+
source_specs
|
131
134
|
end
|
132
135
|
|
133
136
|
|
@@ -183,10 +186,10 @@ module Pod
|
|
183
186
|
puts child
|
184
187
|
if File.file?(child)
|
185
188
|
if child.extname == '.podspec'
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
189
|
+
name = File.basename(child)
|
190
|
+
unless name.include?("binary-template")
|
191
|
+
return name
|
192
|
+
end
|
190
193
|
end
|
191
194
|
end
|
192
195
|
end
|
@@ -0,0 +1,126 @@
|
|
1
|
+
require 'cocoapods-imy-bin/config/config_hot_key_asker'
|
2
|
+
require 'tmpdir'
|
3
|
+
|
4
|
+
module Pod
|
5
|
+
class Command
|
6
|
+
class Bin < Command
|
7
|
+
class Clean < Bin
|
8
|
+
self.summary = '清除缓存'
|
9
|
+
self.description = <<-DESC
|
10
|
+
清除缓存
|
11
|
+
1、清除私有源spec仓库缓存
|
12
|
+
2、清除二进制仓库编译产物
|
13
|
+
DESC
|
14
|
+
|
15
|
+
def self.options
|
16
|
+
[
|
17
|
+
['--env=configuration_env', '清除哪个环境,在.cocoapods下的 bin_dev.yml的配置项,dev'],
|
18
|
+
['--list=[module,module,...]', '清除某个仓库下的模块 TODO'],
|
19
|
+
['--all', '清除所有 TODO'],
|
20
|
+
].concat(Pod::Command::Gen.options).concat(super).uniq
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
def initialize(argv)
|
25
|
+
@env = argv.option('env') || nil
|
26
|
+
@list = argv.flag?('list', [] )
|
27
|
+
@all_clean = argv.flag?('all', false )
|
28
|
+
|
29
|
+
@config = Pod::Config.instance
|
30
|
+
|
31
|
+
super
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
def run
|
36
|
+
#清除所有仓库缓存
|
37
|
+
if @all_clean
|
38
|
+
|
39
|
+
elsif @env #是否存在spec仓库
|
40
|
+
#获取对应环境地址
|
41
|
+
CBin.config.set_configuration_env(@env)
|
42
|
+
@config = CBin.config
|
43
|
+
unless @config
|
44
|
+
raise "请检查 env = #{@env} 私有源仓库是否设置正常"
|
45
|
+
end
|
46
|
+
|
47
|
+
# #1、清除git
|
48
|
+
reset_binary_repo
|
49
|
+
# #2、更新本地仓库源
|
50
|
+
update_cocoapods_repo
|
51
|
+
#3、删除二进制私有源存储二进制文件
|
52
|
+
update_cocoapods_repo
|
53
|
+
|
54
|
+
delete_build_binary
|
55
|
+
#4、清除cocoapods pods cache
|
56
|
+
update_cocopods_pods_cache
|
57
|
+
|
58
|
+
# @config.clean_binary_url
|
59
|
+
else #不存在spec仓库、就抛异常
|
60
|
+
raise "未设置 spec 私有源仓库"
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
#一、清除git上的仓库
|
66
|
+
# 1、拿到仓库地址 CBin.config.binary_repo_url
|
67
|
+
# 2、clone仓库
|
68
|
+
# 3、删除仓库下所有可见目录,除了.git
|
69
|
+
# 4、提交删除记录
|
70
|
+
def reset_binary_repo
|
71
|
+
work_dir = Dir.tmpdir + '/cocoapods-imy-bin-' + Array.new(8) { rand(36).to_s(36) }.join
|
72
|
+
UI.puts "临时目录 work_dir = #{work_dir}"
|
73
|
+
Pathname.new(work_dir).mkdir
|
74
|
+
|
75
|
+
`git clone #{@config.binary_repo_url} #{work_dir}`
|
76
|
+
|
77
|
+
deleteDirectory(work_dir)
|
78
|
+
UI.puts "binary_repo_url = #{@config.binary_repo_url}"
|
79
|
+
|
80
|
+
#在当前目录下 做git操作,才能提交成功
|
81
|
+
Dir.chdir(work_dir) do
|
82
|
+
UI.puts "当前目录 = #{Dir.pwd}"
|
83
|
+
`git add .`
|
84
|
+
`git commit -m "cocopods-imy-bin auto del"`
|
85
|
+
`/usr/bin/git push`
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
#二、更新本地仓库源,
|
91
|
+
# pod repo update xxx
|
92
|
+
def update_cocoapods_repo
|
93
|
+
`pod repo update`
|
94
|
+
UI.puts "完成pod repo update"
|
95
|
+
end
|
96
|
+
|
97
|
+
#三、删除二进制私有源存储二进制文件,
|
98
|
+
def delete_build_binary
|
99
|
+
`curl #{@config.delete_binary_url}`
|
100
|
+
UI.puts "完成删除服务器二进制包"
|
101
|
+
end
|
102
|
+
|
103
|
+
#四、清除cocoapods pods cache
|
104
|
+
def update_cocopods_pods_cache
|
105
|
+
`pod cache clean --all --verbose`
|
106
|
+
UI.puts "完成清除本地pod cache"
|
107
|
+
end
|
108
|
+
|
109
|
+
|
110
|
+
#遍历文件夹
|
111
|
+
def deleteDirectory(dirPath)
|
112
|
+
if File.directory?(dirPath)
|
113
|
+
puts "是文件夹";
|
114
|
+
Dir.foreach(dirPath) do |subFile|
|
115
|
+
if subFile != '.' and subFile != '..' and subFile != ".git"
|
116
|
+
FileUtils.remove_entry(File.join(dirPath, subFile))
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
@@ -0,0 +1,169 @@
|
|
1
|
+
|
2
|
+
require 'cocoapods-imy-bin/native/podfile'
|
3
|
+
require 'cocoapods/command/gen'
|
4
|
+
require 'cocoapods/generate'
|
5
|
+
require 'cocoapods-imy-bin/helpers/local/local_framework_builder'
|
6
|
+
require 'cocoapods-imy-bin/helpers/local/local_library_builder'
|
7
|
+
require 'cocoapods-imy-bin/helpers/local/local_build_helper'
|
8
|
+
require 'cocoapods-imy-bin/helpers/spec_source_creator'
|
9
|
+
require 'cocoapods-imy-bin/config/config_builder'
|
10
|
+
|
11
|
+
module Pod
|
12
|
+
class Command
|
13
|
+
class Bin < Command
|
14
|
+
class Local < Bin
|
15
|
+
self.summary = '根据podfile中信息 将本地已存在的组件静态包 归档,需要归档的组件由外部传入'
|
16
|
+
self.description = <<-DESC
|
17
|
+
根据podfile中信息 将本地已存在的组件静态包 归档,需要归档的组件由外部传入
|
18
|
+
仅支持 iOS 平台
|
19
|
+
此静态 framework/.a 不包含依赖组件的 symbol
|
20
|
+
|
21
|
+
一个用ccache,一个是cocoapods-imy-bin插件支持下的,
|
22
|
+
拿xcodebuild生成的中间构建产物,如生成的 libIMYYQHome.a,利用cocoapods-imy-bin 制作成二进制静态库,保存起来。
|
23
|
+
下次pod update 工程时,在pod update时去捞已经生成的二进制组件打包。这样可以大大减少编译时间
|
24
|
+
|
25
|
+
制作流程:
|
26
|
+
每次pod update 时记录无二进制组件的库,build完后,自动制作缺失二进制组件库。
|
27
|
+
如果pod update 时无二进制组件的库,采用源码编译,源码编译同时有ccache缓存支持,也能加快速度
|
28
|
+
DESC
|
29
|
+
|
30
|
+
def self.options
|
31
|
+
[
|
32
|
+
['--no-clean', '保留构建中间产物'],
|
33
|
+
['--framework-output', '输出framework文件'],
|
34
|
+
['--no-zip', '不压缩静态 framework 为 zip'],
|
35
|
+
['--make-binary-specs', '需要制作spec集合'],
|
36
|
+
['--env', "该组件上传的环境 %w[dev debug_iphoneos release_iphoneos]"]
|
37
|
+
].concat(Pod::Command::Gen.options).concat(super).uniq
|
38
|
+
end
|
39
|
+
|
40
|
+
def initialize(argv)
|
41
|
+
@env = argv.option('env') || 'dev'
|
42
|
+
CBin.config.set_configuration_env(@env)
|
43
|
+
UI.warn "====== cocoapods-imy-bin #{CBin::VERSION} 版本 ======== \n "
|
44
|
+
UI.warn "====== #{@env} 环境 ======== "
|
45
|
+
|
46
|
+
|
47
|
+
@make_binary_specs = argv.option('make-binary-specs') || []
|
48
|
+
@framework_output = argv.flag?('framework-output', false)
|
49
|
+
@clean = argv.flag?('no-clean', true)
|
50
|
+
@zip = argv.flag?('zip', true)
|
51
|
+
@sources = argv.option('sources') || []
|
52
|
+
@platform = Platform.new(:ios)
|
53
|
+
|
54
|
+
@target_name = CBin::Config::Builder.instance.target_name
|
55
|
+
@local_build_dir_name = CBin::Config::Builder.instance.xcode_build_name
|
56
|
+
@local_build_dir = CBin::Config::Builder.instance.xcode_build_dir
|
57
|
+
|
58
|
+
@framework_path
|
59
|
+
super
|
60
|
+
end
|
61
|
+
|
62
|
+
def run
|
63
|
+
# 清除之前的缓存
|
64
|
+
# temp = File.join(@local_build_dir, @platform.to_s)
|
65
|
+
# FileUtils.rm_r(temp) if File.exist? temp
|
66
|
+
# if File.exist?(CBin::Config::Builder.instance.zip_dir)
|
67
|
+
# FileUtils.rm_rf(Dir.glob("#{CBin::Config::Builder.instance.zip_dir}/*"))
|
68
|
+
# end
|
69
|
+
|
70
|
+
sources_spec = []
|
71
|
+
Dir.chdir(CBin::Config::Builder.instance.local_psec_dir) do
|
72
|
+
spec_files = Dir.glob(%w[*.json *.podspec])
|
73
|
+
spec_files.each do |file|
|
74
|
+
spec = Pod::Specification.from_file(file)
|
75
|
+
sources_spec << spec
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
build(sources_spec)
|
80
|
+
end
|
81
|
+
|
82
|
+
def build(make_binary_specs)
|
83
|
+
# 如果没要求,就清空依赖库数据
|
84
|
+
sources_sepc = []
|
85
|
+
make_binary_specs.uniq.each do |spec|
|
86
|
+
next if spec.name.include?('/')
|
87
|
+
next if spec.name == @target_name
|
88
|
+
#过滤白名单
|
89
|
+
next if CBin::Config::Builder.instance.white_pod_list.include?(spec.name)
|
90
|
+
#过滤 git
|
91
|
+
ignore_git_list = CBin::Config::Builder.instance.ignore_git_list
|
92
|
+
if spec.source[:git] && spec.source[:git] && ignore_git_list
|
93
|
+
spec_git = spec.source[:git]
|
94
|
+
spec_git_res = false
|
95
|
+
ignore_git_list.each do |ignore_git|
|
96
|
+
spec_git_res = spec_git.include?(ignore_git)
|
97
|
+
break if spec_git_res
|
98
|
+
end
|
99
|
+
next if spec_git_res
|
100
|
+
end
|
101
|
+
UI.warn "#{spec.name}.podspec 带有 vendored_frameworks 字段,请检查是否有效!!!" if spec.attributes_hash['vendored_frameworks']
|
102
|
+
next if spec.attributes_hash['vendored_frameworks'] && @target_name != spec.name #过滤带有vendored_frameworks的
|
103
|
+
next if (spec.attributes_hash['ios'] && spec.attributes_hash['ios']['vendored_frameworks']) #过滤带有vendored_frameworks的
|
104
|
+
#获取没有制作二进制版本的spec集合
|
105
|
+
|
106
|
+
next unless library_exist(spec)
|
107
|
+
|
108
|
+
# 获取没有制作二进制版本的spec集合
|
109
|
+
sources_sepc << spec
|
110
|
+
end
|
111
|
+
|
112
|
+
fail_build_specs = []
|
113
|
+
sources_sepc.uniq.each do |spec|
|
114
|
+
begin
|
115
|
+
builder = CBin::LocalBuild::Helper.new(spec,
|
116
|
+
@platform,
|
117
|
+
@framework_output,
|
118
|
+
@zip,
|
119
|
+
@clean,
|
120
|
+
@target_name,
|
121
|
+
@local_build_dir_name,
|
122
|
+
@local_build_dir)
|
123
|
+
if builder.build
|
124
|
+
CBin::Upload::Helper.new(spec, @code_dependencies, @sources).upload
|
125
|
+
else
|
126
|
+
fail_build_specs << spec
|
127
|
+
end
|
128
|
+
rescue StandardError
|
129
|
+
fail_build_specs << spec
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
if fail_build_specs.any?
|
134
|
+
fail_build_specs.uniq.each do |spec|
|
135
|
+
UI.warn "【#{spec.name} | #{spec.version}】组件二进制版本编译失败 ."
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
success_specs = sources_sepc - fail_build_specs
|
140
|
+
if success_specs.any?
|
141
|
+
success_specs.uniq.each do |spec|
|
142
|
+
UI.warn " =======【 #{spec.name} | #{spec.version} 】二进制组件制作完成 !!!"
|
143
|
+
end
|
144
|
+
end
|
145
|
+
# pod repo update
|
146
|
+
UI.section("\nUpdating Spec Repositories\n".yellow) do
|
147
|
+
Pod::Command::Bin::Repo::Update.new(CLAide::ARGV.new([])).run
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
private
|
152
|
+
|
153
|
+
def library_exist(spec)
|
154
|
+
File.exist?(File.join(@local_build_dir, "lib#{spec.name}.a")) || is_framework(spec)
|
155
|
+
end
|
156
|
+
# 使用了user_framework 会有#{@spec.name}.framework
|
157
|
+
# 未使用的 需要判断文件
|
158
|
+
def is_framework(spec)
|
159
|
+
res = File.exist?(File.join(@local_build_dir, "#{spec.name}.framework"))
|
160
|
+
unless res
|
161
|
+
res = File.exist?(File.join(CBin::Config::Builder.instance.xcode_BuildProductsPath_dir, "#{spec.name}","Swift Compatibility Header"))
|
162
|
+
end
|
163
|
+
res
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
@@ -70,9 +70,17 @@ module Pod
|
|
70
70
|
local_post_install_callback = @post_install_callback
|
71
71
|
end
|
72
72
|
end
|
73
|
+
local_podfile_internal_hash = nil
|
74
|
+
local_podfile.instance_eval do
|
75
|
+
begin
|
76
|
+
local_podfile_internal_hash = internal_hash
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
73
80
|
|
74
81
|
podfile.instance_eval do
|
75
82
|
begin
|
83
|
+
internal_hash.merge!(local_podfile_internal_hash)
|
76
84
|
|
77
85
|
# podfile HASH_KEYS才有plugins字段,否则会被限制
|
78
86
|
if local_podfile.plugins.any?
|
@@ -111,9 +119,12 @@ module Pod
|
|
111
119
|
end
|
112
120
|
|
113
121
|
target_dependencies.each do |target_dependency|
|
114
|
-
|
115
|
-
|
116
|
-
|
122
|
+
dp_hash_equal = target_dependency.is_a?(Hash) &&
|
123
|
+
target_dependency.keys.first &&
|
124
|
+
target_dependency.keys.first == local_dependency.keys.first
|
125
|
+
dp_str_equal = target_dependency.is_a?(String) &&
|
126
|
+
target_dependency == local_dependency.keys.first
|
127
|
+
next unless dp_hash_equal || dp_str_equal
|
117
128
|
|
118
129
|
target_dependencies.delete target_dependency
|
119
130
|
break
|
@@ -4,9 +4,11 @@ require 'cocoapods-imy-bin/command/bin/init'
|
|
4
4
|
require 'cocoapods-imy-bin/command/bin/archive'
|
5
5
|
require 'cocoapods-imy-bin/command/bin/auto'
|
6
6
|
require 'cocoapods-imy-bin/command/bin/code'
|
7
|
+
require 'cocoapods-imy-bin/command/bin/local'
|
7
8
|
require 'cocoapods-imy-bin/command/bin/update'
|
8
9
|
require 'cocoapods-imy-bin/command/bin/install'
|
9
10
|
require 'cocoapods-imy-bin/command/bin/imy'
|
11
|
+
require 'cocoapods-imy-bin/command/bin/clean'
|
10
12
|
|
11
13
|
require 'cocoapods-imy-bin/helpers'
|
12
14
|
|
@@ -55,6 +55,14 @@ module CBin
|
|
55
55
|
binary_download_url[0,binary_download_url.length - cut_string.length]
|
56
56
|
end
|
57
57
|
|
58
|
+
#清除接口 http://ci.meiyou.im:10240/frameworks_del
|
59
|
+
def delete_binary_url
|
60
|
+
cut_string = "/%s/%s/zip"
|
61
|
+
url = binary_download_url[0,binary_download_url.length - cut_string.length]
|
62
|
+
url += "_del"
|
63
|
+
url
|
64
|
+
end
|
65
|
+
|
58
66
|
def set_configuration_env(env)
|
59
67
|
@configuration_env = env
|
60
68
|
end
|
@@ -14,6 +14,43 @@ module CBin
|
|
14
14
|
return Utils.is_swift_module(spec)
|
15
15
|
end
|
16
16
|
|
17
|
+
def Utils.spec_header_dir(spec)
|
18
|
+
|
19
|
+
header_dir = "./Headers/Public/#{spec.name}"
|
20
|
+
header_dir = "./Pods/Headers/Public/#{spec.name}" unless File.exist?(header_dir)
|
21
|
+
|
22
|
+
unless File.exist?(header_dir)
|
23
|
+
# 一些库名称中使用了中划线如AAA-BBB,public header中库名称会默认处理成下划线AAA_BBB
|
24
|
+
module_name = spec.name.gsub("-", "_")
|
25
|
+
header_dir = "./Pods/Headers/Public/#{module_name}"
|
26
|
+
end
|
27
|
+
|
28
|
+
# 暂时只支持:ios
|
29
|
+
consumer = Pod::Specification::Consumer.new(spec, :ios)
|
30
|
+
unless consumer.header_dir.nil?
|
31
|
+
header_dir = File.join(header_dir, consumer.header_dir)
|
32
|
+
end
|
33
|
+
|
34
|
+
header_dir
|
35
|
+
end
|
36
|
+
|
37
|
+
def Utils.spec_module_dir(spec)
|
38
|
+
if spec.module_name.nil?
|
39
|
+
module_dir = "./Headers/Public/#{spec.name}"
|
40
|
+
module_dir = "./Pods/Headers/Public/#{spec.name}" unless File.exist?(module_dir)
|
41
|
+
unless File.exist?(module_dir)
|
42
|
+
# 一些库名称中使用了中划线如AAA-BBB,public header中库名称会默认处理成下划线AAA_BBB
|
43
|
+
module_name = spec.name.gsub("-", "_")
|
44
|
+
module_dir = "./Pods/Headers/Public/#{module_name}"
|
45
|
+
end
|
46
|
+
else
|
47
|
+
module_dir = "./Headers/Public/#{spec.module_name}"
|
48
|
+
module_dir = "./Pods/Headers/Public/#{spec.module_name}" unless File.exist?(module_dir)
|
49
|
+
end
|
50
|
+
|
51
|
+
module_dir
|
52
|
+
end
|
53
|
+
|
17
54
|
def Utils.is_swift_module(spec)
|
18
55
|
|
19
56
|
is_framework = false
|
@@ -21,15 +58,9 @@ module CBin
|
|
21
58
|
#auto 走这里
|
22
59
|
if File.exist?(dir)
|
23
60
|
Dir.chdir(dir) do
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
unless File.exist?(spec_header_dir)
|
28
|
-
spec_header_dir = "./Pods/Headers/Public/#{spec.name}"
|
29
|
-
end
|
30
|
-
return false unless File.exist?(spec_header_dir)
|
31
|
-
|
32
|
-
is_framework = File.exist?(File.join(spec_header_dir, "#{spec.name}-umbrella.h"))
|
61
|
+
spec_module_dir = Utils.spec_module_dir(spec)
|
62
|
+
return false unless File.exist?(spec_module_dir)
|
63
|
+
is_framework = File.exist?(File.join(spec_module_dir, "#{spec.name}-umbrella.h"))
|
33
64
|
end
|
34
65
|
end
|
35
66
|
|
@@ -240,7 +240,7 @@ module CBin
|
|
240
240
|
end
|
241
241
|
raise "copy_headers #{spec_header_dir} no exist " unless File.exist?(spec_header_dir)
|
242
242
|
Dir.chdir(spec_header_dir) do
|
243
|
-
headers = Dir.glob('
|
243
|
+
headers = Dir.glob('**/*.h')
|
244
244
|
headers.each do |h|
|
245
245
|
public_headers << Pathname.new(File.join(Dir.pwd,h))
|
246
246
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
# copy from https://github.com/CocoaPods/cocoapods-packager
|
4
|
+
require 'cocoapods-imy-bin/config/config_builder'
|
5
|
+
|
6
|
+
module CBin
|
7
|
+
class LocalLibrary
|
8
|
+
attr_reader :headers_path
|
9
|
+
attr_reader :resources_path
|
10
|
+
attr_reader :root_path
|
11
|
+
attr_reader :versions_path
|
12
|
+
attr_reader :name_path
|
13
|
+
|
14
|
+
def initialize(name, platform, version)
|
15
|
+
@name = name
|
16
|
+
@platform = platform
|
17
|
+
@version = version
|
18
|
+
end
|
19
|
+
|
20
|
+
def make
|
21
|
+
make_root
|
22
|
+
make_library
|
23
|
+
make_headers
|
24
|
+
make_resources
|
25
|
+
end
|
26
|
+
|
27
|
+
def delete_resources
|
28
|
+
Pathname.new(@resources_path).rmtree
|
29
|
+
(Pathname.new(@fwk_path) + Pathname.new('Resources')).delete
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def make_library
|
35
|
+
@name_path = CBin::Config::Builder.instance.library_name_version(@name, @version)
|
36
|
+
@fwk_path = @root_path + Pathname.new(@name_path)
|
37
|
+
@fwk_path.mkdir unless @fwk_path.exist?
|
38
|
+
|
39
|
+
@versions_path = @fwk_path
|
40
|
+
end
|
41
|
+
|
42
|
+
def make_headers
|
43
|
+
@headers_path = @versions_path + Pathname.new('Headers')
|
44
|
+
# @headers_path.mkpath unless @headers_path.exist?
|
45
|
+
end
|
46
|
+
|
47
|
+
def make_resources
|
48
|
+
@resources_path = @versions_path + Pathname.new('Resources')
|
49
|
+
# @resources_path.mkpath unless @resources_path.exist?
|
50
|
+
end
|
51
|
+
|
52
|
+
def make_root
|
53
|
+
@root_path = Pathname.new(@platform)
|
54
|
+
@root_path.mkpath unless @root_path.exist?
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|