Groovy Libraries allow custom Groovy functions and helpers to be shared and reused across all Groovy scripts in FlexDeploy
Table of Contents | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
LIB_LOGGER
Code Block | ||
---|---|---|
| ||
// this WOULD work in the way LIB_PIPELINE_UTILS is using it static void logMessage(String message) { // log } // this would NOT work in the way LIB_PIPELINE_UTILS is using it void logMessagelogMessage2(String message) { // log } |
...
Code Block | ||
---|---|---|
| ||
import com.flexagon.groovy.custom.LIB_LOGGER; def loggerInstance = new LIB_LOGGER(LOG); void myPipelineFunction() { // This WILL work LIB_LOGGER.logMessage("Logger library static method") // This will NOT work LIB_LOGGER.logMessage2("Logger library instance method") // code omitted for brevityBOTH of these will work loggerInstance .logMessage("Logger library static method") loggerInstance .logMessage2("Logger library instance method") } |
Circular Imports
Warning |
---|
Circular imports of custom libraries are not allowed and if found an error will be thrown |
...