jenkins-pipeline-shared-libraries-gradle-plugin
jenkins-pipeline-shared-libraries-gradle-plugin copied to clipboard
Add source set for GDSL
need to also make an issue to add a demo/documentation for how to use it
FWIW, one can be added from one's $JENKINS_URL/pipeline-syntax/gdsl
I did not figure out why there are two different copies of the file in the example project in jenkinsResources/
and in resources/
which IDEA recognizes as a "resources root" and probably that is the one helping code-completion etc.
I managed to get as far as IDEA recognising the file, but all the declared classes for all properties seem to be off by one.
e.g. in the gdsl served by Jenkins, it says that currentBuild
is a RunWrapperBinder
. IDEA then shows currentBuild.rawBuild
as an unknown property. The actual type should be RunWrapper
, which does have the rawBuild
property. It seems you can call getValue
on the binder object to get the actual object, but IDEA doesn’t do this. I have no idea whether IDEA is handling the file incorrectly or whether Jenkins is serving the file with the wrong types.
Well, IDEA's integration with Groovy generally is helpful, but with Jenkins effective dialects it struggles :)
I had posted a loosely related issue which so far got little traction: https://youtrack.jetbrains.com/issue/IDEA-320924/IDEA-does-not-handle-Groovy-call-class-methods-call-operator-for-context-help-and-auto-completion and one replier pointed to https://github.com/lppedd/idea-jenkins-pipeline - which might be a useful point to collaborate with regarding IDE support.