File tree 2 files changed +6
-4
lines changed
src/main/kotlin/platform/mcp/gradle
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class McpProjectResolverExtension : AbstractProjectResolverExtension() {
59
59
60
60
val projectDirPath = Paths .get(projectDataNode.data.linkedExternalProjectPath)
61
61
runGradleTask(project, projectDirPath) { settings ->
62
- settings.taskNames = allTaskNames
62
+ settings.taskNames = allTaskNames.distinct()
63
63
}
64
64
65
65
super .resolveFinished(projectDataNode)
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
34
34
import org.gradle.tooling.model.idea.IdeaModule
35
35
import org.jetbrains.plugins.gradle.model.data.GradleSourceSetData
36
36
import org.jetbrains.plugins.gradle.service.project.ProjectResolverContext
37
+ import org.jetbrains.plugins.gradle.util.gradleIdentityPath
37
38
38
39
object McpModelFG3Handler : McpModelDataHandler {
39
40
@@ -68,9 +69,10 @@ object McpModelFG3Handler : McpModelDataHandler {
68
69
forgeVersion,
69
70
)
70
71
71
- val gradleProjectPath = gradleModule.gradleProject.projectIdentifier.projectPath
72
- val suffix = if (gradleProjectPath.endsWith(' :' )) " " else " :"
73
- val taskName = gradleProjectPath + suffix + data.taskName
72
+ // gradleIdentityPath makes it work with composite builds
73
+ val identityPath = node.data.gradleIdentityPath
74
+ // But ignore it if it is the root project, as taskName already starts with a colon
75
+ val taskName = if (identityPath == " :" ) data.taskName else identityPath + ' :' + data.taskName
74
76
75
77
val ats = data.accessTransformers
76
78
if (ats != null && ats.isNotEmpty()) {
You can’t perform that action at this time.
0 commit comments