cocoapods-fy-bin 0.1.8 → 0.1.9
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 +39 -0
- data/lib/cocoapods-fy-bin/command/bin.rb +0 -2
- data/lib/cocoapods-fy-bin/gem_version.rb +1 -1
- data/lib/cocoapods-fy-bin/helpers/framework_builder.rb +2 -2
- metadata +2 -6
- data/lib/cocoapods-fy-bin/command/bin/imy.rb +0 -46
- data/lib/cocoapods-fy-bin/command/bin/initHotKey.rb +0 -70
- data/lib/cocoapods-fy-bin/config/config_hot_key.rb +0 -103
- data/lib/cocoapods-fy-bin/config/config_hot_key_asker.rb +0 -57
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 213c8226fe3dfbe423df192225e48ff350ca37494e79b7efc212c18f57698931
|
|
4
|
+
data.tar.gz: 1ab095c3672015afbeed53497a15127065f8076d3caeed0c1d985d6074bc71b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49037edd4a308d61702a13315c2d4071e68b43b7430f010a35632ce3dda73d3f014a4e274ba1d8ad1b755b9b0e75c3a9e5ef4daf4722730147a719c40f6eab09
|
|
7
|
+
data.tar.gz: e182deff9c70c7793daa6cade6f23a64cf94aad5e6080d6e1c88501c381e037354796394927371674d7ce9d2513e5f8330b1bc286b987c29bfc64b132426b45b
|
data/README.md
CHANGED
|
@@ -1 +1,40 @@
|
|
|
1
|
+
### 特色:
|
|
1
2
|
|
|
3
|
+
1.**支持swift二进制化编译**
|
|
4
|
+
|
|
5
|
+
2.**支持源码/二进制切换**
|
|
6
|
+
|
|
7
|
+
3.**无入侵、不影响现有业务**
|
|
8
|
+
|
|
9
|
+
关于 插件具体的架构部署实践和更详细的资源,可以参考
|
|
10
|
+
|
|
11
|
+
> [iOS编译速度如何稳定提高10倍以上](https://juejin.cn/post/6903407900006449160)
|
|
12
|
+
>
|
|
13
|
+
> [iOS美团同款"ZSource"二进制调试实现](https://juejin.im/post/5f066cfa5188252e893a136e)
|
|
14
|
+
>
|
|
15
|
+
> [iOS教你如何像RN一样实时编译](https://juejin.im/post/6850037272415813645)
|
|
16
|
+
>
|
|
17
|
+
> [Swift编译慢?请看这里,全套开源](https://juejin.im/post/6890419459639476237)
|
|
18
|
+
>
|
|
19
|
+
> [OC-Demo](https://github.com/su350380433/cocoapods-imy-bin-demo)
|
|
20
|
+
>
|
|
21
|
+
> [Swift-OC-Demo](https://github.com/su350380433/Swift-OC-Demo)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## 一、使用教程
|
|
28
|
+
|
|
29
|
+
[使用教程](./使用教程.md)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 二、感谢
|
|
35
|
+
|
|
36
|
+
**[cocoapods-imy-bin](https://github.com/MeetYouDevs/cocoapods-imy-bin)**
|
|
37
|
+
|
|
38
|
+
**[cocoapods-bin](https://github.com/tripleCC/cocoapods-bin)**
|
|
39
|
+
|
|
40
|
+
[美团 iOS 工程 zsource 命令背后的那些事儿](https://tech.meituan.com/2019/08/08/the-things-behind-the-ios-project-zsource-command.html)
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
require 'cocoapods-fy-bin/command/bin/initHotKey'
|
|
3
2
|
require 'cocoapods-fy-bin/command/bin/init'
|
|
4
3
|
require 'cocoapods-fy-bin/command/bin/archive'
|
|
5
4
|
require 'cocoapods-fy-bin/command/bin/auto'
|
|
6
5
|
require 'cocoapods-fy-bin/command/bin/code'
|
|
7
6
|
require 'cocoapods-fy-bin/command/bin/update'
|
|
8
7
|
require 'cocoapods-fy-bin/command/bin/install'
|
|
9
|
-
require 'cocoapods-fy-bin/command/bin/imy'
|
|
10
8
|
|
|
11
9
|
require 'cocoapods-fy-bin/helpers'
|
|
12
10
|
|
|
@@ -178,13 +178,13 @@ module CBin
|
|
|
178
178
|
defines += "GCC_PREPROCESSOR_DEFINITIONS='$(inherited)'"
|
|
179
179
|
defines += " SWIFT_ACTIVE_COMPILATION_CONDITIONS='$(inherited)' "
|
|
180
180
|
defines += @spec.consumer(@platform).compiler_flags.join(' ')
|
|
181
|
-
options = ios_build_options
|
|
181
|
+
# options = ios_build_options
|
|
182
182
|
# if is_debug_model
|
|
183
183
|
archs = ios_architectures
|
|
184
184
|
# archs = %w[arm64 armv7 armv7s]
|
|
185
185
|
pre_build_command
|
|
186
186
|
archs.map do |arch|
|
|
187
|
-
# -fembed-bitcode
|
|
187
|
+
# -fembed-bitcode包含bitcode BUILD_LIBRARY_FOR_DISTRIBUTION=YES 构建向后兼容的framework
|
|
188
188
|
xcodebuild(defines, "ARCHS=\'#{arch}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\' DEBUG_INFORMATION_FORMAT=\'dwarf-with-dsym\' BUILD_LIBRARY_FOR_DISTRIBUTION=YES","build-#{arch}",@build_model)
|
|
189
189
|
end
|
|
190
190
|
suf_build_command
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cocoapods-fy-bin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- dr
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-09-
|
|
11
|
+
date: 2022-09-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: parallel
|
|
@@ -110,9 +110,7 @@ files:
|
|
|
110
110
|
- lib/cocoapods-fy-bin/command/bin/archive.rb
|
|
111
111
|
- lib/cocoapods-fy-bin/command/bin/auto.rb
|
|
112
112
|
- lib/cocoapods-fy-bin/command/bin/code.rb
|
|
113
|
-
- lib/cocoapods-fy-bin/command/bin/imy.rb
|
|
114
113
|
- lib/cocoapods-fy-bin/command/bin/init.rb
|
|
115
|
-
- lib/cocoapods-fy-bin/command/bin/initHotKey.rb
|
|
116
114
|
- lib/cocoapods-fy-bin/command/bin/install.rb
|
|
117
115
|
- lib/cocoapods-fy-bin/command/bin/lib/lint.rb
|
|
118
116
|
- lib/cocoapods-fy-bin/command/bin/repo/update.rb
|
|
@@ -122,8 +120,6 @@ files:
|
|
|
122
120
|
- lib/cocoapods-fy-bin/config/config.rb
|
|
123
121
|
- lib/cocoapods-fy-bin/config/config_asker.rb
|
|
124
122
|
- lib/cocoapods-fy-bin/config/config_builder.rb
|
|
125
|
-
- lib/cocoapods-fy-bin/config/config_hot_key.rb
|
|
126
|
-
- lib/cocoapods-fy-bin/config/config_hot_key_asker.rb
|
|
127
123
|
- lib/cocoapods-fy-bin/gem_version.rb
|
|
128
124
|
- lib/cocoapods-fy-bin/helpers.rb
|
|
129
125
|
- lib/cocoapods-fy-bin/helpers/build_helper.rb
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
require 'cocoapods-fy-bin/config/config_hot_key_asker'
|
|
2
|
-
|
|
3
|
-
module Pod
|
|
4
|
-
class Command
|
|
5
|
-
class Bin < Command
|
|
6
|
-
class Imy < Bin
|
|
7
|
-
self.summary = '快捷键'
|
|
8
|
-
self.description = <<-DESC
|
|
9
|
-
创建 文件,在其中保存插件需要的配置信息,
|
|
10
|
-
如二进制私有源地址、源码私有源地址等。
|
|
11
|
-
DESC
|
|
12
|
-
|
|
13
|
-
self.arguments = [
|
|
14
|
-
CLAide::Argument.new('1', false)
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
def self.options
|
|
18
|
-
[
|
|
19
|
-
].concat(super)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def initialize(argv)
|
|
23
|
-
@hot_key = argv.shift_argument || '1'
|
|
24
|
-
super
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def run
|
|
28
|
-
CBin.config_hot_key.set_hot_key_index(@hot_key)
|
|
29
|
-
UI.puts "cd #{CBin.config_hot_key.hot_key_dir}".yellow
|
|
30
|
-
|
|
31
|
-
if Dir.exist?(CBin.config_hot_key.hot_key_dir)
|
|
32
|
-
Dir.chdir(CBin.config_hot_key.hot_key_dir) do
|
|
33
|
-
UI.puts " #{CBin.config_hot_key.hot_key_cmd}".yellow
|
|
34
|
-
system CBin.config_hot_key.hot_key_cmd
|
|
35
|
-
end
|
|
36
|
-
else
|
|
37
|
-
raise "配置项中文件目录不存在 #{CBin.config_hot_key.hot_key_dir}"
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
require 'cocoapods-fy-bin/config/config_hot_key_asker'
|
|
3
|
-
|
|
4
|
-
module Pod
|
|
5
|
-
class Command
|
|
6
|
-
class Bin < Command
|
|
7
|
-
class Inithk < Bin
|
|
8
|
-
self.summary = '初始化快捷键配置.'
|
|
9
|
-
self.description = <<-DESC
|
|
10
|
-
创建 文件,在其中保存插件需要的配置信息,
|
|
11
|
-
如二进制私有源地址、源码私有源地址等。
|
|
12
|
-
DESC
|
|
13
|
-
|
|
14
|
-
def self.options
|
|
15
|
-
[
|
|
16
|
-
['--bin-url=URL', '配置文件地址,直接从此地址下载配置文件']
|
|
17
|
-
].concat(super)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def initialize(argv)
|
|
21
|
-
@bin_url = argv.option('bin-url')
|
|
22
|
-
super
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def run
|
|
26
|
-
if @bin_url.nil?
|
|
27
|
-
config_with_asker
|
|
28
|
-
else
|
|
29
|
-
config_with_url(@bin_url)
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
private
|
|
34
|
-
|
|
35
|
-
def config_with_url(url)
|
|
36
|
-
require 'open-uri'
|
|
37
|
-
|
|
38
|
-
UI.puts "开始下载配置文件...\n"
|
|
39
|
-
file = open(url)
|
|
40
|
-
contents = YAML.safe_load(file.read)
|
|
41
|
-
|
|
42
|
-
UI.puts "开始同步配置文件...\n"
|
|
43
|
-
CBin.config_hot_key.sync_config(contents.to_hash)
|
|
44
|
-
UI.puts "设置完成.\n".green
|
|
45
|
-
rescue Errno::ENOENT => e
|
|
46
|
-
raise Informative, "配置文件路径 #{url} 无效,请确认后重试."
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def config_with_asker
|
|
50
|
-
asker = CBin::Config_Hot_Key::Asker.new
|
|
51
|
-
asker.wellcome_message
|
|
52
|
-
|
|
53
|
-
config = {}
|
|
54
|
-
template_hash = CBin.config_hot_key.template_hash
|
|
55
|
-
template_hash.each do |k, v|
|
|
56
|
-
default = begin
|
|
57
|
-
CBin.config_hot_key.send(k)
|
|
58
|
-
rescue StandardError
|
|
59
|
-
nil
|
|
60
|
-
end
|
|
61
|
-
config[k] = asker.ask_with_answer(v[:description], default, v[:selection])
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
CBin.config_hot_key.sync_config(config)
|
|
65
|
-
asker.done_message
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
require 'yaml'
|
|
2
|
-
require 'cocoapods-fy-bin/native/podfile'
|
|
3
|
-
require 'cocoapods-fy-bin/native/podfile_env'
|
|
4
|
-
require 'cocoapods/generate'
|
|
5
|
-
|
|
6
|
-
module CBin
|
|
7
|
-
class Config_Hot_Key
|
|
8
|
-
|
|
9
|
-
def config_file
|
|
10
|
-
config_file_with_hot_key_index(hot_key_index)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def template_hash
|
|
14
|
-
{
|
|
15
|
-
'hot_key_index' => { description: '快捷键', default: '1', selection: %w[1 2 3...] },
|
|
16
|
-
'hot_key_dir' => { description: '快捷键执行目录', default: '' },
|
|
17
|
-
'hot_key_cmd' => { description: '快捷键执行命令', default: 'pod bin update --no-repo-update' }
|
|
18
|
-
}
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def config_file_with_hot_key_index(hot_key_index)
|
|
22
|
-
file = config_file_whith_hot_key_index(hot_key_index)
|
|
23
|
-
raise "\n===== #{hot_key_index} 参数有误,请检查%w[1 2 3...]===" unless (hot_key_index.to_i).is_a?(Integer)
|
|
24
|
-
File.expand_path("#{Pod::Config.instance.home_dir}/#{file}")
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def hot_key_index
|
|
28
|
-
@hot_key_index = 1 if @hot_key_index.is_a?(NilClass)
|
|
29
|
-
@hot_key_index
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def set_hot_key_index(hot_key_index)
|
|
33
|
-
@hot_key_index = hot_key_index
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def config_file_whith_hot_key_index(hot_key_index)
|
|
37
|
-
"hot_key_#{hot_key_index}.yml"
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def sync_config(config)
|
|
41
|
-
File.open(config_file_with_hot_key_index(config['hot_key_index']), 'w+') do |f|
|
|
42
|
-
f.write(config.to_yaml)
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def default_config
|
|
47
|
-
@default_config ||= Hash[template_hash.map { |k, v| [k, v[:default]] }]
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
private
|
|
51
|
-
|
|
52
|
-
def load_config
|
|
53
|
-
file = config_file
|
|
54
|
-
if (!file.nil?) && File.exist?(config_file)
|
|
55
|
-
YAML.load_file(config_file)
|
|
56
|
-
else
|
|
57
|
-
default_config
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def config
|
|
62
|
-
@config ||= begin
|
|
63
|
-
puts "====== cocoapods-fy-bin #{CBin::VERSION} 版本 ======== \n"
|
|
64
|
-
@config = OpenStruct.new load_config
|
|
65
|
-
validate!
|
|
66
|
-
@config
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def validate!
|
|
71
|
-
template_hash.each do |k, v|
|
|
72
|
-
selection = v[:selection]
|
|
73
|
-
next if !selection || selection.empty?
|
|
74
|
-
|
|
75
|
-
config_value = @config.send(k)
|
|
76
|
-
next unless config_value
|
|
77
|
-
unless selection.include?(config_value)
|
|
78
|
-
raise Pod::Informative, "#{k} 字段的值必须限定在可选值 [ #{selection.join(' / ')} ] 内".red
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
def respond_to_missing?(method, include_private = false)
|
|
84
|
-
config.respond_to?(method) || super
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
def method_missing(method, *args, &block)
|
|
88
|
-
if config.respond_to?(method)
|
|
89
|
-
config.send(method, *args)
|
|
90
|
-
elsif template_hash.keys.include?(method.to_s)
|
|
91
|
-
raise Pod::Informative, "#{method} 字段必须在配置文件 #{config_file} 中设置, 请执行 init 命令配置或手动修改配置文件".red
|
|
92
|
-
else
|
|
93
|
-
super
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def self.config_hot_key
|
|
99
|
-
@config_hot_key ||= Config_Hot_Key.new
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
end
|
|
103
|
-
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
require 'yaml'
|
|
2
|
-
require 'cocoapods-fy-bin/config/config_hot_key'
|
|
3
|
-
|
|
4
|
-
module CBin
|
|
5
|
-
class Config_Hot_Key
|
|
6
|
-
class Asker
|
|
7
|
-
def show_prompt
|
|
8
|
-
print ' > '.green
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def ask_with_answer(question, pre_answer, selection)
|
|
12
|
-
print "\n#{question}\n"
|
|
13
|
-
|
|
14
|
-
print_selection_info = lambda {
|
|
15
|
-
print "可选值:[ #{selection.join(' / ')} ]\n" if selection
|
|
16
|
-
}
|
|
17
|
-
print_selection_info.call
|
|
18
|
-
print "旧值:#{pre_answer}\n" unless pre_answer.nil?
|
|
19
|
-
|
|
20
|
-
answer = ''
|
|
21
|
-
loop do
|
|
22
|
-
show_prompt
|
|
23
|
-
answer = STDIN.gets.chomp.strip
|
|
24
|
-
|
|
25
|
-
if answer == '' && !pre_answer.nil?
|
|
26
|
-
answer = pre_answer
|
|
27
|
-
print answer.yellow
|
|
28
|
-
print "\n"
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
next if answer.empty?
|
|
32
|
-
break if !selection || selection.include?(answer)
|
|
33
|
-
|
|
34
|
-
print_selection_info.call
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
answer
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def wellcome_message
|
|
41
|
-
print <<~EOF
|
|
42
|
-
|
|
43
|
-
开始设置快捷键 pod bin imy.
|
|
44
|
-
所有的信息都会保存在 #{CBin.config_hot_key.config_file} 文件中.
|
|
45
|
-
%w[hot_key.yaml]
|
|
46
|
-
你可以在对应目录下手动添加编辑该文件. 文件包含的配置信息样式如下:
|
|
47
|
-
|
|
48
|
-
#{CBin.config_hot_key.default_config.to_yaml}
|
|
49
|
-
EOF
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def done_message
|
|
53
|
-
print "\n设置完成.\n".green
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|