pod-builder 1.3.0 ā 1.4.0
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/pod_builder/command/update_lldbinit.rb +49 -42
- data/lib/pod_builder/info.rb +1 -0
- data/lib/pod_builder/install.rb +22 -0
- data/lib/pod_builder/podfile.rb +1 -1
- data/lib/pod_builder/podspec.rb +4 -0
- data/lib/pod_builder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91a5ccf7fb23793e2ecf8718184ee974243d54d9b409f461258ccda6b0b3555d
|
4
|
+
data.tar.gz: 9a1165d7add34652970ae37075dccfd5f0eac075c572d68e87e987c8b37e21eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb1b9dd1e39b15ccd02dd8fefccb4c2804e6fac2c1583f97fe07af411c450d88d973771dead2382fe5ce8f2582f391c944c95c9deb81f0560bedbff0fd5f0391
|
7
|
+
data.tar.gz: ece28a885c32def12c37543b9ebd1df476e568ee324b711500112701576b1fe28ce57c13dfe3938385d599fdbc34dfd5f607c24e5180a6606a0703708168df04
|
@@ -18,32 +18,35 @@ module PodBuilder
|
|
18
18
|
|
19
19
|
base_path = PodBuilder::basepath("")
|
20
20
|
|
21
|
+
podfile_restore_content = File.read(PodBuilder::basepath("Podfile.restore"))
|
22
|
+
app_podfile_content = File.read(PodBuilder::project_path("Podfile"))
|
23
|
+
|
21
24
|
lldbinit_path = File.expand_path('~/.lldbinit-Xcode')
|
22
25
|
lldbinit_content = File.exists?(lldbinit_path) ? File.read(lldbinit_path) : ""
|
23
|
-
|
24
|
-
if lldbinit_content.include?("# <pb_md5:#{base_path}:#{
|
26
|
+
status_hash = podfiles_status_hash(app_podfile_content, podfile_restore_content)
|
27
|
+
if lldbinit_content.include?("# <pb_md5:#{base_path}:#{status_hash}")
|
25
28
|
puts "\n\nš already in sync!\n".green
|
26
29
|
return 0
|
27
30
|
end
|
28
31
|
|
29
|
-
|
32
|
+
source_path = argument_pods[0]
|
30
33
|
|
31
|
-
is_absolute = ["~", "/"].include?(
|
34
|
+
is_absolute = ["~", "/"].include?(source_path[0])
|
32
35
|
if !is_absolute
|
33
|
-
|
36
|
+
source_path = Pathname.new(File.join(base_path, source_path))
|
34
37
|
end
|
35
38
|
|
36
|
-
|
39
|
+
source_path = File.expand_path(source_path)
|
37
40
|
|
38
41
|
framework_paths = Dir.glob("#{base_path}/**/*.framework")
|
39
42
|
|
40
43
|
unless framework_paths.count > 0
|
41
|
-
raise "\n\nNo prebuilt frameworks found in `#{
|
44
|
+
raise "\n\nNo prebuilt frameworks found in `#{framework_paths}`\n\n".red
|
42
45
|
end
|
43
46
|
|
44
47
|
puts "Extracting debug information".yellow
|
45
48
|
|
46
|
-
podspec_paths = Dir.glob("#{
|
49
|
+
podspec_paths = Dir.glob("#{source_path}/**/*.podspec") + Dir.glob("#{source_path}/**/*.podspec.json")
|
47
50
|
podspec_contents = podspec_paths.map { |t| File.read(t).gsub(/\s+/, "").gsub("\"", "'") }
|
48
51
|
|
49
52
|
replace_paths = []
|
@@ -51,49 +54,50 @@ module PodBuilder
|
|
51
54
|
framework_paths.each do |framework_path|
|
52
55
|
name = File.basename(framework_path, File.extname(framework_path))
|
53
56
|
executable_path = File.join(framework_path, name)
|
57
|
+
|
58
|
+
podbuilder_plist = File.join(framework_path, Configuration.framework_plist_filename)
|
59
|
+
|
60
|
+
plist = CFPropertyList::List.new(:file => podbuilder_plist)
|
61
|
+
data = CFPropertyList.native_types(plist.value)
|
62
|
+
|
63
|
+
original_compile_path = data["original_compile_path"]
|
64
|
+
is_prebuilt = data.fetch("is_prebuilt", true)
|
65
|
+
|
66
|
+
if original_compile_path.nil?
|
67
|
+
puts "\n\n#{framework_path} was compiled with an older version of PodBuilder, please rebuild it to update `~/.lldbinit-Xcode`"
|
68
|
+
next
|
69
|
+
end
|
54
70
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
if podspec_path
|
71
|
+
if is_prebuilt
|
72
|
+
next
|
73
|
+
end
|
74
|
+
|
75
|
+
if podspec_path = find_podspec_path_for(name, podspec_paths, podspec_contents)
|
76
|
+
if !is_development_pod(podspec_path, app_podfile_content)
|
61
77
|
replace_paths.push("#{original_compile_path},#{File.dirname(podspec_path)}")
|
62
78
|
else
|
63
|
-
puts "
|
64
|
-
end
|
79
|
+
puts "#{name} is in development pod, skipping"
|
80
|
+
end
|
65
81
|
else
|
66
|
-
|
67
|
-
|
68
|
-
dsym_paths.each do |dsym_path|
|
69
|
-
name = File.basename(dsym_path, ".framework.dSYM")
|
70
|
-
dsym_dwarf_path = File.join(dsym_path, "Contents/Resources/DWARF")
|
71
|
-
dsym_dwarf_path = File.join(dsym_dwarf_path, name)
|
72
|
-
|
73
|
-
dwarf_dump_lib = `dwarfdump --debug-info #{dsym_dwarf_path} | grep '#{Configuration.build_base_path}' | head -n 1`.strip()
|
74
|
-
|
75
|
-
if (matches = dwarf_dump_lib.match(/#{Configuration.build_base_path}(.*)\/Pods/)) && matches.size == 2
|
76
|
-
original_compile_path = "#{Configuration.build_base_path}#{matches[1]}/Pods/#{name}"
|
77
|
-
|
78
|
-
if podspec_path = find_podspec_path_for(name, podspec_paths, podspec_contents)
|
79
|
-
replace_paths.push("#{original_compile_path},#{File.dirname(podspec_path)}")
|
80
|
-
else
|
81
|
-
puts "Failed to find podspec for #{name}".blue
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
82
|
+
puts "Failed to find podspec for #{name}, skipping".blue
|
83
|
+
end
|
86
84
|
end
|
87
85
|
|
88
86
|
replace_paths.uniq!
|
89
87
|
|
90
88
|
source_map_lines = replace_paths.flat_map { |t| ["# <pb:#{base_path}>\n", "settings append target.source-map '#{t.split(",").first}' '#{t.split(",").last}'\n"] }
|
91
|
-
rewrite_lldinit(source_map_lines, base_path)
|
89
|
+
rewrite_lldinit(source_map_lines, base_path, app_podfile_content, podfile_restore_content)
|
92
90
|
|
93
91
|
puts "\n\nš done!\n".green
|
94
92
|
return 0
|
95
93
|
end
|
96
94
|
|
95
|
+
def self.is_development_pod(podspec_path, app_podfile_content)
|
96
|
+
development_path = Pathname.new(podspec_path).relative_path_from(Pathname.new(PodBuilder::project_path)).parent.to_s
|
97
|
+
|
98
|
+
return app_podfile_content.include?(":path => '#{development_path}'")
|
99
|
+
end
|
100
|
+
|
97
101
|
def self.find_podspec_path_for(name, podspec_paths, podspec_contents)
|
98
102
|
if (path = podspec_paths.detect { |t| File.basename(t, ".podspec") == name.gsub("_", "-") })
|
99
103
|
return path
|
@@ -110,11 +114,14 @@ module PodBuilder
|
|
110
114
|
end
|
111
115
|
end
|
112
116
|
|
113
|
-
def self.
|
114
|
-
|
117
|
+
def self.podfiles_status_hash(app_podfile_content, podfile_restore_content)
|
118
|
+
# Change to either Podfile.restore (which presumely mean new prebuilds done)
|
119
|
+
# or app's Podfile (which my occurr when pods are switched to development pod)
|
120
|
+
# should force a regeneration of the status identifier
|
121
|
+
Digest::MD5.hexdigest(podfile_restore_content + app_podfile_content)
|
115
122
|
end
|
116
123
|
|
117
|
-
def self.rewrite_lldinit(source_map_lines, base_path)
|
124
|
+
def self.rewrite_lldinit(source_map_lines, base_path, app_podfile_content, podfile_restore_content)
|
118
125
|
puts "Writing ~/.lldbinit-Xcode".yellow
|
119
126
|
|
120
127
|
lldbinit_path = File.expand_path('~/.lldbinit-Xcode')
|
@@ -137,12 +144,12 @@ module PodBuilder
|
|
137
144
|
end
|
138
145
|
end
|
139
146
|
|
140
|
-
|
147
|
+
status_hash = podfiles_status_hash(app_podfile_content, podfile_restore_content)
|
141
148
|
|
142
149
|
source_map_lines.insert(0, "# <pb>\n")
|
143
150
|
source_map_lines.insert(1, "settings clear target.source-map\n")
|
144
151
|
source_map_lines.insert(2, "# <pb:#{base_path}>\n")
|
145
|
-
source_map_lines.insert(3, "# <pb_md5:#{base_path}:#{
|
152
|
+
source_map_lines.insert(3, "# <pb_md5:#{base_path}:#{status_hash}>\n")
|
146
153
|
|
147
154
|
lldbinit_lines += source_map_lines
|
148
155
|
|
data/lib/pod_builder/info.rb
CHANGED
@@ -130,6 +130,7 @@ module PodBuilder
|
|
130
130
|
result.merge!({ "version": pod_version })
|
131
131
|
result.merge!({ "specs": (data["specs"] || []) })
|
132
132
|
result.merge!({ "is_static": (data["is_static"] || false) })
|
133
|
+
result.merge!({ "original_compile_path": (data["original_compile_path"] || "") })
|
133
134
|
|
134
135
|
return result
|
135
136
|
end
|
data/lib/pod_builder/install.rb
CHANGED
@@ -17,6 +17,27 @@ class Pod::Specification::Linter::Analyzer
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
Pod::Downloader.singleton_class.send(:alias_method, :swz_download, :download)
|
21
|
+
|
22
|
+
module Pod::Downloader
|
23
|
+
def self.download(
|
24
|
+
request,
|
25
|
+
target,
|
26
|
+
can_cache: true,
|
27
|
+
cache_path: Pod::Config.instance.cache_root + 'Pods'
|
28
|
+
)
|
29
|
+
result = swz_download(request, target)
|
30
|
+
|
31
|
+
if overrides = PodBuilder::Configuration.spec_overrides[result.spec.name]
|
32
|
+
overrides.each do |k, v|
|
33
|
+
result.spec.attributes_hash[k] = v
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
result
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
20
41
|
module PodBuilder
|
21
42
|
class Install
|
22
43
|
def self.podfile(podfile_content, podfile_items, build_configuration)
|
@@ -115,6 +136,7 @@ module PodBuilder
|
|
115
136
|
subspec_self_deps = subspecs_deps.select { |x| x.start_with?("#{podfile_item.root_name}/") }
|
116
137
|
plist_data['specs'] = (specs.map(&:name) + subspec_self_deps).uniq
|
117
138
|
plist_data['is_static'] = podfile_item.is_static
|
139
|
+
plist_data['original_compile_path'] = Configuration.build_path
|
118
140
|
|
119
141
|
plist.value = CFPropertyList.guess(plist_data)
|
120
142
|
plist.save(podbuilder_file, CFPropertyList::List::FORMAT_BINARY)
|
data/lib/pod_builder/podfile.rb
CHANGED
data/lib/pod_builder/podspec.rb
CHANGED
@@ -34,6 +34,10 @@ module PodBuilder
|
|
34
34
|
private_constant :PodspecItem
|
35
35
|
|
36
36
|
def self.generate(all_buildable_items, analyzer)
|
37
|
+
unless all_buildable_items.count > 0
|
38
|
+
return
|
39
|
+
end
|
40
|
+
|
37
41
|
puts "Generating PodBuilder's local podspec".yellow
|
38
42
|
|
39
43
|
podspec_items = podspec_items_from(all_buildable_items)
|
data/lib/pod_builder/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pod-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Camin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|