xcode-archive-cache 0.0.11 → 0.0.12
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/build/product_extractor.rb +13 -11
- data/lib/build_graph/native_target_finder.rb +1 -1
- data/lib/injection/injector.rb +3 -3
- data/lib/injection/pods_script_fixer.rb +16 -13
- data/lib/injection/pods_xcframework_fixer.rb +1 -1
- data/lib/injection/storage.rb +7 -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: b2121ee4ca94b2acfa38e1071a6f30209381464a7da5239e919d4b70cafd1d84
|
4
|
+
data.tar.gz: 9874700c995c65ee3ecaa4772a1aa6deba6868591b96da6d271b9ee1f32588df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 528092da4900b8232d71a9583ec0752c92ff2ee851bc13db3609c91c1a9aec3db4278abb777a3c574728d35b409b59ede6fc1481c0dafed49b93a396b994b114
|
7
|
+
data.tar.gz: c16c9ff1c2623437b5e29c0fea3cd1bc10cfe631c4df1772197595392b5a05286a8223294c20f9dc306b5ed47089f7c7c85c7eeb4138a940d2a37861c6266bdc
|
@@ -122,10 +122,12 @@ module XcodeArchiveCache
|
|
122
122
|
# @return [String]
|
123
123
|
#
|
124
124
|
def get_main_product_glob(built_node)
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
125
|
+
product_names = [File.basename(built_node.native_target.product_reference.path)]
|
126
|
+
if built_node.native_target.product_reference.name
|
127
|
+
product_names.push(File.basename(built_node.native_target.product_reference.name))
|
128
|
+
end
|
129
|
+
|
130
|
+
get_product_glob(product_names.select { |name| File.extname(name).length > 0 })
|
129
131
|
end
|
130
132
|
|
131
133
|
# @param [XcodeArchiveCache::BuildGraph::Node] built_node
|
@@ -133,7 +135,7 @@ module XcodeArchiveCache
|
|
133
135
|
# @return [String]
|
134
136
|
#
|
135
137
|
def get_swift_objc_interface_header_glob(built_node)
|
136
|
-
get_product_glob(File.basename(built_node.swift_objc_interface_header_file))
|
138
|
+
get_product_glob([File.basename(built_node.swift_objc_interface_header_file)])
|
137
139
|
end
|
138
140
|
|
139
141
|
# @param [XcodeArchiveCache::BuildGraph::Node] built_node
|
@@ -142,7 +144,7 @@ module XcodeArchiveCache
|
|
142
144
|
#
|
143
145
|
def get_swiftmodule_glob(built_node)
|
144
146
|
if built_node.module_name
|
145
|
-
get_product_glob(built_node.module_name + ".swiftmodule")
|
147
|
+
get_product_glob([built_node.module_name + ".swiftmodule"])
|
146
148
|
end
|
147
149
|
end
|
148
150
|
|
@@ -153,24 +155,24 @@ module XcodeArchiveCache
|
|
153
155
|
def get_modulemap_glob(built_node)
|
154
156
|
resulting_modulemap_file_name = built_node.resulting_modulemap_file_name
|
155
157
|
if resulting_modulemap_file_name
|
156
|
-
get_product_glob(resulting_modulemap_file_name)
|
158
|
+
get_product_glob([resulting_modulemap_file_name])
|
157
159
|
else
|
158
160
|
modulemap_file_path = built_node.original_modulemap_file_path
|
159
161
|
if modulemap_file_path && File.exist?(modulemap_file_path)
|
160
162
|
modulemap_file_name = File.basename(modulemap_file_path)
|
161
|
-
get_product_glob(modulemap_file_name)
|
163
|
+
get_product_glob([modulemap_file_name])
|
162
164
|
end
|
163
165
|
end
|
164
166
|
end
|
165
167
|
|
166
|
-
# @param [String]
|
168
|
+
# @param [Array<String>] file_names
|
167
169
|
#
|
168
170
|
# @return [String]
|
169
171
|
#
|
170
|
-
def get_product_glob(
|
172
|
+
def get_product_glob(file_names)
|
171
173
|
File.join(derived_data_path,
|
172
174
|
"**",
|
173
|
-
|
175
|
+
"{#{file_names.join(",")}}")
|
174
176
|
end
|
175
177
|
|
176
178
|
# @param [String] framework_path
|
@@ -123,7 +123,7 @@ module XcodeArchiveCache
|
|
123
123
|
#
|
124
124
|
def find_for_product_name(product_name)
|
125
125
|
canonical = all_targets
|
126
|
-
.select {|native_target| native_target.name == product_name || native_target.product_reference.display_name == product_name}
|
126
|
+
.select {|native_target| native_target.name == product_name || native_target.product_reference.display_name == product_name || native_target.product_reference.path == product_name }
|
127
127
|
.first
|
128
128
|
|
129
129
|
parsed = @product_name_to_target[product_name]
|
data/lib/injection/injector.rb
CHANGED
@@ -13,7 +13,7 @@ module XcodeArchiveCache
|
|
13
13
|
@headers_mover = HeadersMover.new(storage)
|
14
14
|
@dependency_remover = DependencyRemover.new
|
15
15
|
@build_flags_changer = BuildFlagsChanger.new
|
16
|
-
@pods_fixer = PodsScriptFixer.new
|
16
|
+
@pods_fixer = PodsScriptFixer.new(storage)
|
17
17
|
@modulemap_fixer = XcodeArchiveCache::Modulemap::HeaderPathFixer.new(storage)
|
18
18
|
@framework_embedder = FrameworkEmbedder.new
|
19
19
|
end
|
@@ -55,8 +55,8 @@ module XcodeArchiveCache
|
|
55
55
|
# are covered by "Embed Pods Frameworks" script
|
56
56
|
#
|
57
57
|
if graph.node_by_name(get_pods_target_name(target))
|
58
|
-
pods_fixer.fix_embed_frameworks_script(target, graph
|
59
|
-
pods_fixer.fix_copy_resources_script(target, graph
|
58
|
+
pods_fixer.fix_embed_frameworks_script(target, graph)
|
59
|
+
pods_fixer.fix_copy_resources_script(target, graph)
|
60
60
|
else
|
61
61
|
framework_nodes = graph.nodes.select { |node| node.has_framework_product? }
|
62
62
|
framework_file_paths = framework_nodes.map { |node| File.join(storage.get_storage_path(node), node.product_file_name) }
|
@@ -4,36 +4,41 @@ module XcodeArchiveCache
|
|
4
4
|
|
5
5
|
include XcodeArchiveCache::Logs
|
6
6
|
|
7
|
-
|
7
|
+
# @param [XcodeArchiveCache::Injection::Storage] storage
|
8
|
+
#
|
9
|
+
def initialize(storage)
|
10
|
+
@storage = storage
|
8
11
|
@build_settings_interpolator = XcodeArchiveCache::BuildSettings::StringInterpolator.new
|
9
12
|
end
|
10
13
|
|
11
14
|
# @param [Xcodeproj::Project::Object::PBXNativeTarget] target
|
12
15
|
# @param [XcodeArchiveCache::BuildGraph::Graph] graph
|
13
|
-
# @param [String] products_dir
|
14
16
|
#
|
15
|
-
def fix_embed_frameworks_script(target, graph
|
17
|
+
def fix_embed_frameworks_script(target, graph)
|
16
18
|
build_settings = graph.dependent_build_settings
|
17
19
|
file_path = find_embed_frameworks_script(target, build_settings)
|
18
20
|
return unless file_path
|
19
21
|
|
20
|
-
fix_script(file_path, graph
|
22
|
+
fix_script(file_path, graph)
|
21
23
|
end
|
22
24
|
|
23
25
|
# @param [Xcodeproj::Project::Object::PBXNativeTarget] target
|
24
26
|
# @param [XcodeArchiveCache::BuildGraph::Graph] graph
|
25
|
-
# @param [String] products_dir
|
26
27
|
#
|
27
|
-
def fix_copy_resources_script(target, graph
|
28
|
+
def fix_copy_resources_script(target, graph)
|
28
29
|
build_settings = graph.dependent_build_settings
|
29
30
|
file_path = find_copy_resources_script(target, build_settings)
|
30
31
|
return unless file_path
|
31
32
|
|
32
|
-
fix_script(file_path, graph
|
33
|
+
fix_script(file_path, graph)
|
33
34
|
end
|
34
35
|
|
35
36
|
private
|
36
37
|
|
38
|
+
# @return [XcodeArchiveCache::Injection::Storage]
|
39
|
+
#
|
40
|
+
attr_reader :storage
|
41
|
+
|
37
42
|
# @return [XcodeArchiveCache::BuildSettings::StringInterpolator]
|
38
43
|
#
|
39
44
|
attr_reader :build_settings_interpolator
|
@@ -57,16 +62,14 @@ module XcodeArchiveCache
|
|
57
62
|
end
|
58
63
|
|
59
64
|
# @param [String] file_path
|
60
|
-
# @param [XcodeArchiveCache::BuildGraph::
|
61
|
-
# @param [String] products_dir
|
65
|
+
# @param [XcodeArchiveCache::BuildGraph::Graph] graph
|
62
66
|
#
|
63
|
-
def fix_script(file_path, graph
|
67
|
+
def fix_script(file_path, graph)
|
64
68
|
info("fixing #{file_path}")
|
65
69
|
script = File.read(file_path)
|
66
70
|
graph.nodes.each do |node|
|
67
|
-
|
68
|
-
|
69
|
-
script = script.gsub(Regexp.new("\"[^\"]+\/#{node.product_file_name}\""), "\"#{absolute_product_path}\"")
|
71
|
+
product_path = File.join(storage.get_storage_path(node), node.product_file_name)
|
72
|
+
script = script.gsub(Regexp.new("\"[^\"]+\/#{node.product_file_name}\""), "\"#{product_path}\"")
|
70
73
|
end
|
71
74
|
|
72
75
|
File.open(file_path, "w") {|file| file.puts(script)}
|
@@ -18,7 +18,7 @@ module XcodeArchiveCache
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# @param [Xcodeproj::Project::Object::PBXAbstractTarget] target
|
21
|
-
# @param [XcodeArchiveCache::BuildSettings::
|
21
|
+
# @param [XcodeArchiveCache::BuildSettings::Loader] build_settings_loader
|
22
22
|
#
|
23
23
|
def fix(target, build_settings_loader)
|
24
24
|
checked_targets.push(target.equatable_identifier)
|
data/lib/injection/storage.rb
CHANGED
@@ -77,7 +77,7 @@ module XcodeArchiveCache
|
|
77
77
|
def prepare_storage(node)
|
78
78
|
path = get_storage_path(node)
|
79
79
|
if File.exist?(path)
|
80
|
-
raise StandardError.new, "Injection storage path is already busy"
|
80
|
+
raise StandardError.new, "Injection storage path is already busy: #{path}"
|
81
81
|
end
|
82
82
|
|
83
83
|
FileUtils.mkdir_p(path)
|
@@ -89,7 +89,12 @@ module XcodeArchiveCache
|
|
89
89
|
# @return [String]
|
90
90
|
#
|
91
91
|
def get_storage_path(node)
|
92
|
-
File.join(container_dir_path, node.name)
|
92
|
+
path = File.join(container_dir_path, node.name)
|
93
|
+
if node.native_target
|
94
|
+
path += "-#{node.native_target.uuid}"
|
95
|
+
end
|
96
|
+
|
97
|
+
path
|
93
98
|
end
|
94
99
|
|
95
100
|
# @param [XcodeArchiveCache::BuildGraph::Node] node
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcode-archive-cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Dyakonov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
147
|
+
rubygems_version: 3.1.6
|
148
148
|
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Native targets cache for Xcode archive builds.
|