From dd5f568f4474ebde048a756e8988d6b7710a45cd Mon Sep 17 00:00:00 2001 From: Dima Date: Sun, 28 Jul 2024 11:28:05 +0300 Subject: [PATCH] fix paths --- .../library/steps/DesignerToEdtFormatTransformation.groovy | 2 +- src/ru/pulsar/jenkins/library/steps/EdtValidate.groovy | 5 ++++- .../pulsar/jenkins/library/steps/ResultsTransformer.groovy | 7 ++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ru/pulsar/jenkins/library/steps/DesignerToEdtFormatTransformation.groovy b/src/ru/pulsar/jenkins/library/steps/DesignerToEdtFormatTransformation.groovy index 29c586e4..320fb609 100644 --- a/src/ru/pulsar/jenkins/library/steps/DesignerToEdtFormatTransformation.groovy +++ b/src/ru/pulsar/jenkins/library/steps/DesignerToEdtFormatTransformation.groovy @@ -35,7 +35,7 @@ class DesignerToEdtFormatTransformation implements Serializable { def workspaceDir = FileUtils.getFilePath("$env.WORKSPACE/$WORKSPACE") def srcDir = config.srcDir def configurationRoot = FileUtils.getFilePath("$env.WORKSPACE/$srcDir") - def projectName = config.srcDir.split(File.separator).last() + def projectName = configurationRoot.getName() def edtVersionForRing = EDT.ringModule(config) steps.deleteDir(workspaceDir) diff --git a/src/ru/pulsar/jenkins/library/steps/EdtValidate.groovy b/src/ru/pulsar/jenkins/library/steps/EdtValidate.groovy index a0f50a3b..70efc79f 100644 --- a/src/ru/pulsar/jenkins/library/steps/EdtValidate.groovy +++ b/src/ru/pulsar/jenkins/library/steps/EdtValidate.groovy @@ -38,7 +38,10 @@ class EdtValidate implements Serializable { steps.unstash(DesignerToEdtFormatTransformation.WORKSPACE_ZIP_STASH) steps.unzip(DesignerToEdtFormatTransformation.WORKSPACE, DesignerToEdtFormatTransformation.WORKSPACE_ZIP) - def projectName = config.srcDir.split(File.separator).last() + def srcDir = config.srcDir + def configurationRoot = FileUtils.getFilePath("$env.WORKSPACE/$srcDir") + + def projectName = configurationRoot.getName() projectList = "--project-name-list $projectName" } else { diff --git a/src/ru/pulsar/jenkins/library/steps/ResultsTransformer.groovy b/src/ru/pulsar/jenkins/library/steps/ResultsTransformer.groovy index 17f7aab1..fc6c6fc1 100644 --- a/src/ru/pulsar/jenkins/library/steps/ResultsTransformer.groovy +++ b/src/ru/pulsar/jenkins/library/steps/ResultsTransformer.groovy @@ -63,9 +63,10 @@ class ResultsTransformer implements Serializable { } - def splitDir = config.srcDir.split(File.separator) - def projectName = splitDir.last() - def srcDirExceptLast = splitDir.dropRight(1).join(File.separator) + srcDir = FileUtils.getFilePath("$env.WORKSPACE/$config.srcDir") + + def projectName = srcDir.getName() + def srcDirExceptLast = srcDir.getParent() steps.cmd("edt-ripper parse $edtValidateFile $srcDirExceptLast $projectName $env.WORKSPACE/$RESULT_FILE")