cocoapods-ppbuild 0.0.5 → 1.0.3
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/lib/cocoapods-ppbuild/Integration.rb +171 -113
- data/lib/cocoapods-ppbuild/Main.rb +8 -7
- data/lib/cocoapods-ppbuild/Prebuild.rb +6 -45
- data/lib/cocoapods-ppbuild/Reference/reference_source_code.rb +51 -0
- data/lib/cocoapods-ppbuild/gem_version.rb +1 -1
- data/lib/cocoapods-ppbuild/helper/passer.rb +4 -0
- data/lib/cocoapods-ppbuild/helper/prebuild_sandbox.rb +19 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 125cd2ab22ddea59ff739faefe3e6f37543f65cebf38ef89221daaa490074f71
|
4
|
+
data.tar.gz: e68fba8f04a65459c4d5a3d19b7b44f988b1d011327eb880eb06fe3c4dc4e4d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3626ecad3da53ef920bb01107be4f44d654c9ce88f349283e70a8f00aa46c834072851eb2f1248dd612bf37e548df10214b64f13c59b3eef6c7ed1a81a59e614
|
7
|
+
data.tar.gz: 1cf9a943172c70e97619a4861330a427c0c3e04a4ce95811699f90b17fc73293a2f8d5ae82b0a4f9f21e95d0f12867e7f64b7d51f18520e436756927145d41c6
|
@@ -51,7 +51,10 @@ module Pod
|
|
51
51
|
FileUtils.cp_r source, target, :remove_destination => true
|
52
52
|
else
|
53
53
|
FileUtils.cp source, target
|
54
|
-
end
|
54
|
+
end
|
55
|
+
if not target.exist?
|
56
|
+
raise "资源导入失败:#{target}"
|
57
|
+
end
|
55
58
|
end
|
56
59
|
end
|
57
60
|
|
@@ -61,8 +64,6 @@ module Pod
|
|
61
64
|
end
|
62
65
|
|
63
66
|
target_names.each do |name|
|
64
|
-
|
65
|
-
Pod::UI.puts "........... oname: #{name}"
|
66
67
|
# symbol link copy all substructure
|
67
68
|
real_file_folder = prebuild_sandbox.framework_folder_path_for_target_name(name)
|
68
69
|
|
@@ -76,8 +77,7 @@ module Pod
|
|
76
77
|
end
|
77
78
|
target_folder.rmtree if target_folder.exist?
|
78
79
|
target_folder.mkpath
|
79
|
-
|
80
|
-
|
80
|
+
|
81
81
|
walk(real_file_folder) do |child|
|
82
82
|
source = child
|
83
83
|
|
@@ -112,7 +112,6 @@ module Pod
|
|
112
112
|
if object.real_file_path != nil
|
113
113
|
real_path = Pathname.new(object.target_file_path)
|
114
114
|
real_path.rmtree if real_path.exist?
|
115
|
-
Pod::UI.puts "........... object.target_file_path: #{object.target_file_path}"
|
116
115
|
make_link(object.real_file_path, object.target_file_path, false)
|
117
116
|
end
|
118
117
|
end
|
@@ -142,8 +141,13 @@ module Pod
|
|
142
141
|
if changes == nil
|
143
142
|
updated_names = PrebuildSandbox.from_standard_sandbox(self.sandbox).exsited_framework_pod_names
|
144
143
|
else
|
145
|
-
|
146
|
-
|
144
|
+
t_changes = Pod::Prebuild::Passer.prebuild_pods_changes
|
145
|
+
added = t_changes.added
|
146
|
+
changed = t_changes.changed
|
147
|
+
deleted = t_changes.deleted
|
148
|
+
updated_names = (added + changed + deleted).to_a
|
149
|
+
|
150
|
+
updated_names = (changes + updated_names).uniq
|
147
151
|
end
|
148
152
|
|
149
153
|
updated_names.each do |name|
|
@@ -160,87 +164,138 @@ module Pod
|
|
160
164
|
|
161
165
|
end
|
162
166
|
|
167
|
+
def save_change_targets!
|
168
|
+
sandbox_path = sandbox.root
|
169
|
+
existed_framework_folder = sandbox.generate_framework_path
|
170
|
+
if local_manifest != nil
|
171
|
+
changes = prebuild_pods_changes
|
172
|
+
added = changes.added
|
173
|
+
changed = changes.changed
|
174
|
+
unchanged = changes.unchanged
|
175
|
+
deleted = changes.deleted.to_a
|
176
|
+
|
177
|
+
existed_framework_folder.mkdir unless existed_framework_folder.exist?
|
178
|
+
exsited_framework_pod_names = sandbox.exsited_framework_pod_names
|
179
|
+
|
180
|
+
# additions
|
181
|
+
missing = unchanged.select do |pod_name|
|
182
|
+
not exsited_framework_pod_names.include?(pod_name)
|
183
|
+
end
|
184
|
+
|
185
|
+
# 保存有改变的target列表
|
186
|
+
root_names_to_update = (added + changed + missing).uniq
|
187
|
+
updates_target_names = (root_names_to_update + deleted).uniq
|
188
|
+
cache = []
|
189
|
+
updates_targets = []
|
190
|
+
updates_target_names.each do |pod_name|
|
191
|
+
tars = Pod.fast_get_targets_for_pod_name(pod_name, self.pod_targets, cache)
|
192
|
+
if tars.nil?
|
193
|
+
tars = []
|
194
|
+
end
|
195
|
+
updates_targets = (updates_targets + tars).uniq
|
196
|
+
end
|
197
|
+
updates_dependency_targets = updates_targets.map {|t|
|
198
|
+
t.recursive_dependent_targets
|
199
|
+
}.flatten.uniq || []
|
200
|
+
dependency_names = updates_dependency_targets.map { |e| e.pod_name }
|
201
|
+
if Pod::Prebuild::Passer.prebuild_pod_targets_changes.nil?
|
202
|
+
Pod::Prebuild::Passer.prebuild_pod_targets_changes = (updates_target_names + dependency_names).uniq
|
203
|
+
else
|
204
|
+
Pod::Prebuild::Passer.prebuild_pod_targets_changes = (Pod::Prebuild::Passer.prebuild_pod_targets_changes + updates_target_names + dependency_names).uniq
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
163
208
|
|
164
209
|
# Modify specification to use only the prebuild framework after analyzing
|
165
210
|
old_method2 = instance_method(:resolve_dependencies)
|
166
211
|
define_method(:resolve_dependencies) do
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
212
|
+
if Pod::is_prebuild_stage
|
213
|
+
# call original
|
214
|
+
old_method2.bind(self).()
|
215
|
+
self.save_change_targets!
|
216
|
+
else
|
217
|
+
# Remove the old target files, else it will not notice file changes
|
218
|
+
self.remove_target_files_if_needed
|
219
|
+
# call original
|
220
|
+
old_method2.bind(self).()
|
221
|
+
# ...
|
222
|
+
# ...
|
223
|
+
# ...
|
224
|
+
# after finishing the very complex orginal function
|
225
|
+
|
226
|
+
# check the pods
|
227
|
+
# Although we have did it in prebuild stage, it's not sufficient.
|
228
|
+
# Same pod may appear in another target in form of source code.
|
229
|
+
# Prebuild.check_one_pod_should_have_only_one_target(self.prebuild_pod_targets)
|
230
|
+
self.validate_every_pod_only_have_one_form
|
231
|
+
|
232
|
+
|
233
|
+
# prepare
|
234
|
+
cache = []
|
235
|
+
|
236
|
+
def add_vendered_framework(spec, platform, added_framework_file_path)
|
237
|
+
if spec.attributes_hash[platform] == nil
|
238
|
+
spec.attributes_hash[platform] = {}
|
239
|
+
end
|
240
|
+
vendored_frameworks = spec.attributes_hash[platform]["vendored_frameworks"] || []
|
241
|
+
vendored_frameworks = [vendored_frameworks] if vendored_frameworks.kind_of?(String)
|
242
|
+
vendored_frameworks += [added_framework_file_path]
|
243
|
+
spec.attributes_hash[platform]["vendored_frameworks"] = vendored_frameworks
|
190
244
|
end
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
spec.attributes_hash["source_files"] = []
|
198
|
-
["ios", "watchos", "tvos", "osx"].each do |plat|
|
199
|
-
if spec.attributes_hash[plat] != nil
|
200
|
-
spec.attributes_hash[plat]["source_files"] = []
|
245
|
+
def empty_source_files(spec)
|
246
|
+
spec.attributes_hash["source_files"] = []
|
247
|
+
["ios", "watchos", "tvos", "osx"].each do |plat|
|
248
|
+
if spec.attributes_hash[plat] != nil
|
249
|
+
spec.attributes_hash[plat]["source_files"] = []
|
250
|
+
end
|
201
251
|
end
|
202
252
|
end
|
203
|
-
end
|
204
253
|
|
205
254
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
255
|
+
specs = self.analysis_result.specifications
|
256
|
+
prebuilt_specs = (specs.select do |spec|
|
257
|
+
self.prebuild_pod_names.include? spec.root.name
|
258
|
+
end)
|
210
259
|
|
211
|
-
|
260
|
+
prebuilt_specs.each do |spec|
|
212
261
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
262
|
+
# Use the prebuild framworks as vendered frameworks
|
263
|
+
# get_corresponding_targets
|
264
|
+
targets = Pod.fast_get_targets_for_pod_name(spec.root.name, self.pod_targets, cache)
|
265
|
+
targets.each do |target|
|
266
|
+
# the framework_file_path rule is decided when `install_for_prebuild`,
|
267
|
+
# as to compitable with older version and be less wordy.
|
268
|
+
framework_file_path = target.framework_name
|
269
|
+
framework_file_path = target.name + "/" + framework_file_path if targets.count > 1
|
270
|
+
add_vendered_framework(spec, target.platform.name.to_s, framework_file_path)
|
271
|
+
end
|
272
|
+
# Clean the source files
|
273
|
+
# we just add the prebuilt framework to specific platform and set no source files
|
274
|
+
# for all platform, so it doesn't support the sence that 'a pod perbuild for one
|
275
|
+
# platform and not for another platform.'
|
276
|
+
empty_source_files(spec)
|
277
|
+
|
278
|
+
# to remove the resurce bundle target.
|
279
|
+
# When specify the "resource_bundles" in podspec, xcode will generate a bundle
|
280
|
+
# target after pod install. But the bundle have already built when the prebuit
|
281
|
+
# phase and saved in the framework folder. We will treat it as a normal resource
|
282
|
+
# file.
|
283
|
+
if spec.attributes_hash["resource_bundles"]
|
284
|
+
bundle_names = spec.attributes_hash["resource_bundles"].keys
|
285
|
+
spec.attributes_hash["resource_bundles"] = nil
|
286
|
+
spec.attributes_hash["resources"] ||= []
|
287
|
+
spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"}
|
288
|
+
elsif spec.attributes_hash['ios']["resource_bundles"]
|
289
|
+
bundle_names = spec.attributes_hash['ios']["resource_bundles"].keys
|
290
|
+
spec.attributes_hash['ios']["resource_bundles"] = nil
|
291
|
+
spec.attributes_hash['ios']["resources"] ||= []
|
292
|
+
spec.attributes_hash['ios']["resources"] += bundle_names.map{|n| n+".bundle"}
|
293
|
+
end
|
240
294
|
|
241
|
-
|
242
|
-
|
295
|
+
# to avoid the warning of missing license
|
296
|
+
spec.attributes_hash["license"] = {}
|
243
297
|
|
298
|
+
end
|
244
299
|
end
|
245
300
|
|
246
301
|
end
|
@@ -249,23 +304,25 @@ module Pod
|
|
249
304
|
# Override the download step to skip download and prepare file in target folder
|
250
305
|
old_method = instance_method(:install_source_of_pod)
|
251
306
|
define_method(:install_source_of_pod) do |pod_name|
|
252
|
-
|
253
|
-
|
254
|
-
pod_installer = create_pod_installer(pod_name)
|
255
|
-
# \copy from original
|
256
|
-
|
257
|
-
if self.prebuild_pod_names.include? pod_name
|
258
|
-
pod_installer.install_for_prebuild!(self.sandbox)
|
307
|
+
if Pod::is_prebuild_stage
|
308
|
+
tmp = old_method.bind(self).(pod_name)
|
259
309
|
else
|
260
|
-
|
261
|
-
|
310
|
+
# copy from original
|
311
|
+
pod_installer = create_pod_installer(pod_name)
|
312
|
+
# \copy from original
|
313
|
+
|
314
|
+
if self.prebuild_pod_names.include? pod_name
|
315
|
+
pod_installer.install_for_prebuild!(self.sandbox)
|
316
|
+
else
|
317
|
+
pod_installer.install!
|
318
|
+
end
|
262
319
|
|
263
|
-
|
264
|
-
|
265
|
-
|
320
|
+
# copy from original
|
321
|
+
return @installed_specs.concat(pod_installer.specs_by_platform.values.flatten.uniq)
|
322
|
+
# \copy from original
|
323
|
+
end
|
266
324
|
end
|
267
325
|
|
268
|
-
|
269
326
|
end
|
270
327
|
end
|
271
328
|
|
@@ -278,33 +335,34 @@ end
|
|
278
335
|
module Pod
|
279
336
|
module Generator
|
280
337
|
class EmbedFrameworksScript
|
281
|
-
|
282
338
|
old_method = instance_method(:script)
|
283
339
|
define_method(:script) do
|
284
|
-
|
285
340
|
script = old_method.bind(self).()
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
echo $path;
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
341
|
+
if not Pod::is_prebuild_stage
|
342
|
+
patch = <<-SH.strip_heredoc
|
343
|
+
#!/bin/sh
|
344
|
+
|
345
|
+
# ---- this is added by cocoapods-ppbuild ---
|
346
|
+
# Readlink cannot handle relative symlink well, so we override it to a new one
|
347
|
+
# If the path isn't an absolute path, we add a realtive prefix.
|
348
|
+
old_read_link=`which readlink`
|
349
|
+
readlink () {
|
350
|
+
path=`$old_read_link "$1"`;
|
351
|
+
if [ $(echo "$path" | cut -c 1-1) = '/' ]; then
|
352
|
+
echo $path;
|
353
|
+
else
|
354
|
+
echo "`dirname $1`/$path";
|
355
|
+
fi
|
356
|
+
}
|
357
|
+
# ---
|
358
|
+
SH
|
359
|
+
|
360
|
+
# patch the rsync for copy dSYM symlink
|
361
|
+
script = script.gsub "rsync --delete", "rsync --copy-links --delete"
|
362
|
+
|
363
|
+
script = patch + script
|
364
|
+
end
|
365
|
+
script
|
308
366
|
end
|
309
367
|
end
|
310
368
|
end
|
@@ -86,9 +86,6 @@ module Pod
|
|
86
86
|
class_attr_accessor :custom_build_options_simulator
|
87
87
|
self.custom_build_options = []
|
88
88
|
self.custom_build_options_simulator = []
|
89
|
-
|
90
|
-
class_attr_accessor :static_build_pod_names
|
91
|
-
self.static_build_pod_names = []
|
92
89
|
end
|
93
90
|
end
|
94
91
|
end
|
@@ -116,7 +113,7 @@ Pod::HooksManager.register('cocoapods-ppbuild', :pre_install) do |installer_cont
|
|
116
113
|
require_relative 'helper/prebuild_sandbox'
|
117
114
|
require_relative 'Prebuild'
|
118
115
|
|
119
|
-
Pod::UI.puts "火速编译中..."
|
116
|
+
# Pod::UI.puts "火速编译中..."
|
120
117
|
|
121
118
|
# Fetch original installer (which is running this pre-install hook) options,
|
122
119
|
# then pass them to our installer to perform update if needed
|
@@ -148,7 +145,8 @@ Pod::HooksManager.register('cocoapods-ppbuild', :pre_install) do |installer_cont
|
|
148
145
|
# install
|
149
146
|
lockfile = installer_context.lockfile
|
150
147
|
binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile, lockfile)
|
151
|
-
|
148
|
+
|
149
|
+
require_relative 'Integration'
|
152
150
|
if binary_installer.have_exact_prebuild_cache? && !update
|
153
151
|
binary_installer.install_when_cache_hit!
|
154
152
|
else
|
@@ -170,7 +168,6 @@ Pod::HooksManager.register('cocoapods-ppbuild', :pre_install) do |installer_cont
|
|
170
168
|
# install
|
171
169
|
Pod::UI.puts "\n"
|
172
170
|
Pod::UI.puts "🤖 Pod Install"
|
173
|
-
require_relative 'Integration'
|
174
171
|
# go on the normal install step ...
|
175
172
|
end
|
176
173
|
|
@@ -179,6 +176,10 @@ Pod::HooksManager.register('cocoapods-ppbuild', :post_install) do |installer_con
|
|
179
176
|
if Pod::Podfile::DSL.static_binary
|
180
177
|
Pod::PrebuildSandbox.replace_tagert_copy_source_sh(installer_context)
|
181
178
|
end
|
182
|
-
|
179
|
+
|
180
|
+
if Podfile::DSL.dont_remove_source_code
|
181
|
+
require_relative 'Reference/reference_source_code'
|
182
|
+
installer_context.refrence_source_code
|
183
|
+
end
|
183
184
|
end
|
184
185
|
|
@@ -62,43 +62,6 @@ module Pod
|
|
62
62
|
UI.puts "Using #{name}"
|
63
63
|
end
|
64
64
|
end
|
65
|
-
|
66
|
-
def save_change_targets!
|
67
|
-
sandbox_path = sandbox.root
|
68
|
-
existed_framework_folder = sandbox.generate_framework_path
|
69
|
-
|
70
|
-
if local_manifest != nil
|
71
|
-
changes = prebuild_pods_changes
|
72
|
-
added = changes.added
|
73
|
-
changed = changes.changed
|
74
|
-
unchanged = changes.unchanged
|
75
|
-
deleted = changes.deleted.to_a
|
76
|
-
|
77
|
-
existed_framework_folder.mkdir unless existed_framework_folder.exist?
|
78
|
-
exsited_framework_pod_names = sandbox.exsited_framework_pod_names
|
79
|
-
|
80
|
-
# additions
|
81
|
-
missing = unchanged.select do |pod_name|
|
82
|
-
not exsited_framework_pod_names.include?(pod_name)
|
83
|
-
end
|
84
|
-
|
85
|
-
# 保存有改变的target列表
|
86
|
-
root_names_to_update = (added + changed + missing).uniq
|
87
|
-
updates_target_names = (root_names_to_update + deleted).uniq
|
88
|
-
cache = []
|
89
|
-
updates_targets = []
|
90
|
-
updates_target_names.each do |pod_name|
|
91
|
-
tars = Pod.fast_get_targets_for_pod_name(pod_name, self.pod_targets, cache)
|
92
|
-
if tars.nil? || tars.empty?
|
93
|
-
Pod::UI.puts "There's no target named (#{pod_name}) in Pod.xcodeproj." if t.nil?
|
94
|
-
else
|
95
|
-
updates_targets = (updates_targets + tars).uniq
|
96
|
-
end
|
97
|
-
end
|
98
|
-
updates_dependency_targets = updates_targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []
|
99
|
-
Pod::Prebuild::Passer.prebuild_pod_targets_changes = (updates_targets + updates_dependency_targets).uniq
|
100
|
-
end
|
101
|
-
end
|
102
65
|
|
103
66
|
# Build the needed framework files
|
104
67
|
def prebuild_frameworks!
|
@@ -128,8 +91,8 @@ module Pod
|
|
128
91
|
cache = []
|
129
92
|
targets = root_names_to_update.map do |pod_name|
|
130
93
|
tars = Pod.fast_get_targets_for_pod_name(pod_name, self.pod_targets, cache)
|
131
|
-
if tars.nil?
|
132
|
-
|
94
|
+
if tars.nil?
|
95
|
+
tars = []
|
133
96
|
end
|
134
97
|
tars
|
135
98
|
end.flatten
|
@@ -157,6 +120,7 @@ module Pod
|
|
157
120
|
end
|
158
121
|
|
159
122
|
output_path = sandbox.framework_folder_path_for_target_name(target.name)
|
123
|
+
output_path.rmtree if output_path.exist?
|
160
124
|
output_path.mkpath unless output_path.exist?
|
161
125
|
Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled, Podfile::DSL.custom_build_options, Podfile::DSL.custom_build_options_simulator)
|
162
126
|
|
@@ -261,13 +225,10 @@ module Pod
|
|
261
225
|
end
|
262
226
|
end
|
263
227
|
|
264
|
-
#
|
265
|
-
|
228
|
+
# hook run_plugins_post_install_hooks 方法
|
229
|
+
install_hooks_method = instance_method(:run_plugins_post_install_hooks)
|
266
230
|
define_method(:run_plugins_post_install_hooks) do
|
267
|
-
|
268
|
-
self.save_change_targets!
|
269
|
-
end
|
270
|
-
old_method2.bind(self).()
|
231
|
+
install_hooks_method.bind(self).()
|
271
232
|
if Pod::is_prebuild_stage
|
272
233
|
self.prebuild_frameworks!
|
273
234
|
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
|
2
|
+
require 'xcodeproj'
|
3
|
+
require_relative '../helper/passer'
|
4
|
+
require_relative '../helper/prebuild_sandbox'
|
5
|
+
|
6
|
+
module Pod
|
7
|
+
class Installer
|
8
|
+
class PostInstallHooksContext
|
9
|
+
# 将源码引入主工程,方便源码调试
|
10
|
+
def refrence_source_code
|
11
|
+
sandbox_path = Pathname.new(sandbox.root)
|
12
|
+
pre_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(sandbox)
|
13
|
+
|
14
|
+
exsited_framework_pod_names = pre_sandbox.exsited_framework_pod_names || []
|
15
|
+
proj_path = sandbox_path + get_project_name("Pods")
|
16
|
+
project = Xcodeproj::Project.open(proj_path)
|
17
|
+
exsited_framework_pod_names.each do |target_name|
|
18
|
+
real_reference("_Prebuild/#{target_name}", proj_path, target_name)
|
19
|
+
end
|
20
|
+
project.save;
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
def get_project_name(tageter_name)
|
25
|
+
return "#{tageter_name}.xcodeproj"
|
26
|
+
end
|
27
|
+
|
28
|
+
def real_reference(file_path, project, target_name)
|
29
|
+
group = project.main_group.find_subpath(File.join("SourceCode", target_name), true)
|
30
|
+
group.set_source_tree('SOURCE_ROOT')
|
31
|
+
group.set_path(file_path)
|
32
|
+
add_files_to_group(group)
|
33
|
+
end
|
34
|
+
|
35
|
+
#添加文件链接
|
36
|
+
def add_files_to_group(group)
|
37
|
+
Dir.foreach(group.real_path) do |entry|
|
38
|
+
filePath = File.join(group.real_path, entry)
|
39
|
+
# 过滤目录和.DS_Store文件
|
40
|
+
if entry != ".DS_Store" && !filePath.to_s.end_with?(".meta") &&entry != "." &&entry != ".." then
|
41
|
+
# 向group中增加文件引用
|
42
|
+
group.new_reference(filePath)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
|
@@ -36,6 +36,10 @@ module Pod
|
|
36
36
|
class_attr_accessor :target_names_to_skip_integration_framework
|
37
37
|
self.target_names_to_skip_integration_framework = []
|
38
38
|
|
39
|
+
# 编译过的framework pod 名称
|
40
|
+
class_attr_accessor :static_build_pod_names
|
41
|
+
self.static_build_pod_names = []
|
42
|
+
|
39
43
|
end
|
40
44
|
end
|
41
45
|
end
|
@@ -73,7 +73,6 @@ module Pod
|
|
73
73
|
flag_file_path = folder + "#{pod_name}.pod_name"
|
74
74
|
return "" unless flag_file_path.exist?
|
75
75
|
version = File.read(flag_file_path)
|
76
|
-
Pod::UI.puts "............ version: #{version}"
|
77
76
|
version
|
78
77
|
end
|
79
78
|
|
@@ -115,3 +114,22 @@ module Pod
|
|
115
114
|
end
|
116
115
|
end
|
117
116
|
end
|
117
|
+
|
118
|
+
module Pod
|
119
|
+
class Sandbox
|
120
|
+
# hook 清除pod方法,得到删除的pod,通知主pod更新
|
121
|
+
clean_method = instance_method(:clean_pod)
|
122
|
+
define_method(:clean_pod) do |pod_name|
|
123
|
+
if Pod::is_prebuild_stage
|
124
|
+
if Pod::Prebuild::Passer.prebuild_pod_targets_changes.nil?
|
125
|
+
Pod::Prebuild::Passer.prebuild_pod_targets_changes = [pod_name]
|
126
|
+
else
|
127
|
+
Pod::Prebuild::Passer.prebuild_pod_targets_changes = (Pod::Prebuild::Passer.prebuild_pod_targets_changes + [pod_name]).uniq
|
128
|
+
end
|
129
|
+
end
|
130
|
+
clean_method.bind(self).(pod_name)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-ppbuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 彭懂
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- lib/cocoapods-ppbuild/Integration.rb
|
50
50
|
- lib/cocoapods-ppbuild/Main.rb
|
51
51
|
- lib/cocoapods-ppbuild/Prebuild.rb
|
52
|
+
- lib/cocoapods-ppbuild/Reference/reference_source_code.rb
|
52
53
|
- lib/cocoapods-ppbuild/command.rb
|
53
54
|
- lib/cocoapods-ppbuild/command/ppbuild.rb
|
54
55
|
- lib/cocoapods-ppbuild/gem_version.rb
|