Skip to content

Conversation

@markslater
Copy link
Contributor

The README section for Fall-back to classpath mode states that using the Kotlin DSL, you can enable classpath mode while running tests with:

tasks {
  compileTestJava {
        extensions.configure(CompileTestModuleOptions::class) {
            compileOnClasspath = true
        }
    }
}

In fact, in version 1.8.15 of the plugin, you have to write isCompileOnClasspath = true. The reason for this is that the accessor needs to be called getCompileOnClasspath() for it to be treated as a property in Kotlin.

Note that this doesn't affect the Groovy DSL, and that TestModuleOptions works as documented for both Kotlin and Groovy.

I've adjusted the tests to demonstrate the problem, implemented a fix, and deprecated the old method.

Let me know if you want to take a different approach, or you'd like anything adjusting.

…and documentation when using Kotlin Script build.
@big-andy-coates
Copy link
Collaborator

Thanks for the fix @markslater - sorry its taken so long to accept it!

@big-andy-coates big-andy-coates merged commit 68d6701 into java9-modularity:master Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants