Groovy slash operator (Jenkins job-dsl)

We would like to understand a couple of obsolete job-dsl scripts, but don’t know what the “slash operator” means in this context (since it cannot be a division):

def command = (shells.first() / command)

We tried to find it in several Groovy books, but found only a trivial solution that means "division."

+4
source share
1 answer

This is an XML Node operation to return an XML node under a node or create one if it does not exist. Probably commandnode under the first of your nodes shells.

Groovy , "", . ( ) , , DSL.

( ) JobDSL, , , NodeEnhancement, JavaDoc:

/**
Add div and leftShift operators to Node.
div - Will return the first child that matches name, and if it doesn't exists, it creates
...
**/
+5

All Articles