1
0

Причесывание едт-шага

This commit is contained in:
Nikita Gryzlov
2020-04-28 14:03:02 +03:00
parent fd4aeb4eef
commit aa8f96de70
4 changed files with 24 additions and 9 deletions

View File

@@ -29,4 +29,6 @@ interface IStepExecutor {
void createDir(String path)
def withEnv(List<String> strings, Closure body)
def archiveArtifacts(String path)
}

View File

@@ -73,4 +73,9 @@ class StepExecutor implements IStepExecutor {
body()
}
}
@Override
def archiveArtifacts(String path) {
steps.archiveArtifacts path
}
}

View File

@@ -27,30 +27,32 @@ class EdtValidate implements Serializable {
def env = steps.env();
def projectDir = "$env.WORKSPACE/build/project"
def resultFileRelative = 'build/out/edt-validate.xml'
def projectName = 'temp'
def workspaceDir = "$env.WORKSPACE/build/workspace"
def resultFile = "$env.WORKSPACE/build/edt-validate.xml"
def resultFile = "$env.WORKSPACE/$resultFileRelative"
def configurationRoot = new File(env.WORKSPACE, rootDir).getAbsolutePath()
steps.createDir(projectDir)
steps.createDir(workspaceDir)
steps.createDir(new File(resultFile).getParent())
Logger.println("Конвертация исходников из формата конфигуратора в формат EDT")
def ringCommand = "ring edt workspace import --configuration-files '$configurationRoot' --project '$projectDir' --workspace-location '$workspaceDir'"
steps.withEnv(['RING_OPTS="-Dfile.encoding=UTF-8 -Dosgi.nl=ru -Duser.language=ru"']) {
def ringCommand = "ring edt workspace import --configuration-files '$configurationRoot' --project-name $projectName --workspace-location '$workspaceDir'"
def ringOpts = ['_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dosgi.nl=ru -Duser.language=ru"']
steps.withEnv(ringOpts) {
steps.cmd(ringCommand)
}
Logger.println("Выполнение валидации EDT")
ringCommand = "ring edt workspace validate --workspace-location '$workspaceDir' --file '$resultFile' --project '$projectDir'"
ringCommand = "ring edt workspace validate --workspace-location '$workspaceDir' --file '$resultFile' --project-name-list $projectName"
steps.withEnv(['RING_OPTS="-Dfile.encoding=UTF-8 -Dosgi.nl=ru -Duser.language=ru"']) {
steps.withEnv(ringOpts) {
steps.cmd(ringCommand)
}
steps.archiveArtifacts(resultFileRelative)
}
}

View File

@@ -10,4 +10,10 @@ class Logger implements Serializable {
def env = steps.env();
steps.echo("Running on node $env.NODE_NAME")
}
static void println(String message) {
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()
steps.echo(message)
}
}