Agree about the tasks.sonarRunner {} approach not looking so great. One option could be to subclass SonarRunnerExtension with a SonarRunnerRootExtension that has the new properties. The root extension would only be used on the project the plugin is applied to. The other projects would use the old extension. However, I'm not sure if there are any other cases where the same extension name maps to a different class depending on the project.
Otherwise, this is still an incubating plugin, so maybe the devs would be alright with breaking some compatibility? Andy On Tue, Jul 1, 2014 at 3:03 PM, zeeke <panattoni.and...@gmail.com> wrote: > As suggested by Luke Daley, I move the discussion here from github > <https://github.com/gradle/gradle/pull/257> . > > I'm going to implement the "fork mode" for SonarQube analysis with the > following specification: > > - Remove non forking mode entirely > - Allow choice of Sonar runner version > - Change default version to 2.3 > > Currently, the SonarRunner plugin creates a SonarRunnerExtension for each > Java project in the current build config. It allows to configure sonar > runner properties for each project. > > Now we have a bit more configuration to offer to users, including: > - The sonar-runner version > - The java options to use when forking the new process > > I can't put this info in the same extension because it will be applied to > subprojects too and it would be meaningless. > > The only way I see is to put some filed in the task and to allow users to > configure it as following: > > sonarRunner { > // This is the already in place SonarRunnerExtension > // Each project can have one > sonarProperties { > // ... > } > } > > tasks.sonarRunner { // There is an alias with the extension. The plugin > creates only one task. > > toolVersion = '2.3' > forkOptions { > // ... > maxHeapSize = '1024m' > } > } > > I think this is not a very nice solution but it is the best we can do if we > don't want to break too much backward compatibility. > > Any suggestion? > > > > > > -- > View this message in context: > http://gradle.1045684.n5.nabble.com/GRADLE-2587-Provide-option-to-fork-Sonar-analysis-tp5712779.html > Sent from the gradle-dev mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > >