MCPcopy Create free account
hub / github.com/apache/fory / _add_annotation_processor_path

Function _add_annotation_processor_path

ci/run_ci.py:157–179  ·  view source on GitHub ↗
(pom_path)

Source from the content-addressed store, hash-verified

155
156
157def _add_annotation_processor_path(pom_path):
158 ET.register_namespace("", "http://maven.apache.org/POM/4.0.0")
159 ET.register_namespace("xsi", "http://www.w3.org/2001/XMLSchema-instance")
160 tree = ET.parse(pom_path)
161 root = tree.getroot()
162 namespace = _pom_namespace(root)
163 compiler_plugin = _find_or_add_compiler_plugin(root, namespace)
164 configuration = _find_or_add_child(compiler_plugin, namespace, "configuration")
165 annotation_processor_paths = _find_or_add_child(
166 configuration, namespace, "annotationProcessorPaths"
167 )
168 annotation_processor_paths.set("combine.children", "append")
169 if not _has_processor_path(
170 annotation_processor_paths, namespace, "fory-annotation-processor"
171 ):
172 path = ET.SubElement(annotation_processor_paths, _pom_tag(namespace, "path"))
173 group_id = ET.SubElement(path, _pom_tag(namespace, "groupId"))
174 group_id.text = "org.apache.fory"
175 artifact_id = ET.SubElement(path, _pom_tag(namespace, "artifactId"))
176 artifact_id.text = "fory-annotation-processor"
177 version = ET.SubElement(path, _pom_tag(namespace, "version"))
178 version.text = "${project.version}"
179 tree.write(pom_path, encoding="UTF-8", xml_declaration=True)
180
181
182def _copy_pom_with_annotation_processor(pom_path):

Callers 1

Calls 8

_pom_namespaceFunction · 0.85
_find_or_add_childFunction · 0.85
_has_processor_pathFunction · 0.85
_pom_tagFunction · 0.85
writeMethod · 0.65
parseMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected