getgauge/gauge-gradle-plugin

Gauge Gradle Plugin doesn't interoperate nicely with IntelliJ IDEA

chadlwilson opened this issue · 1 comments

By default Gauge will try and detect build paths from Eclipse and IntelliJ IDEA which it finds in the out/ folder relative to your project root.

This causes issues if you use Gauge Gradle Plugin alongside IntelliJ IDEA because the plugin adds the Gradle classes dir (usually build/classes/java/test) to the classpath, while Gauge itself also adds the out/ folder.

This leads to confusing classpath clashes when running Gauge via gradle with ./gradlew clean gauge because if you rename a class/method inside a spec in your source code the out/ folder may have a stale version of the compiled class from IntelliJ IDEA depending on when you last rebuilt.

Workaround
Add to build.gradle

clean.doFirst {
    delete "${project.rootDir}/out"
}

Possible solution
When building the process environment in the plugin, instead of including the built classes in gauge_custom_classpath environment; set the gauge_custom_build_path to be the Gradle build test classes dir.

I'm not sure if this is still true, as it's a long time since I used Gauge via Gradle plugin with IDEA so will close this now. Let me know if it's still an issue and I'll re-open.