You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment creating a source set for a custom plugin is such a nightmare that you always go for an other container, usually called sourceSets as well, inside your extension an you totally ignore the default one (if is there at all since it need to be initialized by the Java base plugin).
I would recommend to make all The sourceSet interface the most JVM agnostic as possible, always register the source sets in the project or create a base plugin that does so and make a JVM plugin that adds all those extensions.
The text was updated successfully, but these errors were encountered:
Can you be more specific about what the problems are?
Pointers to attempts and what was problematic would help. Then a description of use case(s) for where you would use a JVM agnostic SourceSet
I am building a plugin to streamline Terraform projects from Gradle and I need the concept of a source set, of course. I a first attempt I wanted to add a terraform extension to every SourceSet created, but I quickly realized that there was no easy way to create the source set container without applying the Java plugin.
Furthermore, each source set has hardcoded properties and functions tied to the JVM environment, implying that the sources you are going to add to your project are somewhat going to be compiled for the JVM.
I was able to track down which plugin and where the source set container was created, but I decided it was not worth the effort and created a custom container with a custom class called TerraformSourceSet and mirrored some functions names and properties such as dependsOn() or srcDir().
If you allow to register the SourceSets container in a simple plugin, while having the SourceSet interface stripped away of the JVM stuff, it would be possible have a unified sourceSet api that I believe is much less chaotic compared to each plugin having the source sets in their own extensions.
Myself included was very confused at the begging by the Kotlin plugin having their kotlin.sourceSets accessors separated from the root sourceSets where you had to do something like kotlin.sourceSets.main.kotlin.
lamba92
changed the title
Make source set JVM specific elements an extension of the java plugin instead of hard coded and also easier to create.
Make source set JVM specific elements an extension of the java plugin instead of hard coded and the container easier to create
Nov 1, 2021
At the moment creating a source set for a custom plugin is such a nightmare that you always go for an other container, usually called
sourceSets
as well, inside your extension an you totally ignore the default one (if is there at all since it need to be initialized by the Java base plugin).I would recommend to make all The
sourceSet
interface the most JVM agnostic as possible, always register the source sets in the project or create a base plugin that does so and make a JVM plugin that adds all those extensions.The text was updated successfully, but these errors were encountered: