MCPcopy Create free account
hub / github.com/nodejs/node / write_podspec_rule

Function write_podspec_rule

deps/v8/third_party/abseil-cpp/absl/abseil.podspec.gen.py:184–206  ·  view source on GitHub ↗

Writes podspec from given rule.

(f, rule, depth)

Source from the content-addressed store, hash-verified

182
183
184def write_podspec_rule(f, rule, depth):
185 """Writes podspec from given rule."""
186 indent = " " * (depth + 1)
187 spec_var = get_spec_var(depth)
188 # Puts all files in hdrs, textual_hdrs, and srcs into source_files.
189 # Since CocoaPods treats header_files a bit differently from bazel,
190 # this won't generate a header_files field so that all source_files
191 # are considered as header files.
192 srcs = sorted(set(rule.hdrs + rule.textual_hdrs + rule.srcs))
193 write_indented_list(
194 f, "{indent}{var}.source_files = ".format(indent=indent, var=spec_var),
195 srcs)
196 # Writes dependencies of this rule.
197 for dep in sorted(rule.deps):
198 name = get_spec_name(dep.replace(":", "/"))
199 f.write("{indent}{var}.dependency '{dep}'\n".format(
200 indent=indent, var=spec_var, dep=name))
201 # Writes dependency to xcprivacy
202 f.write(
203 "{indent}{var}.dependency '{dep}'\n".format(
204 indent=indent, var=spec_var, dep="abseil/xcprivacy"
205 )
206 )
207
208
209def write_indented_list(f, leading, values):

Callers 1

write_podspec_mapFunction · 0.85

Calls 7

get_spec_varFunction · 0.85
sortedFunction · 0.85
write_indented_listFunction · 0.85
get_spec_nameFunction · 0.85
formatMethod · 0.65
setFunction · 0.50
writeMethod · 0.45

Tested by

no test coverage detected