diff --git a/buildSrc/src/main/groovy/com/widen/plugins/buildkite/BuildkitePlugin.groovy b/buildSrc/src/main/groovy/com/widen/plugins/buildkite/BuildkitePlugin.groovy index 2cb3e85..276a587 100644 --- a/buildSrc/src/main/groovy/com/widen/plugins/buildkite/BuildkitePlugin.groovy +++ b/buildSrc/src/main/groovy/com/widen/plugins/buildkite/BuildkitePlugin.groovy @@ -50,9 +50,11 @@ class BuildkitePlugin implements Plugin { )) files.each { file -> - extension.pipeline(pipelineNameFromFile(file)) { BuildkitePipeline pipeline -> + def pipelineName = pipelineNameFromFile(file) + + extension.pipeline(pipelineName) { BuildkitePipeline pipeline -> // Avoid loading the file until the pipeline spec is actually requested. - def script = (PipelineScript) shell.parse(file) + def script = (PipelineScript) shell.parse(new GroovyCodeSource(file.text, file.path, file.path)) script.setProject(project) script.setBuildkite(extension) script.setPipeline(pipeline)