Intellij Integration

279 views
Skip to first unread message

Laurent Pouget

unread,
Jul 29, 2016, 12:40:00 PM7/29/16
to job-dsl-plugin
Hi,

I try to use idea.gdsl on Intellij Ultimate 2016.2 to enable autocompletion but with :

// enable DSL support in IDEA, see https://confluence.jetbrains.com/display/GRVY/Scripting+IDE+for+DSL+awareness

def ctx = context(pathRegexp: /.*\/jobs\/.*groovy/)
contributor(ctx, {
delegatesTo(findClass('javaposse.jobdsl.dsl.DslFactory'))
})

I have autocompletion just on job level :

job("$basePath/grails-example-deploy") {
parameters {
stringParam 'host'
}
steps {
shell 'scp war file; restart...'
}
}

I need to add :

delegatesTo(findClass('javaposse.jobdsl.dsl.Job'))

to enable it but I don't have any "scope" aware autocompletion.

Am I missing something ? (I don't have a lot of knowledge on Groovy)
If not, does somebody have a fully functional idea.gdsl for recent intellij version ?

Best regards,

Laurent Pouget

Daniel Spilker

unread,
Aug 8, 2016, 6:34:33 PM8/8/16
to job-dsl...@googlegroups.com
It works for me as described in the wiki:
https://github.com/jenkinsci/job-dsl-plugin/wiki/IDE-Support

What do you mean by scope aware autocompletion?

Daniel

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/236580af-37f9-447f-b033-c227fc44323c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Daniel Spilker

unread,
Sep 11, 2016, 3:05:09 PM9/11/16
to job-dsl...@googlegroups.com
Ah, IDEA 2016.2 has better support for Gradle source sets and the Gradle build file needs some adjustment for that. See https://github.com/sheehan/job-dsl-gradle-example/pull/50

Regards,
Daniel

On Tue, Sep 6, 2016 at 10:58 PM, Rob Fagen <rob....@gmail.com> wrote:
I'm having a slightly different problem using the job-dsl-gradle-example where the file that enables the autocomplete config has this error:


I'm using the community edition 
(
IntelliJ IDEA 2016.2.3
Build #IC-162.1812.17, built on August 30, 2016
JRE: 1.8.0_112-release-b287 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
)

I'm not 100% sure of where to look to make sure that the right library is on the right place in the classpath. I did see that I do have some of the dependencies including the dsl jars, but not all the same ones in all the modules.

job-dsl-gradle-example_test has (job-dsl-core:1.50, job-dsl:hpi:1.50 and job-dsl:1.50) as well as depending on job-dsl-gradle-example_main
job-dsl-gradle-example_main only has (job-dsl-core:1.50)
job-dsl-gradle-example_jobs only depends on job-dsl-example_main


I was also having a problem where the debugXML would run fine  from the gradlew command line but not in intelliJ. Then I figured out to add the  

"-Dpattern=jobs/**/*Jobs.groovy" to the "Gradle VM options" under the Preferences|Gradle prefs.

Thanks,

Rob
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.

Rob Fagen

unread,
Sep 16, 2016, 5:20:01 PM9/16/16
to job-dsl-plugin
I'm still seeing the same issue, but haven't had a chance to dig into what details would be important to gather. I wanted to first acknowledge and thank you for the quick response and also doublecheck my installation work.

Rob
Reply all
Reply to author
Forward
0 new messages