The current instance of gradle that is running, by the time it gets to running the unit tests has already built its classpath correct? At test time I would need to take the plugin/task classes that were built in the compileJava task and then add those classes to the currently-executing gradle’s testRuntime classpath correct? I thought that modifying classpaths was a configuration-time thing and couldn’t be manipulated at execution time. Maybe I just don’t know/understand how to do it.
The basic flow would be this: 1) Fire up gradle to build the project (running gradle/gradlew build). At the end of the compile/assemble task there would be class files/jar file. 2) Get these newly-compiled classes/jar file onto the testRuntime classpath so that when the test task starts executing the classes that were previously compiled-built are now available on the classpath. 3) In the test cases, use the classes to run a build. For this I have a bunch of different build.gradle scripts which I want to point to to execute - each one with a different configuration/execution scenario based on different tests I’m trying to execute. I want my tests to actually run through a build execution - just testing out configuration parameters doesn’t cut it in my opinion. I want to execute a build and then inspect the results.