(pom_path)
| 155 | |
| 156 | |
| 157 | def _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 | |
| 182 | def _copy_pom_with_annotation_processor(pom_path): |
no test coverage detected