File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
plugins/ide-plugin/src/main/kotlin/com/github/vlsi/gradle/ide Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import org.gradle.kotlin.dsl.apply
2828import org.gradle.kotlin.dsl.configure
2929import org.gradle.plugins.ide.eclipse.model.EclipseModel
3030import org.gradle.plugins.ide.idea.model.IdeaModel
31+ import org.gradle.plugins.ide.idea.model.IdeaModule
3132import org.gradle.util.GradleVersion
3233import org.jetbrains.gradle.ext.ProjectSettings
3334import java.io.File
@@ -111,8 +112,11 @@ open class IdeExtension(private val project: Project) {
111112 if (GradleVersion .current() >= GradleVersion .version(" 7.4" )) {
112113 module.testSources.from(generationOutput)
113114 } else {
114- @Suppress(" DEPRECATION" )
115- module.testSourceDirs.add(generationOutput)
115+ val getTestSourceDirs =
116+ IdeaModule ::class .java.getDeclaredMethod(" getTestSourceDirs" )
117+ @Suppress(" UNCHECKED_CAST" )
118+ val testSourceDirs = getTestSourceDirs.invoke(module) as MutableSet <File >
119+ testSourceDirs.add(generationOutput)
116120 }
117121 }
118122 }
You can’t perform that action at this time.
0 commit comments