I'm building a library for Jenkins Global Pipeline Libraries (https://github.com/jenkinsci/workflow-cps-global-lib-plugin) for consumers of Jenkins Pipelines.
The way that users in our organization generally consume Jenkins Pipelines is:
- Each repository has a file in the root named Jenkinsfile - this is a Groovy file with a special DSL that is used by Jenkins
- They import each repository as a module or as a project into IntelliJ, where they may or may not use the module per source set functionality because most of them use Gradle
- Very few people are using Gradle's Groovy plugin
- IntelliJ gives them no auto-complete or validation when they consume our library
From my standpoint, there are a few things to consider:
- I don't want all of our users to have to install another plugin (like https://github.com/oliverlockwood/jenkinsfile-idea-plugin)
- If I can setup something easy for the classpath or autocompletion using their existing Gradle tooling (like another sourceSet or something just for that Jenkinsfile) that would be most ideal
Jenkins Pipelines consumes Groovy source code, not compiled artifacts
I'm wondering what my best options is for getting my users at least auto-completion of our library using the tools we already use?
I found GDSL (like https://confluence.jetbrains.com/display/GRVY/Scripting+IDE+for+DSL+awareness), but the IntelliJ tooling seems to be failing to provide the documentation for the methods and other pieces (see below image). GDSL doesn't seem like the easiest option for consumers, so I'm interested in hearing what other options I have or the best path.
Consumers will have a Groovy `Jenkinsfile` in the root of their repository, and I would like to give them something to give them IDE assistance when they consume our library without having to have them install a plugin (like this one https://github.com/oliverlockwood/jenkinsfile-idea-plugin). Most of our users use IntelliJ and Gradle, so I was trying to figure out some of solution around that.
What I thought I could do, (stemming from my question above) was to write what I believe are called GDSL scripts (looking at https://confluence.jetbrains.com/display/GRVY/Scripting+IDE+for+DSL+awareness) for consumers of my library, but im definitely open to other suggestions.