Skip to content

Commit

Permalink
continue
Browse files Browse the repository at this point in the history
  • Loading branch information
ovcharenko-di committed Nov 21, 2024
1 parent 7248c85 commit 792e0ba
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
14 changes: 10 additions & 4 deletions src/ru/pulsar/jenkins/library/edt/NativeEdtCliConverter.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ class NativeEdtCliConverter implements IEdtCliEngine {
def workspaceDir = FileUtils.getFilePath("$env.WORKSPACE/$DesignerToEdtFormatTransformation.WORKSPACE")
def srcDir = config.srcDir
def configurationRoot = FileUtils.getFilePath("$env.WORKSPACE/$srcDir")
def projectName = configurationRoot.getName()

def edtSrcRoot = FileUtils.getFilePath("$workspaceDir/$DesignerToEdtFormatTransformation.EDT_PROJECT_NAME")

steps.deleteDir(workspaceDir)

Logger.println("Конвертация исходников из формата конфигуратора в формат EDT с помощью 1cedtcli")

def edtcliCommand = "1cedtcli -data \"$workspaceDir\" -command import --configuration-files \"$configurationRoot\" --project-name \"$projectName\""
def edtcliCommand = "1cedtcli -data \"$workspaceDir\" -command import --configuration-files \"$configurationRoot\" --project \"$edtSrcRoot\""

steps.cmd(edtcliCommand)

Expand All @@ -85,9 +86,14 @@ class NativeEdtCliConverter implements IEdtCliEngine {
String workspaceLocation = "$env.WORKSPACE/$DesignerToEdtFormatTransformation.WORKSPACE"
def resultFile = "$env.WORKSPACE/$EdtValidate.RESULT_FILE"

def edtcliCommand = "1cedtcli -data \"$workspaceLocation\" -command validate --file \"$resultFile\" $projectList"
Logger.println("Версия EDT выше 2024.1.X, для валидации используется 1cedtcli")

def edtcliCommand = "1cedtcli -v -data \"$workspaceLocation\" -vmargs -Xmx30g -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF8 -Dosgi.nl=ru -Duser.language=ru -command validate --file \"$resultFile\" $projectList"
steps.catchError {
steps.cmd(edtcliCommand)
// String stdout = steps.cmd(edtcliCommand, false, true)
// steps.echo(stdout)
String stdout = steps.cmd("1cedtcli -v -data \"$workspaceLocation\" -command project --details", false, true)
steps.echo(stdout)
}

}
Expand Down
6 changes: 3 additions & 3 deletions src/ru/pulsar/jenkins/library/edt/RingConverter.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ class RingConverter implements IEdtCliEngine {
def workspaceDir = FileUtils.getFilePath("$env.WORKSPACE/$DesignerToEdtFormatTransformation.WORKSPACE")
def srcDir = config.srcDir
def configurationRoot = FileUtils.getFilePath("$env.WORKSPACE/$srcDir")
def projectName = configurationRoot.getName()

steps.deleteDir(workspaceDir)
steps.deleteDir(configurationRoot)

def edtSrcRoot = FileUtils.getFilePath("$workspaceDir/$DesignerToEdtFormatTransformation.EDT_PROJECT_NAME")

Logger.println("Конвертация исходников из формата конфигуратора в формат EDT с помощью ring")

String edtVersionForRing = EDT.ringModule(config)
String ringCommand = "ring $edtVersionForRing workspace import --configuration-files \"$configurationRoot\" --project-name \"$projectName\" --workspace-location \"$workspaceDir\""
String ringCommand = "ring $edtVersionForRing workspace import --configuration-files \"$configurationRoot\" --project \"$edtSrcRoot\" --workspace-location \"$workspaceDir\""

steps.ringCommand(ringCommand)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class DesignerToEdtFormatTransformation implements Serializable {
public static final String WORKSPACE_ZIP = 'build/edt-workspace.zip'
public static final String WORKSPACE_ZIP_STASH = 'edt-workspace-zip'

public static final String EDT_PROJECT_NAME = 'cf'

private final JobConfiguration config

DesignerToEdtFormatTransformation(JobConfiguration config) {
Expand Down
17 changes: 10 additions & 7 deletions src/ru/pulsar/jenkins/library/steps/EdtValidate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,28 @@ class EdtValidate implements Serializable {
}

def env = steps.env()
def workspaceDir = FileUtils.getFilePath("$env.WORKSPACE/$DesignerToEdtFormatTransformation.WORKSPACE")

String projectList

def projectDir
if (config.sourceFormat == SourceFormat.DESIGNER) {

// рабочая область в формате EDT уже была сформирована ранее,
// поэтому надо получить ее из stash

steps.unstash(DesignerToEdtFormatTransformation.WORKSPACE_ZIP_STASH)
steps.unzip(DesignerToEdtFormatTransformation.WORKSPACE, DesignerToEdtFormatTransformation.WORKSPACE_ZIP)

def srcDir = config.srcDir
def configurationRoot = FileUtils.getFilePath("$env.WORKSPACE/$srcDir")
projectDir = FileUtils.getFilePath("$workspaceDir/$DesignerToEdtFormatTransformation.EDT_PROJECT_NAME")

def projectName = configurationRoot.getName()

projectList = "--project-name-list $projectName"
} else {
def srcDir = config.srcDir
def projectDir = FileUtils.getFilePath("$env.WORKSPACE/$srcDir")
projectList = "--project-list \"$projectDir\""
projectDir = FileUtils.getFilePath("$env.WORKSPACE/$srcDir")
}

projectList = "--project-list \"$projectDir\""

Logger.println("Выполнение валидации EDT")

def engine = EdtCliEngineFactory.getEngine(config.edtVersion)
Expand Down

0 comments on commit 792e0ba

Please sign in to comment.