cocoapods-ppbuild 1.0.1 → 1.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 +22 -7
- data/lib/cocoapods-ppbuild/Main.rb +5 -4
- data/lib/cocoapods-ppbuild/Prebuild.rb +2 -3
- data/lib/cocoapods-ppbuild/gem_version.rb +1 -1
- data/lib/cocoapods-ppbuild/helper/passer.rb +4 -0
- data/lib/cocoapods-ppbuild/reference/reference_source_code.rb +51 -0
- 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: 53dd9ab48b9084264f5f7251529922c6f338d556634bd765e9e6bdb39ee79b34
|
4
|
+
data.tar.gz: 398d6bae393855400ba28dcae5a0db71cbd9b5676a1c43ef423a79934d3e772d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2358845e6481c333ee5e3270fd17160b51975569bfe55220fedc66f27f8d0f3bbfa470a346a708d5ad2c2602e91f69f54d65d8b973f261a80385331e2bc3eac
|
7
|
+
data.tar.gz: 1c09d293fc5a76e7116e52cd0acfe7698b364c2a0c234cf5c99365aad3a56ba8a8dd0504cc49bbf8e89d592cd3bad3b9e0b410d1ba6585d58006d1171451b97f
|
@@ -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
|
|
@@ -74,8 +77,7 @@ module Pod
|
|
74
77
|
end
|
75
78
|
target_folder.rmtree if target_folder.exist?
|
76
79
|
target_folder.mkpath
|
77
|
-
|
78
|
-
|
80
|
+
|
79
81
|
walk(real_file_folder) do |child|
|
80
82
|
source = child
|
81
83
|
|
@@ -232,13 +234,20 @@ module Pod
|
|
232
234
|
cache = []
|
233
235
|
|
234
236
|
def add_vendered_framework(spec, platform, added_framework_file_path)
|
235
|
-
|
236
|
-
|
237
|
+
platform_map = spec.attributes_hash[platform]
|
238
|
+
if platform_map == nil
|
239
|
+
platform_map = {}
|
237
240
|
end
|
238
|
-
vendored_frameworks =
|
241
|
+
vendored_frameworks = platform_map["vendored_frameworks"] || []
|
239
242
|
vendored_frameworks = [vendored_frameworks] if vendored_frameworks.kind_of?(String)
|
243
|
+
vf = spec.attributes_hash["vendored_frameworks"] || []
|
244
|
+
vf = [vf] if vf.kind_of?(String)
|
245
|
+
vendored_frameworks += vf
|
240
246
|
vendored_frameworks += [added_framework_file_path]
|
241
|
-
spec.attributes_hash[
|
247
|
+
spec.attributes_hash["vendored_frameworks"] = vendored_frameworks
|
248
|
+
if spec.attributes_hash[platform] != nil
|
249
|
+
spec.attributes_hash[platform].delete("vendored_frameworks")
|
250
|
+
end
|
242
251
|
end
|
243
252
|
def empty_source_files(spec)
|
244
253
|
spec.attributes_hash["source_files"] = []
|
@@ -278,11 +287,17 @@ module Pod
|
|
278
287
|
# target after pod install. But the bundle have already built when the prebuit
|
279
288
|
# phase and saved in the framework folder. We will treat it as a normal resource
|
280
289
|
# file.
|
290
|
+
|
281
291
|
if spec.attributes_hash["resource_bundles"]
|
282
292
|
bundle_names = spec.attributes_hash["resource_bundles"].keys
|
283
293
|
spec.attributes_hash["resource_bundles"] = nil
|
284
294
|
spec.attributes_hash["resources"] ||= []
|
285
295
|
spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"}
|
296
|
+
elsif spec.attributes_hash['ios'] && spec.attributes_hash['ios']["resource_bundles"]
|
297
|
+
bundle_names = spec.attributes_hash['ios']["resource_bundles"].keys
|
298
|
+
spec.attributes_hash['ios']["resource_bundles"] = nil
|
299
|
+
spec.attributes_hash['ios']["resources"] ||= []
|
300
|
+
spec.attributes_hash['ios']["resources"] += bundle_names.map{|n| n+".bundle"}
|
286
301
|
end
|
287
302
|
|
288
303
|
# to avoid the warning of missing license
|
@@ -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
|
@@ -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 !Pod.is_prebuild_stage && Pod::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
|
|
@@ -114,13 +114,12 @@ module Pod
|
|
114
114
|
Pod::UI.puts "Prebuild frameworks (total #{targets.count})"
|
115
115
|
Pod::Prebuild.remove_build_dir(sandbox_path)
|
116
116
|
targets.each do |target|
|
117
|
+
output_path = sandbox.framework_folder_path_for_target_name(target.name)
|
118
|
+
output_path.rmtree if output_path.exist?
|
117
119
|
if !target.should_build?
|
118
120
|
UI.puts "Prebuilding #{target.label}"
|
119
121
|
next
|
120
122
|
end
|
121
|
-
|
122
|
-
output_path = sandbox.framework_folder_path_for_target_name(target.name)
|
123
|
-
output_path.rmtree if output_path.exist?
|
124
123
|
output_path.mkpath unless output_path.exist?
|
125
124
|
Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled, Podfile::DSL.custom_build_options, Podfile::DSL.custom_build_options_simulator)
|
126
125
|
|
@@ -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
|
@@ -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}", project, 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
|
+
|
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: 1.0.
|
4
|
+
version: 1.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-10-
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,6 +58,7 @@ files:
|
|
58
58
|
- lib/cocoapods-ppbuild/helper/podfile_options.rb
|
59
59
|
- lib/cocoapods-ppbuild/helper/prebuild_sandbox.rb
|
60
60
|
- lib/cocoapods-ppbuild/helper/target_checker.rb
|
61
|
+
- lib/cocoapods-ppbuild/reference/reference_source_code.rb
|
61
62
|
- lib/cocoapods-ppbuild/rome/build_framework.rb
|
62
63
|
- lib/cocoapods-ppbuild/tool/tool.rb
|
63
64
|
- lib/cocoapods_plugin.rb
|