CompareGradleBuilds should implement GradleBuildInvocationSpec

CompareGradleBuilds should implement GradleBuildInvocationSpec to be able to define settings common to both builds. So the two child GradleBuildInvocationSpecs should be initialized with the implicit GradleBuildInvocationSpec on CompareGradleBuilds and if stuff gets set for the child specs, it should be possible to override the common settings, but also to add to them. e. g. if you want to give the same gradle parameters to both via -P switches and add several for the individual child specs

I’m not sure this is worth the complexity. It might be good enough to just use the standard configure() pattern…

compareGradleBuilds {
  configure([sourceBuild, targetBuild]) {
    // common config
  }
}

Ah, ok, I think I was not aware of this possibility or forgot about it. I just suggested it the way I did because I think this would be consistent with other places in Gradle where it is solved this way. But don’t ask me now at what I had a look, maybe CopySpec / AbstractCopyTask or something similar.