From 10e9f082bd22a948fb4d56f184de7ca3f1fc42e5 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Tue, 20 Aug 2024 12:30:22 +0100 Subject: [PATCH] Use Gradle project path for unique dependencies.txt path (#741) --- .../src/main/scala/SemanticdbGradlePlugin.scala | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/semanticdb-gradle-plugin/src/main/scala/SemanticdbGradlePlugin.scala b/semanticdb-gradle-plugin/src/main/scala/SemanticdbGradlePlugin.scala index 5bbf53c8..69ae1787 100644 --- a/semanticdb-gradle-plugin/src/main/scala/SemanticdbGradlePlugin.scala +++ b/semanticdb-gradle-plugin/src/main/scala/SemanticdbGradlePlugin.scala @@ -430,6 +430,15 @@ class WriteDependencies extends DefaultTask { val deps = List.newBuilder[String] val project = getProject() val projectName = project.getName() + val projectPath = project.getPath().replaceAll("[^a-z0-9A-Z_-]", "_") + val dependenciesPath = depsOut.map { path => + val filename = path.getFileName() + if (filename.endsWith("dependencies.txt")) { + val last = projectPath + "." + path.getFileName().toString() + path.getParent().resolve(last) + } else + path + } val gradle = new GradleVersion(project.getGradle().getGradleVersion()) @@ -546,7 +555,7 @@ class WriteDependencies extends DefaultTask { val dependencies = deps.result().distinct - depsOut match { + dependenciesPath match { case None => dependencies.foreach(println) case Some(path) =>