https://kotlinlang.org logo
Title
x

xenoterracide

05/06/2018, 6:23 PM
@fitzoh I sorta get it, but... the extension is like the plugin configuration right? trying to figure out how I'm supposed to create that, with a Collection<SourceSet> when the configuration hasn't been made yet, how do I get at those parameters? or maybe something in my design is flawed, and I need to redesign a little, but I'm not sure how
f

fitzoh

05/06/2018, 6:36 PM
So is the plan to discover all the sourcesSets in the project and add a checkstyle configuration for them, etc?
or do you want to configure a default group of sourcesets that your plugin works on?
x

xenoterracide

05/06/2018, 7:08 PM
I want to configure a group of sourcesets my plugin works on
really I'm just passing the configuration to the other plugins I'm configuring
checkstyle {
    toolVersion = "8.4"
    sourceSets = listOf(java.sourceSets["main"])
}

spotbugs {
    toolVersion = "3.1.0"
    effort = "max"
    reportLevel = "low"
    sourceSets = listOf(java.sourceSets["main"])
}
basically I'm trying to dedupliate this
f

fitzoh

05/06/2018, 7:15 PM
gotcha
so the first thing that I’m seeing is that the extension constructor takes a collection of extensions
but gradle doesn’t know how to provide that set of sourcesets, so it blows up
x

xenoterracide

05/06/2018, 7:18 PM
basically and I get why it would, I'm just not sure what gradle is expexcting for me to make something like,
plugins { mine }  xeno {     sourceSets = listOf(java.sourceSets["main"]) }