From bd2e9cfc396d0e84e9b0b520aee5247ba95df916 Mon Sep 17 00:00:00 2001 From: steven-terrana Date: Wed, 11 May 2022 10:32:38 -0400 Subject: [PATCH] Update JTEPipelineSpecification.groovy --- .../test/JTEPipelineSpecification.groovy | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/resources/test/JTEPipelineSpecification.groovy b/resources/test/JTEPipelineSpecification.groovy index 4cbce049..86318fdd 100644 --- a/resources/test/JTEPipelineSpecification.groovy +++ b/resources/test/JTEPipelineSpecification.groovy @@ -13,17 +13,17 @@ public class JTEPipelineSpecification extends JenkinsPipelineSpecification { @Override Script loadPipelineScriptForTest(String _path) { - String[] path_parts = _path.split( "/" ) - - String filename = path_parts[path_parts.length-1] - - String resource_path = "/" - if( path_parts.length >= 2 ) { - resource_path = String.join( "/", path_parts[0..path_parts.length-2] ) - resource_path = "/${resource_path}/" - } + String[] path_parts = _path.split( "/" ) - GroovyScriptEngine script_engine = new GroovyScriptEngine(generateScriptClasspath(resource_path)) + String filename = path_parts[path_parts.length-1] + + String resource_path = "/" + if( path_parts.length >= 2 ) { + resource_path = String.join( "/", path_parts[0..path_parts.length-2] ) + resource_path = "/${resource_path}/" + } + + GroovyScriptEngine script_engine = new GroovyScriptEngine(generateScriptClasspath(resource_path)) CompilerConfiguration cc = script_engine.getConfig() // define auto importing of JTE hook annotations ImportCustomizer ic = new ImportCustomizer() @@ -33,19 +33,13 @@ public class JTEPipelineSpecification extends JenkinsPipelineSpecification { script_engine.setConfig(cc) Class