3.6.1 introduced a bug that same compile source are added multiple times.
It seems that since 3.6.1, this method is invoked multiple times, thus adding project root directory absolute path and "." in this method twice. Unfortunately, new File(basedir, ".").getAbsolutePath() doesn't equal basedir.getAbsolutePath() – the same source roots are added multiple times to compileSourceRoots.
Step to reproduce:
- git clone email@example.com:gradle/gradle.git
- cd gradle/.teamcity
- (With maven 3.6.0) mvn compile - success
- (WIth maven 3.6.1) mvn compile - failure
Kotlin compiler complains a lot "Redeclaration: XXXXX".