cocoapods-ppbuild 0.0.4 → 0.0.5
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 +5 -6
- data/lib/cocoapods-ppbuild/Main.rb +1 -0
- data/lib/cocoapods-ppbuild/Prebuild.rb +45 -8
- data/lib/cocoapods-ppbuild/gem_version.rb +1 -1
- data/lib/cocoapods-ppbuild/helper/passer.rb +1 -1
- data/lib/cocoapods-ppbuild/helper/podfile_options.rb +4 -3
- data/lib/cocoapods-ppbuild/helper/prebuild_sandbox.rb +10 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5573fd6b439b3b7f14cd3af40775271c6adb2df5d2694ea06a052b765e7bca7
|
4
|
+
data.tar.gz: 34ff8d8e4212d82b442b950191569c232b4abbcc4e2767520d579c9be8ba940c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16dc03357ff651e30773a1b12a2c166e0c30316f85662265ed553eb483302a6fec5f48fc3a75eaf23958db718c1b6a1259cca9285f90bddbaf1ab197a69b699b
|
7
|
+
data.tar.gz: 3bd1ae9b7287f11c96eea8969c23e07125d8d820ad7cd147973920bf39c3a466b4a612c07fd67f2a08c4db88cf19ed84da36262ac70cf84a4548435000d8f546
|
@@ -62,6 +62,7 @@ module Pod
|
|
62
62
|
|
63
63
|
target_names.each do |name|
|
64
64
|
|
65
|
+
Pod::UI.puts "........... oname: #{name}"
|
65
66
|
# symbol link copy all substructure
|
66
67
|
real_file_folder = prebuild_sandbox.framework_folder_path_for_target_name(name)
|
67
68
|
|
@@ -111,6 +112,7 @@ module Pod
|
|
111
112
|
if object.real_file_path != nil
|
112
113
|
real_path = Pathname.new(object.target_file_path)
|
113
114
|
real_path.rmtree if real_path.exist?
|
115
|
+
Pod::UI.puts "........... object.target_file_path: #{object.target_file_path}"
|
114
116
|
make_link(object.real_file_path, object.target_file_path, false)
|
115
117
|
end
|
116
118
|
end
|
@@ -135,15 +137,13 @@ module Pod
|
|
135
137
|
# Remove the old target files if prebuild frameworks changed
|
136
138
|
def remove_target_files_if_needed
|
137
139
|
|
138
|
-
changes = Pod::Prebuild::Passer.
|
140
|
+
changes = Pod::Prebuild::Passer.prebuild_pod_targets_changes
|
139
141
|
updated_names = []
|
140
142
|
if changes == nil
|
141
143
|
updated_names = PrebuildSandbox.from_standard_sandbox(self.sandbox).exsited_framework_pod_names
|
142
144
|
else
|
143
|
-
|
144
|
-
|
145
|
-
deleted = changes.deleted
|
146
|
-
updated_names = added + changed + deleted
|
145
|
+
t_names = changes.map { |e| e.pod_name }
|
146
|
+
updated_names = (updated_names + t_names).uniq
|
147
147
|
end
|
148
148
|
|
149
149
|
updated_names.each do |name|
|
@@ -164,7 +164,6 @@ module Pod
|
|
164
164
|
# Modify specification to use only the prebuild framework after analyzing
|
165
165
|
old_method2 = instance_method(:resolve_dependencies)
|
166
166
|
define_method(:resolve_dependencies) do
|
167
|
-
|
168
167
|
# Remove the old target files, else it will not notice file changes
|
169
168
|
self.remove_target_files_if_needed
|
170
169
|
|
@@ -62,7 +62,43 @@ 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
|
65
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
|
66
102
|
|
67
103
|
# Build the needed framework files
|
68
104
|
def prebuild_frameworks!
|
@@ -87,11 +123,8 @@ module Pod
|
|
87
123
|
missing = unchanged.select do |pod_name|
|
88
124
|
not exsited_framework_pod_names.include?(pod_name)
|
89
125
|
end
|
90
|
-
|
91
|
-
|
92
|
-
root_names_to_update = (added + changed + missing)
|
93
|
-
|
94
|
-
# transform names to targets
|
126
|
+
root_names_to_update = (added + changed + missing).uniq
|
127
|
+
# 生成预编译target
|
95
128
|
cache = []
|
96
129
|
targets = root_names_to_update.map do |pod_name|
|
97
130
|
tars = Pod.fast_get_targets_for_pod_name(pod_name, self.pod_targets, cache)
|
@@ -101,8 +134,11 @@ module Pod
|
|
101
134
|
tars
|
102
135
|
end.flatten
|
103
136
|
|
104
|
-
#
|
137
|
+
# 添加依赖
|
105
138
|
dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []
|
139
|
+
dependency_targets = dependency_targets.select do |tar|
|
140
|
+
sandbox.existed_target_version_for_pod_name(tar.pod_name) != tar.version
|
141
|
+
end
|
106
142
|
targets = (targets + dependency_targets).uniq
|
107
143
|
else
|
108
144
|
targets = self.pod_targets
|
@@ -228,12 +264,13 @@ module Pod
|
|
228
264
|
# patch the post install hook
|
229
265
|
old_method2 = instance_method(:run_plugins_post_install_hooks)
|
230
266
|
define_method(:run_plugins_post_install_hooks) do
|
267
|
+
if Pod::is_prebuild_stage
|
268
|
+
self.save_change_targets!
|
269
|
+
end
|
231
270
|
old_method2.bind(self).()
|
232
271
|
if Pod::is_prebuild_stage
|
233
272
|
self.prebuild_frameworks!
|
234
273
|
end
|
235
274
|
end
|
236
|
-
|
237
|
-
|
238
275
|
end
|
239
276
|
end
|
@@ -77,9 +77,10 @@ module Pod
|
|
77
77
|
|
78
78
|
# filter prebuild
|
79
79
|
prebuild_names = target_definition.prebuild_framework_pod_names
|
80
|
-
if not Podfile::DSL.prebuild_all
|
81
|
-
|
82
|
-
end
|
80
|
+
# if not Podfile::DSL.prebuild_all
|
81
|
+
# targets = targets.select { |pod_target| prebuild_names.include?(pod_target.pod_name) }
|
82
|
+
# end
|
83
|
+
targets = targets.select { |pod_target| prebuild_names.include?(pod_target.pod_name) }
|
83
84
|
dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []
|
84
85
|
targets = (targets + dependency_targets).uniq
|
85
86
|
|
@@ -67,13 +67,21 @@ module Pod
|
|
67
67
|
exsited_framework_name_pairs.select {|pair| pair[1] == pod_name }.map { |pair| pair[0]}
|
68
68
|
end
|
69
69
|
|
70
|
-
|
70
|
+
def existed_target_version_for_pod_name(pod_name)
|
71
|
+
folder = framework_folder_path_for_target_name(pod_name)
|
72
|
+
return "" unless folder.exist?
|
73
|
+
flag_file_path = folder + "#{pod_name}.pod_name"
|
74
|
+
return "" unless flag_file_path.exist?
|
75
|
+
version = File.read(flag_file_path)
|
76
|
+
Pod::UI.puts "............ version: #{version}"
|
77
|
+
version
|
78
|
+
end
|
71
79
|
|
72
80
|
def save_pod_name_for_target(target)
|
73
81
|
folder = framework_folder_path_for_target_name(target.name)
|
74
82
|
return unless folder.exist?
|
75
83
|
flag_file_path = folder + "#{target.pod_name}.pod_name"
|
76
|
-
File.write(flag_file_path.to_s, "")
|
84
|
+
File.write(flag_file_path.to_s, "#{target.version}")
|
77
85
|
end
|
78
86
|
|
79
87
|
def real_bundle_path_for_pod(path)
|
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: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 彭懂
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -61,7 +61,7 @@ files:
|
|
61
61
|
- lib/cocoapods-ppbuild/rome/build_framework.rb
|
62
62
|
- lib/cocoapods-ppbuild/tool/tool.rb
|
63
63
|
- lib/cocoapods_plugin.rb
|
64
|
-
homepage: https://github.com/
|
64
|
+
homepage: https://github.com/pdcodeunder/cocoapods-ppbuild.git
|
65
65
|
licenses:
|
66
66
|
- MIT
|
67
67
|
metadata: {}
|