openrewrite / rewrite-gradle-plugin

OpenRewrite's Gradle plugin.
Apache License 2.0
60 stars 37 forks source link

Avoid duplicate sources, even if sourceSet directories overlap #182

Closed sambsnyd closed 11 months ago

sambsnyd commented 1 year ago

While not the default or a good idea, it is not impossible to have overlapping source directories. Example of such a configuration:

sourceSets {
  main {
    java.srcDirs = []
    groovy.srcDirs = ["src"]
    resources.srcDirs = ["src"]
  }
  ...
}

We should use our existing tracking of files which have already been parsed to exclude any duplicate source files from making their way into the final results.

timtebeek commented 11 months ago

Picked up in https://github.com/openrewrite/rewrite-gradle-plugin/commit/8c1986ca5420ad81a5eb7785240605db08d35cdc