Skip to content

Commit ec6b57c

Browse files
committed
script: include groupId in module overview
[skip ci]
1 parent d2ebfbe commit ec6b57c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

build-tools/generate-module-overview.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import xml.etree.ElementTree as ET
66

77
XPATH_ARTIFACT_ID = "./mvn:artifactId"
8+
XPATH_GROUP_ID = "./mvn:groupId"
9+
XPATH_PARENT_GROUP_ID = "./mvn:parent/mvn:groupId"
810
XPATH_DESCRIPTION = "./mvn:description"
911
XPATH_SUBMODULES = "./mvn:modules/mvn:module"
1012
MAVEN_NAMESPACE = {'mvn': 'http://maven.apache.org/POM/4.0.0'}
@@ -40,9 +42,14 @@ def generate_entry(indent, project_folder):
4042
padding = ('{:' + str(indent * 2) + '}').format(' ')
4143

4244
artifact = pom.find(XPATH_ARTIFACT_ID, namespaces=MAVEN_NAMESPACE)
45+
group = pom.find(XPATH_GROUP_ID, namespaces=MAVEN_NAMESPACE)
46+
parentGroup = pom.find(XPATH_PARENT_GROUP_ID, namespaces=MAVEN_NAMESPACE)
4347
description = pom.find(XPATH_DESCRIPTION, namespaces=MAVEN_NAMESPACE)
4448

45-
print('{}* **{}**: {}'.format(padding, artifact.text, description.text))
49+
if group is not None:
50+
print('{}* **{}**:**{}**: {}'.format(padding, group.text, artifact.text, description.text))
51+
else:
52+
print('{}* **{}**:**{}**: {}'.format(padding, parentGroup.text, artifact.text, description.text))
4653

4754
for module in pom.findall(XPATH_SUBMODULES, namespaces=MAVEN_NAMESPACE):
4855
generate_entry(indent + 1, os.path.join(project_folder, module.text))

0 commit comments

Comments
 (0)