From e205f788ee17eabb5d559ca7c8fead80784446ae Mon Sep 17 00:00:00 2001 From: Artem Kuznetsov Date: Sat, 22 Jul 2023 14:49:15 +0300 Subject: [PATCH] =?UTF-8?q?refactor:=20=D0=9F=D0=B5=D1=80=D0=B5=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=BD=D1=8B=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20=D1=82=D0=B8=D0=BF=D0=B0=20?= =?UTF-8?q?=D0=B8=D1=81=D1=85=D0=BE=D0=B4=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83=D1=80=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=BE=D0=BD=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=82=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BE=D1=82=D1=87?= =?UTF-8?q?=D0=B5=D1=82=D0=BE=D0=B2=20/=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=BA=20=D0=B8=20=D0=B2=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=B4=D0=B0=D1=86=D0=B8=D0=B8=20EDT.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/dp-bin-dir2edt.cmd | 48 +++++++++++++++++++++-------------- scripts/dp-bin-dir2xml.cmd | 50 +++++++++++++++++++++--------------- scripts/dp-bin2edt.cmd | 50 +++++++++++++++++++++--------------- scripts/dp-bin2xml.cmd | 50 +++++++++++++++++++++--------------- scripts/dp-xml-dir2epf.cmd | 52 +++++++++++++++++++++++--------------- scripts/dp-xml2epf.cmd | 52 +++++++++++++++++++++++--------------- scripts/edt-validate.cmd | 25 ++++++++++++++++++ 7 files changed, 206 insertions(+), 121 deletions(-) diff --git a/scripts/dp-bin-dir2edt.cmd b/scripts/dp-bin-dir2edt.cmd index 4588b24..bb59729 100644 --- a/scripts/dp-bin-dir2edt.cmd +++ b/scripts/dp-bin-dir2edt.cmd @@ -47,31 +47,41 @@ IF exist "%DP_SRC_PATH%" rd /S /Q "%DP_SRC_PATH%" md %DP_SRC_PATH% echo Set infobase for export data processor/report... +set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" + IF "%BASE_CONFIG%" equ "" ( md "%IB_PATH%" echo Creating infobase "%IB_PATH%"... set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) ELSE ( - set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" - IF exist "%BASE_CONFIG%\DT-INF\" ( - md "%IB_PATH%" - call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\Configuration.xml" ( - md "%IB_PATH%" - call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\1cv8.1cd" ( - set BASE_CONFIG_DESCRIPTION=existed configuration - set IB_PATH=%BASE_CONFIG% - ) ELSE ( - md "%IB_PATH%" - call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) - ) - ) + goto export ) +IF /i "%BASE_CONFIG:~-3%" equ ".cf" ( + md "%IB_PATH%" + call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\DT-INF\" ( + md "%IB_PATH%" + call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\Configuration.xml" ( + md "%IB_PATH%" + call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\1cv8.1cd" ( + set BASE_CONFIG_DESCRIPTION=existed configuration + set IB_PATH=%BASE_CONFIG% + goto export +) + +echo Error cheking type of basic configuration "%BASE_CONFIG%"! +echo Infobase, configuration file (*.cf), 1C:Designer XML, 1C:EDT project or no configuration expected. +exit /b 1 + +:export echo Export dataprocessors from folder "%DP_BIN_PATH%" to 1C:Designer XML format "%XML_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%... FOR /f %%f IN ('dir /b /a-d "%DP_BIN_PATH%\*.epf"') DO ( diff --git a/scripts/dp-bin-dir2xml.cmd b/scripts/dp-bin-dir2xml.cmd index 14767e3..5719c31 100644 --- a/scripts/dp-bin-dir2xml.cmd +++ b/scripts/dp-bin-dir2xml.cmd @@ -39,31 +39,41 @@ md "%V8_TEMP%" IF not exist "%DP_SRC_PATH%" md "%DP_SRC_PATH%" echo Set infobase for export data processor/report... +set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" + IF "%BASE_CONFIG%" equ "" ( - echo Creating infobase "%IB_PATH%"... md "%IB_PATH%" + echo Creating infobase "%IB_PATH%"... set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) ELSE ( - set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" - IF exist "%BASE_CONFIG%\DT-INF\" ( - md "%IB_PATH%" - call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\Configuration.xml" ( - md "%IB_PATH%" - call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\1cv8.1cd" ( - set BASE_CONFIG_DESCRIPTION=existed configuration - set IB_PATH=%BASE_CONFIG% - ) ELSE ( - md "%IB_PATH%" - call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) - ) - ) + goto export ) +IF /i "%BASE_CONFIG:~-3%" equ ".cf" ( + md "%IB_PATH%" + call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\DT-INF\" ( + md "%IB_PATH%" + call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\Configuration.xml" ( + md "%IB_PATH%" + call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\1cv8.1cd" ( + set BASE_CONFIG_DESCRIPTION=existed configuration + set IB_PATH=%BASE_CONFIG% + goto export +) + +echo Error cheking type of basic configuration "%BASE_CONFIG%"! +echo Infobase, configuration file (*.cf), 1C:Designer XML, 1C:EDT project or no configuration expected. +exit /b 1 + +:export echo Export dataprocessors from folder "%DP_BIN_PATH%" to 1C:Designer XML format "%DP_SRC_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%... FOR /f %%f IN ('dir /b /a-d "%DP_BIN_PATH%\*.epf"') DO ( diff --git a/scripts/dp-bin2edt.cmd b/scripts/dp-bin2edt.cmd index f5715b9..6b58b5f 100644 --- a/scripts/dp-bin2edt.cmd +++ b/scripts/dp-bin2edt.cmd @@ -47,31 +47,41 @@ IF exist "%DP_PATH%" rd /S /Q "%DP_PATH%" md "%DP_PATH%" echo Set infobase for export data processor/report... +set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" + IF "%BASE_CONFIG%" equ "" ( - echo Creating infobase "%IB_PATH%"... md "%IB_PATH%" + echo Creating infobase "%IB_PATH%"... set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) ELSE ( - set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" - IF exist "%BASE_CONFIG%\DT-INF\" ( - md "%IB_PATH%" - call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\Configuration.xml" ( - md "%IB_PATH%" - call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\1cv8.1cd" ( - set BASE_CONFIG_DESCRIPTION=existed configuration - set IB_PATH=%BASE_CONFIG% - ) ELSE ( - md "%IB_PATH%" - call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) - ) - ) + goto export ) +IF /i "%BASE_CONFIG:~-3%" equ ".cf" ( + md "%IB_PATH%" + call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\DT-INF\" ( + md "%IB_PATH%" + call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\Configuration.xml" ( + md "%IB_PATH%" + call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\1cv8.1cd" ( + set BASE_CONFIG_DESCRIPTION=existed configuration + set IB_PATH=%BASE_CONFIG% + goto export +) + +echo Error cheking type of basic configuration "%BASE_CONFIG%"! +echo Infobase, configuration file (*.cf), 1C:Designer XML, 1C:EDT project or no configuration expected. +exit /b 1 + +:export echo Export dataprocessor / report "%DP_FILE%" to 1C:Designer XML format "%XML_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%... %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /DumpExternalDataProcessorOrReportToFiles "%XML_PATH%" "%DP_FILE%" diff --git a/scripts/dp-bin2xml.cmd b/scripts/dp-bin2xml.cmd index d093dff..b17b8a9 100644 --- a/scripts/dp-bin2xml.cmd +++ b/scripts/dp-bin2xml.cmd @@ -40,31 +40,41 @@ md "%V8_TEMP%" IF not exist "%DP_PATH%" md "%DP_PATH%" echo Set infobase for export data processor/report... +set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" + IF "%BASE_CONFIG%" equ "" ( - echo Creating infobase "%IB_PATH%"... md "%IB_PATH%" + echo Creating infobase "%IB_PATH%"... set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) ELSE ( - set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" - IF exist "%BASE_CONFIG%\DT-INF\" ( - md "%IB_PATH%" - call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\Configuration.xml" ( - md "%IB_PATH%" - call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\1cv8.1cd" ( - set BASE_CONFIG_DESCRIPTION=existed configuration - set IB_PATH=%BASE_CONFIG% - ) ELSE ( - md "%IB_PATH%" - call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) - ) - ) + goto export ) +IF /i "%BASE_CONFIG:~-3%" equ ".cf" ( + md "%IB_PATH%" + call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\DT-INF\" ( + md "%IB_PATH%" + call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\Configuration.xml" ( + md "%IB_PATH%" + call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\1cv8.1cd" ( + set BASE_CONFIG_DESCRIPTION=existed configuration + set IB_PATH=%BASE_CONFIG% + goto export +) + +echo Error cheking type of basic configuration "%BASE_CONFIG%"! +echo Infobase, configuration file (*.cf), 1C:Designer XML, 1C:EDT project or no configuration expected. +exit /b 1 + +:export echo Export dataprocessor / report "%DP_FILE%" to 1C:Designer XML format "%DP_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%... %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /DumpExternalDataProcessorOrReportToFiles "%DP_PATH%" "%DP_FILE%" diff --git a/scripts/dp-xml-dir2epf.cmd b/scripts/dp-xml-dir2epf.cmd index e5b7777..3fa2f54 100644 --- a/scripts/dp-xml-dir2epf.cmd +++ b/scripts/dp-xml-dir2epf.cmd @@ -38,32 +38,42 @@ IF exist "%V8_TEMP%" rd /S /Q "%V8_TEMP%" md "%V8_TEMP%" IF not exist "%DP_BIN_PATH%" md "%DP_BIN_PATH%" -echo Set infobase for import data processor/report... +echo Set infobase for export data processor/report... +set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" + IF "%BASE_CONFIG%" equ "" ( - echo Creating infobase "%IB_PATH%"... md "%IB_PATH%" + echo Creating infobase "%IB_PATH%"... set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) ELSE ( - set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" - IF exist "%BASE_CONFIG%\DT-INF\" ( - md "%IB_PATH%" - call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\Configuration.xml" ( - md "%IB_PATH%" - call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\1cv8.1cd" ( - set BASE_CONFIG_DESCRIPTION=existed configuration - set IB_PATH=%BASE_CONFIG% - ) ELSE ( - md "%IB_PATH%" - call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) - ) - ) + goto export ) +IF /i "%BASE_CONFIG:~-3%" equ ".cf" ( + md "%IB_PATH%" + call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\DT-INF\" ( + md "%IB_PATH%" + call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\Configuration.xml" ( + md "%IB_PATH%" + call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\1cv8.1cd" ( + set BASE_CONFIG_DESCRIPTION=existed configuration + set IB_PATH=%BASE_CONFIG% + goto export +) + +echo Error cheking type of basic configuration "%BASE_CONFIG%"! +echo Infobase, configuration file (*.cf), 1C:Designer XML, 1C:EDT project or no configuration expected. +exit /b 1 + +:export echo Import dataprocessors ^& reports from folder "%DP_SRC_PATH%" to 1C:Designer format "%DP_BIN_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%... FOR /f %%f IN ('dir /b /a-d "%DP_SRC_PATH%\*.xml"') DO ( diff --git a/scripts/dp-xml2epf.cmd b/scripts/dp-xml2epf.cmd index bdd9b9d..363d4cc 100644 --- a/scripts/dp-xml2epf.cmd +++ b/scripts/dp-xml2epf.cmd @@ -38,32 +38,42 @@ IF exist "%V8_TEMP%" rd /S /Q "%V8_TEMP%" md "%V8_TEMP%" IF not exist "%DP_PATH%" md "%DP_PATH%" -echo Set infobase for import data processor/report... +echo Set infobase for export data processor/report... +set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" + IF "%BASE_CONFIG%" equ "" ( - echo Creating infobase "%IB_PATH%"... md "%IB_PATH%" + echo Creating infobase "%IB_PATH%"... set BASE_CONFIG_DESCRIPTION=empty configuration %V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs -) ELSE ( - set BASE_CONFIG_DESCRIPTION=configuration from "%BASE_CONFIG%" - IF exist "%BASE_CONFIG%\DT-INF\" ( - md "%IB_PATH%" - call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\Configuration.xml" ( - md "%IB_PATH%" - call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) ELSE ( - IF exist "%BASE_CONFIG%\1cv8.1cd" ( - set BASE_CONFIG_DESCRIPTION=existed configuration - set IB_PATH=%BASE_CONFIG% - ) ELSE ( - md "%IB_PATH%" - call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" - ) - ) - ) + goto export ) +IF /i "%BASE_CONFIG:~-3%" equ ".cf" ( + md "%IB_PATH%" + call %~dp0cf2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\DT-INF\" ( + md "%IB_PATH%" + call %~dp0edt2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\Configuration.xml" ( + md "%IB_PATH%" + call %~dp0xml2ib.cmd "%BASE_CONFIG%" "%IB_PATH%" + goto export +) +IF exist "%BASE_CONFIG%\1cv8.1cd" ( + set BASE_CONFIG_DESCRIPTION=existed configuration + set IB_PATH=%BASE_CONFIG% + goto export +) + +echo Error cheking type of basic configuration "%BASE_CONFIG%"! +echo Infobase, configuration file (*.cf), 1C:Designer XML, 1C:EDT project or no configuration expected. +exit /b 1 + +:export echo Import dataprocessor / report "%DP_FILE%" to 1C:Designer format "%DP_PATH%" using infobase "%IB_PATH%" with %BASE_CONFIG_DESCRIPTION%... %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /LoadExternalDataProcessorOrReportFromFiles "%DP_FILE%" "%DP_PATH%" diff --git a/scripts/edt-validate.cmd b/scripts/edt-validate.cmd index fc774e1..eed7ed3 100644 --- a/scripts/edt-validate.cmd +++ b/scripts/edt-validate.cmd @@ -50,6 +50,31 @@ IF exist "%CONFIG_PATH%\DT-INF\" ( call %~dp0cf2edt.cmd "%CONFIG_PATH%" "%VALIDATE_PATH%" ) ) +echo Prepare project for validation... + +IF exist "%CONFIG_PATH%\DT-INF\" ( + set VALIDATE_PATH=%CONFIG_PATH% + goto validate +) +md "%VALIDATE_PATH%" +IF /i "%CONFIG_PATH:~-3%" equ ".cf" ( + call %~dp0cf2edt.cmd "%CONFIG_PATH%" "%VALIDATE_PATH%" + goto validate +) +IF exist "%CONFIG_PATH%\Configuration.xml" ( + call %~dp0xml2edt.cmd "%CONFIG_PATH%" "%VALIDATE_PATH%" + goto validate +) +IF exist "%CONFIG_PATH%\1cv8.1cd" ( + call %~dp0ib2edt.cmd "%CONFIG_PATH%" "%VALIDATE_PATH%" + goto validate +) + +echo Error cheking type of configuration "%BASE_CONFIG%"! +echo Infobase, configuration file (*.cf), 1C:Designer XML or 1C:EDT project expected. +exit /b 1 + +:validate echo Run validation in "%VALIDATE_PATH%"... call %RING_TOOL% edt workspace validate --project-list "%VALIDATE_PATH%" --workspace-location "%WS_PATH%" --file "%REPORT_FILE%"