vfastdev 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/vfastdev +245 -0
- data/lib/vfastdev.rb +216 -0
- metadata +60 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 36eb2a935955165465ca8c9b119d6ef203f485ee
|
4
|
+
data.tar.gz: e39a391145074d34acb6b3c600875292ccf4bc2d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2a07df0f18610bdd7727a5320a6b32c1d904ceee2a4705f09ced731127f1d2da012e7b05ec78d4ca9d495b5e2d85ebb9c882487bf6afb748e99abaebe0b522c4
|
7
|
+
data.tar.gz: e763cec7188ed3f1e567e7216ba65e3722295a2f7a37d9596a0322452bfab2b1694bb517c3b0d4368930fcca87478681db301c0fdd89a5591e40fc69b7dd0e2c
|
data/bin/vfastdev
ADDED
@@ -0,0 +1,245 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'xcodeproj'
|
4
|
+
require 'rexml/document'
|
5
|
+
require 'fileutils'
|
6
|
+
require 'open-uri'
|
7
|
+
require 'open3'
|
8
|
+
require 'optparse'
|
9
|
+
|
10
|
+
# 检查当前代码版本和静态库版本相差多久
|
11
|
+
|
12
|
+
|
13
|
+
usage = <<EOF
|
14
|
+
\033[1mNAME\033[0m
|
15
|
+
\033[1mvfastdev\033[0m -- Spec快速开发模式。
|
16
|
+
|
17
|
+
\033[1mDESCRIPTION\033[0m
|
18
|
+
\033[1mvfastdev\033[0m 会在工程根目录生成FastDev目录,按照保留指定的模块作为工程引入,剩余模块将会通过下载develop最新的静态库快照引入Spec工程。
|
19
|
+
通过这样可以在一定程度上提高编译速度。目前只支持x86_64的静态库,意味着只在64位模拟器上面生效。
|
20
|
+
|
21
|
+
\033[1mUSAGE\033[0m
|
22
|
+
vfastdev -h
|
23
|
+
显示帮助文档
|
24
|
+
vfastdev -k "[biz name]..." -
|
25
|
+
|
26
|
+
\033[1mEXAMPLE\033[0m
|
27
|
+
|
28
|
+
vfastdev -k "VSBizUserCenter VSBizCollection"
|
29
|
+
保留VSBizUserCenter和VSBizCollection作为工程引入,其它业务模块通过静态库引入。Spec和Pods工程会默认保留。
|
30
|
+
|
31
|
+
\033[1mISSUes\033[0m
|
32
|
+
1.如果你的代码版本和develop相差太多,可能导致出现找不到头文件,没有这个方法,找不到符号的问题
|
33
|
+
2.由于业务模块之间依赖还比较严重,并且依赖比较隐晦。在FastDev下面修改业务模块的内容,可能导致运行看起来没有问题,但是在非FastDev下面编译会报错,例如提示没有这个函数的问题。
|
34
|
+
这个问题目前环境下比较难避免,因为不知道修改的东西被谁引用了。
|
35
|
+
3.真机和32位模拟器不嫩使用,因为只有x86_64的符号。
|
36
|
+
4.VSBaseModule/VSPublic这类被公共依赖的工程不能再FastDev下面修改。
|
37
|
+
5.同一个.xcodeproj文件不能被同时打开,使用FastDev打开的工程之前先关闭原来的工程。
|
38
|
+
6.由于FastDev/Spec.xcodeproj是副本,修改它不会影响Spec.xcodeproj原本,如果需要修改Spec.xcodeproj,不能使用FastDev。
|
39
|
+
7.出现___llvm_profile_runtime未找到符号的错误,可在Spec target的OTHER_LDFLAGS增加-fprofile-instr-generate来解决
|
40
|
+
EOF
|
41
|
+
|
42
|
+
$source_names = []
|
43
|
+
if ARGV.count > 1
|
44
|
+
if ARGV[0] == '-k'
|
45
|
+
param = ARGV[1]
|
46
|
+
$source_names = param.split(" ")
|
47
|
+
elsif ARGV[0] == '-h'
|
48
|
+
puts(usage)
|
49
|
+
exit(1)
|
50
|
+
end
|
51
|
+
else
|
52
|
+
puts(usage)
|
53
|
+
exit(1)
|
54
|
+
end
|
55
|
+
|
56
|
+
# 判断目录是否存在
|
57
|
+
|
58
|
+
unless File.exist?('FastDev')
|
59
|
+
puts '创建FastDev目录'
|
60
|
+
Dir.mkdir('FastDev')
|
61
|
+
end
|
62
|
+
|
63
|
+
Dir.chdir('FastDev')
|
64
|
+
|
65
|
+
if File.exist?('Spec.xcodeproj')
|
66
|
+
puts '删除FastDev/Spec.xcodeproj'
|
67
|
+
FileUtils.rm_rf('Spec.xcodeproj')
|
68
|
+
end
|
69
|
+
|
70
|
+
if File.exist?('Spec.xcworkspace')
|
71
|
+
puts '删除FastDev/Spec.xcworkspace'
|
72
|
+
FileUtils.rm_rf('Spec.xcworkspace')
|
73
|
+
end
|
74
|
+
|
75
|
+
vs_framework_dir = 'VSFrameworks'
|
76
|
+
|
77
|
+
if File.exist?(vs_framework_dir)
|
78
|
+
puts '删除FastDev/VSFrameworks'
|
79
|
+
FileUtils.rm_rf(vs_framework_dir)
|
80
|
+
end
|
81
|
+
|
82
|
+
puts '拷贝Spec.xcodeproj到FastDev'
|
83
|
+
FileUtils.cp_r('../Spec/Spec.xcodeproj', 'Spec.xcodeproj')
|
84
|
+
puts '拷贝Spec.xcworkspace到FastDev'
|
85
|
+
FileUtils.cp_r('../Spec.xcworkspace', 'Spec.xcworkspace')
|
86
|
+
|
87
|
+
puts '创建目录FastDev/VSFrameworks'
|
88
|
+
Dir.mkdir(vs_framework_dir)
|
89
|
+
|
90
|
+
vs_framework_name = []
|
91
|
+
tmp_workspace = Xcodeproj::Workspace.new_from_xcworkspace("Spec.xcworkspace")
|
92
|
+
tmp_workspace.file_references.each do |file_ref|
|
93
|
+
match = /VS[a-zA-Z0-9]*?(?=.xcodeproj)/.match(file_ref.path)
|
94
|
+
if match != nil
|
95
|
+
name = match[0]
|
96
|
+
vs_framework_name << name
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
puts "工作空间包含的VS模块:#{vs_framework_name}"
|
103
|
+
|
104
|
+
begin
|
105
|
+
open('http://192.168.33.79:8000/lib/latest_framework_info?app_id=Spec') do |f|
|
106
|
+
puts "静态库版本信息: " + f.read
|
107
|
+
end
|
108
|
+
rescue StandardError,Timeout::Error, SystemCallError, Errno::ECONNREFUSED
|
109
|
+
puts "获取静态库版本信息失败: " + $!
|
110
|
+
end
|
111
|
+
|
112
|
+
puts '下载模块静态库'
|
113
|
+
Dir.chdir(vs_framework_dir)
|
114
|
+
|
115
|
+
vs_framework_name.each do |name|
|
116
|
+
puts '下载:'+ name
|
117
|
+
File.open("#{name}.framework.zip", 'wb') do |f|
|
118
|
+
framework_name = "#{name}.framework"
|
119
|
+
url = "http://192.168.33.79:8000/lib/dowload_framework_file?app_id=Spec&name=#{framework_name}"
|
120
|
+
begin
|
121
|
+
f.write(open(url) do |f1| f1.read end)
|
122
|
+
rescue StandardError,Timeout::Error, SystemCallError, Errno::ECONNREFUSED
|
123
|
+
puts $!
|
124
|
+
end
|
125
|
+
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
puts '解压静态库'
|
130
|
+
# 调用shell解压更简单,ruby不好写解压
|
131
|
+
system `
|
132
|
+
zip_names=$(ls)
|
133
|
+
for name in $zip_names
|
134
|
+
do
|
135
|
+
unzip -qq $name
|
136
|
+
rm $name
|
137
|
+
done
|
138
|
+
`
|
139
|
+
Dir.chdir('..')
|
140
|
+
|
141
|
+
biz_names = $source_names
|
142
|
+
k_framework_names = []
|
143
|
+
biz_names.each do |name|
|
144
|
+
k_framework_names << name + ".framework"
|
145
|
+
end
|
146
|
+
|
147
|
+
project_path = 'Spec.xcodeproj'
|
148
|
+
project = Xcodeproj::Project.open(project_path)
|
149
|
+
|
150
|
+
puts '更改Spec.xcodeproj的pecmain group的引用路径'
|
151
|
+
project.main_group.set_source_tree('SOURCE_ROOT')
|
152
|
+
project.main_group.set_path('../Spec')
|
153
|
+
|
154
|
+
|
155
|
+
puts '更改Spec.xcodeproj中info.plist,pch,entitlements的引用路径'
|
156
|
+
# 修改info.plist,pch,entitlements的引用路径
|
157
|
+
project.targets.each do |target|
|
158
|
+
target.build_configurations.each do |config|
|
159
|
+
if config.build_settings.has_key?('INFOPLIST_FILE')
|
160
|
+
info_plist_config = config.build_settings['INFOPLIST_FILE']
|
161
|
+
|
162
|
+
info_plist_config = "../Spec/" + info_plist_config
|
163
|
+
config.build_settings['INFOPLIST_FILE'] = info_plist_config
|
164
|
+
end
|
165
|
+
if config.build_settings.has_key?('GCC_PREFIX_HEADER')
|
166
|
+
pch_config = config.build_settings['GCC_PREFIX_HEADER']
|
167
|
+
pch_config = "../Spec/" + pch_config
|
168
|
+
config.build_settings['GCC_PREFIX_HEADER'] = pch_config
|
169
|
+
end
|
170
|
+
if config.build_settings.has_key?('CODE_SIGN_ENTITLEMENTS')
|
171
|
+
entitlements_config = config.build_settings['CODE_SIGN_ENTITLEMENTS']
|
172
|
+
entitlements_config = "../Spec/" + entitlements_config
|
173
|
+
config.build_settings['CODE_SIGN_ENTITLEMENTS'] = entitlements_config
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
puts 'FRAMEWORK_SEARCH_PATHS新增路径'
|
179
|
+
project.build_configuration_list.build_configurations.each do |config|
|
180
|
+
if config.build_settings.has_key?('FRAMEWORK_SEARCH_PATHS')
|
181
|
+
paths = config.build_settings['FRAMEWORK_SEARCH_PATHS']
|
182
|
+
if paths.is_a?(String)
|
183
|
+
config.build_settings['FRAMEWORK_SEARCH_PATHS'] = [paths,vs_framework_dir]
|
184
|
+
else
|
185
|
+
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << vs_framework_dir
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
puts'修改静态库库的引用'
|
191
|
+
project.files.each do |file_ref|
|
192
|
+
if file_ref.last_known_file_type == "wrapper.framework" && file_ref.name =~ /^VS/ && !k_framework_names.include?(file_ref.name)
|
193
|
+
file_ref.set_source_tree("SOURCE_ROOT")
|
194
|
+
file_ref.set_path(vs_framework_dir + "/" + file_ref.name)
|
195
|
+
elsif file_ref.explicit_file_type == "wrapper.framework" && file_ref.path =~ /^VS/ && !k_framework_names.include?(file_ref.path)
|
196
|
+
file_ref.set_source_tree("SOURCE_ROOT")
|
197
|
+
file_ref.name = file_ref.path
|
198
|
+
file_ref.set_path(vs_framework_dir + "/" + file_ref.path)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
puts '修改Copy Modular Resources 脚本:"${SRCROOT}/Resources/Support/modular-resources-copy.sh" => "${SRCROOT}/../Spec/Resources/Support/modular-resources-copy.sh"'
|
203
|
+
project.targets.each do |target|
|
204
|
+
target.shell_script_build_phases.each do |phase|
|
205
|
+
if phase.name == 'Copy Modular Resources'
|
206
|
+
phase.shell_script = '"${SRCROOT}/../Spec/Resources/Support/modular-resources-copy.sh"'
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
project.save
|
211
|
+
|
212
|
+
puts'生成新的workspace'
|
213
|
+
workspace_xml = <<XML
|
214
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
215
|
+
<Workspace
|
216
|
+
version = "1.0">
|
217
|
+
</Workspace>
|
218
|
+
XML
|
219
|
+
|
220
|
+
|
221
|
+
workspace = Xcodeproj::Workspace.from_s(workspace_xml)
|
222
|
+
spec_file_ref = Xcodeproj::Workspace::FileReference.new("Spec.xcodeproj")
|
223
|
+
workspace << spec_file_ref
|
224
|
+
|
225
|
+
if $source_names.include?("VSBaseModule")
|
226
|
+
base_module_file_ref = Xcodeproj::Workspace::FileReference.new("../VSBaseModule/VSBaseModule.xcodeproj")
|
227
|
+
workspace << base_module_file_ref
|
228
|
+
end
|
229
|
+
|
230
|
+
biz_names.each do |each|
|
231
|
+
fileRef = Xcodeproj::Workspace::FileReference.new("../#{each}/#{each}.xcodeproj")
|
232
|
+
workspace << fileRef
|
233
|
+
end
|
234
|
+
if $source_names.include?("VSPublic")
|
235
|
+
public_file_ref = Xcodeproj::Workspace::FileReference.new("../VSPublic/VSPublic.xcodeproj")
|
236
|
+
workspace << public_file_ref
|
237
|
+
end
|
238
|
+
|
239
|
+
pods_file_ref = Xcodeproj::Workspace::FileReference.new("../Pods/Pods.xcodeproj")
|
240
|
+
workspace << pods_file_ref
|
241
|
+
|
242
|
+
workspace_path = "Spec.xcworkspace"
|
243
|
+
workspace.save_as(workspace_path)
|
244
|
+
|
245
|
+
puts'FastDev完成。关闭旧的Spec.xcworkspace,打开FastDev/Spec.xcworkspace文件开始开发。'
|
data/lib/vfastdev.rb
ADDED
@@ -0,0 +1,216 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require 'xcodeproj'
|
4
|
+
require 'rexml/document'
|
5
|
+
require 'fileutils'
|
6
|
+
require 'open-uri'
|
7
|
+
require 'open3'
|
8
|
+
|
9
|
+
usage = <<EOF
|
10
|
+
\033[1mNAME\033[0m
|
11
|
+
\033[1mvfastdev\033[0m -- Spec快速开发模式。
|
12
|
+
|
13
|
+
\033[1mDESCRIPTION\033[0m
|
14
|
+
\033[1mvfastdev\033[0m 会在工程根目录生成FastDev目录,按照保留指定的业务模块作为工程引入,剩余业务模块将会通过下载develop最新的静态库快照引入Spec工程。
|
15
|
+
通过这样可以在一定程度上提高编译速度。目前只支持x86_64的静态库,意味着只在64位模拟器上面生效。
|
16
|
+
|
17
|
+
\033[1mEXAMPLE\033[0m
|
18
|
+
vfastdev -h
|
19
|
+
显示帮助文档
|
20
|
+
vfastdev -k "VSBizUserCenter VSBizCollection"
|
21
|
+
保留VSBizUserCenter和VSBizCollection作为工程引入,其它业务模块通过静态库引入
|
22
|
+
EOF
|
23
|
+
|
24
|
+
$source_biz_names = []
|
25
|
+
if ARGV.count > 1
|
26
|
+
if ARGV[0] == '-k'
|
27
|
+
param = ARGV[1]
|
28
|
+
$source_biz_names = param.split(" ")
|
29
|
+
elsif ARGV[0] == '-h'
|
30
|
+
puts(usage)
|
31
|
+
exit(1)
|
32
|
+
end
|
33
|
+
else
|
34
|
+
puts(usage)
|
35
|
+
exit(1)
|
36
|
+
end
|
37
|
+
|
38
|
+
# 判断目录是否存在
|
39
|
+
|
40
|
+
unless File.exist?('FastDev')
|
41
|
+
puts '创建FastDev目录'
|
42
|
+
Dir.mkdir('FastDev')
|
43
|
+
end
|
44
|
+
|
45
|
+
Dir.chdir('FastDev')
|
46
|
+
|
47
|
+
if File.exist?('Spec.xcodeproj')
|
48
|
+
puts '删除FastDev/Spec.xcodeproj'
|
49
|
+
FileUtils.rm_rf('Spec.xcodeproj')
|
50
|
+
end
|
51
|
+
|
52
|
+
if File.exist?('Spec.xcworkspace')
|
53
|
+
puts '删除FastDev/Spec.xcworkspace'
|
54
|
+
FileUtils.rm_rf('Spec.xcworkspace')
|
55
|
+
end
|
56
|
+
|
57
|
+
if File.exist?('VSBizFrameworks')
|
58
|
+
puts '删除FastDev/VSBizFrameworks'
|
59
|
+
FileUtils.rm_rf('VSBizFrameworks')
|
60
|
+
end
|
61
|
+
|
62
|
+
puts '拷贝Spec.xcodeproj到FastDev'
|
63
|
+
FileUtils.cp_r('../Spec/Spec.xcodeproj', 'Spec.xcodeproj')
|
64
|
+
puts '拷贝Spec.xcworkspace到FastDev'
|
65
|
+
FileUtils.cp_r('../Spec.xcworkspace', 'Spec.xcworkspace')
|
66
|
+
|
67
|
+
puts '创建目录FastDev/VSBizFrameworks'
|
68
|
+
Dir.mkdir('VSBizFrameworks')
|
69
|
+
|
70
|
+
biz_framework_name = []
|
71
|
+
tmp_workspace = Xcodeproj::Workspace.new_from_xcworkspace("Spec.xcworkspace")
|
72
|
+
tmp_workspace.file_references.each do |file_ref|
|
73
|
+
match = /VSBiz[a-zA-Z0-9]*?(?=.xcodeproj)/.match(file_ref.path)
|
74
|
+
if match != nil
|
75
|
+
name = match[0]
|
76
|
+
biz_framework_name << name
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
puts "工作空间包含的VSBiz业务模块:#{biz_framework_name}"
|
81
|
+
puts '下载业务模块静态库'
|
82
|
+
Dir.chdir('VSBizFrameworks')
|
83
|
+
|
84
|
+
biz_framework_name.each do |name|
|
85
|
+
puts name
|
86
|
+
File.open("#{name}.framework.zip", 'wb') do |f|
|
87
|
+
framework_name = "#{name}.framework"
|
88
|
+
url = "http://192.168.33.79:8000/lib/dowload_framework_file?app_id=Spec&name=#{framework_name}"
|
89
|
+
puts url
|
90
|
+
begin
|
91
|
+
f.write(open(url) do |f1| f1.read end)
|
92
|
+
rescue StandardError,Timeout::Error, SystemCallError, Errno::ECONNREFUSED
|
93
|
+
puts $!
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
puts '解压静态库'
|
100
|
+
# 调用shell解压更简单,ruby不好写解压
|
101
|
+
system `
|
102
|
+
zip_names=$(ls)
|
103
|
+
for name in $zip_names
|
104
|
+
do
|
105
|
+
unzip -qq $name
|
106
|
+
rm $name
|
107
|
+
done
|
108
|
+
`
|
109
|
+
Dir.chdir('..')
|
110
|
+
|
111
|
+
biz_names = $source_biz_names
|
112
|
+
biz_framework_names = []
|
113
|
+
biz_names.each do |name|
|
114
|
+
biz_framework_names << name + ".framework"
|
115
|
+
end
|
116
|
+
|
117
|
+
project_path = 'Spec.xcodeproj'
|
118
|
+
project = Xcodeproj::Project.open(project_path)
|
119
|
+
|
120
|
+
puts '更改Spec.xcodeproj的pecmain group的引用路径'
|
121
|
+
project.main_group.set_source_tree('SOURCE_ROOT')
|
122
|
+
project.main_group.set_path('../Spec')
|
123
|
+
|
124
|
+
|
125
|
+
puts '更改Spec.xcodeproj中info.plist,pch,entitlements的引用路径'
|
126
|
+
# 修改info.plist,pch,entitlements的引用路径
|
127
|
+
project.targets.each do |target|
|
128
|
+
target.build_configurations.each do |config|
|
129
|
+
if config.build_settings.has_key?('INFOPLIST_FILE')
|
130
|
+
info_plist_config = config.build_settings['INFOPLIST_FILE']
|
131
|
+
|
132
|
+
info_plist_config = "../Spec/" + info_plist_config
|
133
|
+
config.build_settings['INFOPLIST_FILE'] = info_plist_config
|
134
|
+
end
|
135
|
+
if config.build_settings.has_key?('GCC_PREFIX_HEADER')
|
136
|
+
pch_config = config.build_settings['GCC_PREFIX_HEADER']
|
137
|
+
pch_config = "../Spec/" + pch_config
|
138
|
+
config.build_settings['GCC_PREFIX_HEADER'] = pch_config
|
139
|
+
end
|
140
|
+
if config.build_settings.has_key?('CODE_SIGN_ENTITLEMENTS')
|
141
|
+
entitlements_config = config.build_settings['CODE_SIGN_ENTITLEMENTS']
|
142
|
+
entitlements_config = "../Spec/" + entitlements_config
|
143
|
+
config.build_settings['CODE_SIGN_ENTITLEMENTS'] = entitlements_config
|
144
|
+
end
|
145
|
+
if config.build_settings.has_key?('FRAMEWORK_SEARCH_PATHS')
|
146
|
+
paths = config.build_settings['FRAMEWORK_SEARCH_PATHS']
|
147
|
+
puts(">>>>>>>>>>>>>>>>>#{paths}")
|
148
|
+
# entitlements_?config = "../Spec/" + entitlements_config
|
149
|
+
# config.build_settings['CODE_SIGN_ENTITLEMENTS'] = entitlements_config
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
puts 'FRAMEWORK_SEARCH_PATHS新增路径'
|
155
|
+
project.build_configuration_list.build_configurations.each do |config|
|
156
|
+
if config.build_settings.has_key?('FRAMEWORK_SEARCH_PATHS')
|
157
|
+
paths = config.build_settings['FRAMEWORK_SEARCH_PATHS']
|
158
|
+
if paths.is_a?(String)
|
159
|
+
config.build_settings['FRAMEWORK_SEARCH_PATHS'] = [paths,"VSBizFrameworks"]
|
160
|
+
else
|
161
|
+
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << "VSBizFrameworks"
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
puts'修改静态库库的引用'
|
167
|
+
project.files.each do |file_ref|
|
168
|
+
if file_ref.last_known_file_type == "wrapper.framework" && file_ref.name =~ /^VSBiz/ && !biz_framework_names.include?(file_ref.name)
|
169
|
+
file_ref.set_source_tree("SOURCE_ROOT")
|
170
|
+
file_ref.set_path("VSBizFrameworks/" + file_ref.name)
|
171
|
+
elsif file_ref.explicit_file_type == "wrapper.framework" && file_ref.path =~ /^VSBiz/ && !biz_framework_names.include?(file_ref.path)
|
172
|
+
file_ref.set_source_tree("SOURCE_ROOT")
|
173
|
+
file_ref.name = file_ref.path
|
174
|
+
file_ref.set_path("VSBizFrameworks/" + file_ref.path)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
puts '修改Copy Modular Resources 脚本:"${SRCROOT}/Resources/Support/modular-resources-copy.sh" => "${SRCROOT}/../Spec/Resources/Support/modular-resources-copy.sh"'
|
179
|
+
project.targets.each do |target|
|
180
|
+
target.shell_script_build_phases.each do |phase|
|
181
|
+
if phase.name == 'Copy Modular Resources'
|
182
|
+
phase.shell_script = '"${SRCROOT}/../Spec/Resources/Support/modular-resources-copy.sh"'
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
project.save
|
187
|
+
|
188
|
+
puts'生成新的workspace'
|
189
|
+
workspace_xml = <<XML
|
190
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
191
|
+
<Workspace
|
192
|
+
version = "1.0">
|
193
|
+
</Workspace>
|
194
|
+
XML
|
195
|
+
|
196
|
+
|
197
|
+
workspace = Xcodeproj::Workspace.from_s(workspace_xml)
|
198
|
+
|
199
|
+
spec_file_ref = Xcodeproj::Workspace::FileReference.new("Spec.xcodeproj")
|
200
|
+
base_module_file_ref = Xcodeproj::Workspace::FileReference.new("../VSBaseModule/VSBaseModule.xcodeproj")
|
201
|
+
public_file_ref = Xcodeproj::Workspace::FileReference.new("../VSPublic/VSPublic.xcodeproj")
|
202
|
+
pods_file_ref = Xcodeproj::Workspace::FileReference.new("../Pods/Pods.xcodeproj")
|
203
|
+
|
204
|
+
workspace << spec_file_ref
|
205
|
+
workspace << base_module_file_ref
|
206
|
+
biz_names.each do |each|
|
207
|
+
fileRef = Xcodeproj::Workspace::FileReference.new("../#{each}/#{each}.xcodeproj")
|
208
|
+
workspace << fileRef
|
209
|
+
end
|
210
|
+
workspace << public_file_ref
|
211
|
+
workspace << pods_file_ref
|
212
|
+
|
213
|
+
workspace_path = "Spec.xcworkspace"
|
214
|
+
workspace.save_as(workspace_path)
|
215
|
+
|
216
|
+
puts'FastDev完成。打开FastDev/Spec.xcworkspace文件开始开发。'
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vfastdev
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sen.Mao
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-09-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: xcodeproj
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
description: iOS FastDev工具
|
28
|
+
email: sen.mao
|
29
|
+
executables:
|
30
|
+
- vfastdev
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- bin/vfastdev
|
35
|
+
- lib/vfastdev.rb
|
36
|
+
homepage: http://gitlab.tools.vipshop.com/sen.mao/FastDev
|
37
|
+
licenses:
|
38
|
+
- MIT
|
39
|
+
metadata: {}
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 2.3.0
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
requirements: []
|
55
|
+
rubyforge_project:
|
56
|
+
rubygems_version: 2.5.2.3
|
57
|
+
signing_key:
|
58
|
+
specification_version: 4
|
59
|
+
summary: FastDev!
|
60
|
+
test_files: []
|