Fix checkDependencies.py, looks like gradle 9.6.1 surrounds the dependencies with '

This commit is contained in:
Benoit Marty
2026-07-17 16:38:41 +02:00
parent 7f27f4d697
commit 968d271f2c
+3 -3
View File
@@ -35,7 +35,7 @@ def checkThatModulesExist(dependencies):
line = line.split(" ") line = line.split(" ")
for elem in line: for elem in line:
if ":" in elem: if ":" in elem:
modules.add(elem) modules.add(elem.replace("'", ""))
for module in modules: for module in modules:
path = "." + module.replace(":", "/") + "/build.gradle.kts" path = "." + module.replace(":", "/") + "/build.gradle.kts"
if not os.path.exists(path): if not os.path.exists(path):
@@ -51,12 +51,12 @@ def checkThatThereIsNoTestDependency(dependencies):
currentProject = "" currentProject = ""
for line in dependencies: for line in dependencies:
if line.startswith("+--- project "): if line.startswith("+--- project "):
currentProject = line.split(" ")[2] currentProject = line.split(" ")[2].replace("'", "")
else: else:
if ":test" in currentProject: if ":test" in currentProject:
continue continue
else: else:
subProject = line.split(" ")[-1] subProject = line.split(" ")[-1].replace("'", "")
if subProject.endswith(":test") or ":tests:" in subProject and "detekt-rules" not in subProject: if subProject.endswith(":test") or ":tests:" in subProject and "detekt-rules" not in subProject:
error = "Error: '" + currentProject + "' depends on the test project '" + subProject + "'\n" error = "Error: '" + currentProject + "' depends on the test project '" + subProject + "'\n"
error += " Please replace occurrence(s) of 'implementation(projects" + subProject.replace(":", ".") + ")'" error += " Please replace occurrence(s) of 'implementation(projects" + subProject.replace(":", ".") + ")'"