@@ -166,15 +166,6 @@ def prebuild_frameworks!
166
166
end
167
167
168
168
# Remove useless files
169
- # only keep manifest.lock and framework folder in _Prebuild
170
- to_remain_files = [ "Manifest.lock" , File . basename ( existed_framework_folder ) ]
171
- to_delete_files = sandbox_path . children . select do |file |
172
- filename = File . basename ( file )
173
- not to_remain_files . include? ( filename )
174
- end
175
- to_delete_files . each do |path |
176
- path . rmtree if path . exist?
177
- end
178
169
# remove useless pods
179
170
all_needed_names = self . pod_targets . map ( &:name ) . uniq
180
171
useless_names = sandbox . exsited_framework_names . reject do |name |
@@ -185,6 +176,24 @@ def prebuild_frameworks!
185
176
path . rmtree if path . exist?
186
177
end
187
178
179
+ if not Podfile ::DSL . dont_remove_source_code
180
+ # only keep manifest.lock and framework folder in _Prebuild
181
+ to_remain_files = [ "Manifest.lock" , File . basename ( existed_framework_folder ) ]
182
+ to_delete_files = sandbox_path . children . select do |file |
183
+ filename = File . basename ( file )
184
+ not to_remain_files . include? ( filename )
185
+ end
186
+ to_delete_files . each do |path |
187
+ path . rmtree if path . exist?
188
+ end
189
+ else
190
+ # just remove the tmp files
191
+ path = sandbox . root + 'Manifest.lock.tmp'
192
+ path . rmtree if path . exist?
193
+ end
194
+
195
+
196
+
188
197
end
189
198
190
199
0 commit comments