AOEpeople / gradle-jenkins-job-dsl-plugin

Plugin for easy management of Jenkins Job DSL scripts with Gradle
MIT License
25 stars 12 forks source link

Question: How to import additional files? #27

Open slempinen opened 2 years ago

slempinen commented 2 years ago

Hello!

I would like access classes I defined in groovy in my job dsl script files. I am unsure of how to do it and the repository does not have any examples.

My folder structure has src/jobs i.e the job dsl scripts and src/configs which contains Util.groovy. Inside Util.groovy I have decleared package configs and defined a class Util. In my build.gradle I decleared resourceDir 'src/configs' in the jobDsl block.

I then tried importing Util.groovy with import configs.Util and import Util. Both result in error.

script: 1: unable to resolve class configs.Util
 @ line 1, column 1.
   import configs.Util
script: 1: unable to resolve class Util
 @ line 1, column 1.
   import Util

What would be the correct way to import my Util class?