We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6f4a7a commit 5663c02Copy full SHA for 5663c02
java/maven-indexer/pick-best-jars.py
@@ -23,14 +23,18 @@ def read_bytes(fname):
23
with open(fname, "rb") as f:
24
return f.read()
25
26
+META_INF_VERSIONS = re.compile("META-INF/versions/[0-9]+/")
27
def _read_jar_index(jarname):
28
bypackage = dict()
29
cd_file = jarname[:-6] + ".cd"
30
zip_suffix = read_bytes(jarname) + read_bytes(cd_file)
31
for l in listzip.listzip(zip_suffix):
32
if l.endswith(".class") and not utils.is_private(l):
33
lpackage = os.path.dirname(l)
34
+ lpackage = META_INF_VERSIONS.sub("", lpackage)
35
cname = os.path.basename(l)
36
+ if cname == "module-info.class":
37
+ continue
38
if lpackage not in bypackage:
39
bypackage[lpackage] = set()
40
bypackage[lpackage].add(cname)
0 commit comments