Questions tagged [groovydsl]

GroovyDSL is an IntelliJ framework to define the behaviour of end-user DSLs as script files which are executed by the IDE.

GroovyDSL is a framework with a domain-specific language designed to define the behaviour of end-user DSLs as script files which are executed by the IDE on the fly, bringing new reference resolution and code completion logic into the scope of a project. GroovyDSL relies on the Program Structure Interface (PSI), a set of internal classes and interfaces of IntelliJ IDEA, which allow all programming languages to be described in a uniform way.

Taken from the project page.

28 questions
0
votes
0 answers

Build with parameter option is keep getting unchecked when replay or abort the job - ( build job is created through job dsl groovy script)

I have created the a pipeline job with the help of groovy job dsl template, Its a parameterized pipeline job. whenever this pipeline job is replayed or aborted, build with parameter option is getting unchecked and parameter section is removed. this…
0
votes
0 answers

Jenkins Add permissions to folder using groovy

I need to add some permissions (Read, Build, View, cancel etc) to multiple users at the same time. def users = [user1, user2] for(user in users){ String userID = user; jobDsl scriptText: """ folder('example') { …
Parkjin
  • 11
  • 4
0
votes
1 answer

Modify GroovyDSL classpath to include 3rd party libraries

I'm trying to create a GroovyDSL script which references some external libraries. Here's my script: import com.github.javaparser.ast.Node import org.reflections.Reflections def ctx = context( ctype: 'groovy.util.ObjectGraphBuilder', …
crizzis
  • 9,978
  • 2
  • 28
  • 47
0
votes
1 answer

Groovy DSL convention object "Could not get unknown property"

I have the following code in my build.gradle: class GreetingPlugin implements Plugin { def void apply(Project project) { project.convention.plugins.greeting = new GreetingPluginConvention() project.task('hello') { …
mzakrze
  • 53
  • 3
0
votes
0 answers

Is there a way to modify the entire content of the file while assembling the Jar using Gradle.?

There's an usecase in my project that, I have to modify the class file content while preparing the jar & use the custom classloader for loading that class. To achieve the above scenario, I have used the following snippet of CopySpec in my…
0
votes
1 answer

Jenkinsfile with string variable issue

I have a Jenkinsfile and parsing list of ports from input file, pipeline { parameters { string(defaultValue: '4000', name: 'Port', trim: true) } stage('Test') { steps { script { echo 'Testing..' script { …
Krishna
  • 501
  • 1
  • 8
  • 17
0
votes
1 answer

Groovy DSL Spring cloud contract throwing java.lang.IllegalStateException for query parameter having Unicode Characters

I created a groovy DSL contract like below import org.springframework.cloud.contract.spec.Contract Contract.make { final def NAME_REGEX = '[A-Za-z0-9\\u00C0-\\u00FF\'\\- ]{1,70}' request { method 'GET' …
Bagesh Sharma
  • 783
  • 2
  • 9
  • 23
0
votes
2 answers

How to create a DSL Groovy config file using an arbitrary Map (dynamic object)

How do I convert an arbitrary Groovy map / list to the config style DSL syntax that Groovy provides? Example: def config = [ 'test': 'lalala', 'nestedObject': [ foo1: 'foo1 val', foo2: 'foo2 val', nested2: [ …
Vahid Pazirandeh
  • 1,552
  • 3
  • 13
  • 29
0
votes
2 answers

how to pass parameters to the closure if use @DelegatesTo annotation?

if i change the code in Groovy DSL Doc here. add some string 'hello world' to email, like this email('hello world') { // change here from 'dsl-guru@mycompany.com' to 'john.doe@waitaminute.com' subject 'The pope has resigned!' body { …
beneo
  • 113
  • 2
  • 11
0
votes
1 answer

Add methods to an assigned closure with GroovyDSL

Geb uses a static field called content to define the contents of a page or module. The value of the content field is a closure. class GebishOrgHomePage extends Page { static content = { manualsMenu { module MenuModule,…
Leonard Brünings
  • 12,408
  • 1
  • 46
  • 66
0
votes
0 answers

Get rid of import in Groovy Unit Test in IntelliJ

Is it possible to get rid of from import statements in JUnit tests written in Groovy? I know you could do it in groovy scripts in GroovyShell by changing compiler configuration or import customizer. I like to do same thing but: IntelliJ should…
Deniz
  • 1,575
  • 1
  • 16
  • 27
0
votes
1 answer

How to define a method in Groovy-Eclipse DSL

I'm developing a language by taking advantages of groovy-eclipse plugin. I can define a property successfully. However, I can not do same even for a simple method. Probably I'm missing some very simple thing at the center of all... Can't I define…
Erdem Eser
  • 61
  • 4
0
votes
1 answer

IntelliJ GroovyDSL for static method

I'm using GroovyDSL for IntelliJ, and I'd like to describe a static method, that returns instance of same class. It's a method like: MyEntity x = MyEntity.get(1) As I understand, I should use context with ctype for java.lang.Class. But I don't know…
Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113
1
2