jenkins-pipeline-shared-libraries-gradle-plugin icon indicating copy to clipboard operation
jenkins-pipeline-shared-libraries-gradle-plugin copied to clipboard

Add source set for GDSL

Open mkobit opened this issue 7 years ago • 4 comments

mkobit avatar Jan 22 '18 15:01 mkobit

need to also make an issue to add a demo/documentation for how to use it

mkobit avatar Mar 02 '18 21:03 mkobit

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.

jimklimov avatar Apr 07 '22 13:04 jimklimov

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.

hakanai avatar Jun 14 '23 03:06 hakanai

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.

jimklimov avatar Jun 14 '23 08:06 jimklimov