From 0bc991989e15c1a54d258580c5e21db324bfaaf6 Mon Sep 17 00:00:00 2001 From: Artem Kuznetsov Date: Wed, 26 Jul 2023 15:40:27 +0300 Subject: [PATCH] =?UTF-8?q?refactor:=20=D0=A1=D0=BA=D1=80=D0=B8=D0=BF?= =?UTF-8?q?=D1=82=D1=8B=20=D0=B2=D1=8B=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8?= =?UTF-8?q?=20=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=B2=D0=BD=D0=B5=D1=88=D0=BD=D0=B8=D1=85=20?= =?UTF-8?q?=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=BE=D0=B2=20=D0=B8=20=D0=BE?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BE=D0=BA=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD=D1=8B=20=D0=BA=20=D0=B5?= =?UTF-8?q?=D0=B4=D0=B8=D0=BD=D0=BE=D0=B9=20=D1=81=D1=82=D1=80=D1=83=D0=BA?= =?UTF-8?q?=D1=82=D1=83=D1=80=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/conf2cf.cmd | 3 --- scripts/conf2edt.cmd | 11 +++++------ scripts/conf2ib.cmd | 39 +++++++++++++++++++++--------------- scripts/conf2xml.cmd | 47 +++++++++++++++++++++++++------------------- scripts/dp2epf.cmd | 8 +++++--- scripts/dp2xml.cmd | 11 ++++++++--- 6 files changed, 68 insertions(+), 51 deletions(-) diff --git a/scripts/conf2cf.cmd b/scripts/conf2cf.cmd index 4668831..d048e9c 100644 --- a/scripts/conf2cf.cmd +++ b/scripts/conf2cf.cmd @@ -3,9 +3,6 @@ rem Convert (load) 1C configuration from 1C:EDT format to 1C configuration file (*.cf) rem %1 - path to 1C configuration source (infobase, 1C:Designer XML files or 1C:EDT project) rem %2 - path to 1C configuration file (*.cf) -rem %3 - convertion tool to use: -rem ibcmd - ibcmd tool (default) -rem designer - batch run of 1C:Designer IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c diff --git a/scripts/conf2edt.cmd b/scripts/conf2edt.cmd index b2765f2..7943fd2 100644 --- a/scripts/conf2edt.cmd +++ b/scripts/conf2edt.cmd @@ -2,10 +2,7 @@ rem Convert (dump) 1C configuration file (*.cf) to 1C:EDT format rem %1 - path to 1C configuration source (1C configuration file (*.cf), infobase or 1C:Designer XML files) -rem %2 - path to folder to save configuration files in 1C:EDT format -rem %3 - convertion tool to use: -rem ibcmd - ibcmd tool (default) -rem designer - batch run of 1C:Designer +rem %2 - path to folder to save configuration files in 1C:EDT project format IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c @@ -33,14 +30,13 @@ IF not defined CONFIG_SOURCE ( exit /b 1 ) IF not defined CONFIG_PATH ( - echo Missed parameter 2 "path to folder to save configuration files in 1C:EDT format" + echo Missed parameter 2 "path to folder to save configuration files in 1C:EDT peoject format" exit /b 1 ) echo Clear temporary files... IF exist "%V8_TEMP%" rd /S /Q "%V8_TEMP%" md "%V8_TEMP%" -md "%IB_PATH%" md "%XML_PATH%" md "%WS_PATH%" IF exist "%CONFIG_PATH%" rd /S /Q "%CONFIG_PATH%" @@ -70,6 +66,9 @@ exit /b 1 :export_cf echo Creating infobase "%IB_PATH%" from file "%CONFIG_FILE%"... + +md "%IB_PATH%" + IF "%V8_CONVERT_TOOL%" equ "designer" ( %V8_TOOL% CREATEINFOBASE File="%IB_PATH%"; /DisableStartupDialogs /UseTemplate "%CONFIG_FILE%" ) ELSE ( diff --git a/scripts/conf2ib.cmd b/scripts/conf2ib.cmd index 7135b70..993e9b2 100644 --- a/scripts/conf2ib.cmd +++ b/scripts/conf2ib.cmd @@ -3,11 +3,9 @@ rem Load 1C configuration file (*.cf) to 1C infobase (file) rem %1 - path to 1C configuration source (1C configuration file (*.cf), 1C:Designer XML files or 1C:EDT project) rem %2 - path to folder contains 1C infobase -rem %3 - convertion tool to use: -rem ibcmd - ibcmd tool (default) -rem designer - batch run of 1C:Designer IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 +IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c IF not "%V8_CONVERT_TOOL%" equ "designer" IF not "%V8_CONVERT_TOOL%" equ "ibcmd" set V8_CONVERT_TOOL=designer set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe" @@ -36,6 +34,8 @@ IF not defined IB_PATH ( ) echo Clear infobase folder "%IB_PATH%"... +IF exist "%V8_TEMP%" rd /S /Q "%V8_TEMP%" +md "%V8_TEMP%" IF exist "%IB_PATH%" rd /S /Q "%IB_PATH%" md "%IB_PATH%" @@ -43,32 +43,28 @@ echo Checking configuration source type... IF /i "%CONFIG_SOURCE:~-3%" equ ".cf" ( echo Source type: Configuration file ^(CF^) - md "%IB_PATH%" - echo Creating infobase "%IB_PATH%" from file "%CONFIG_SOURCE%"... - IF "%V8_CONVERT_TOOL%" equ "designer" ( - %V8_TOOL% CREATEINFOBASE File="%IB_PATH%"; /DisableStartupDialogs /UseTemplate "%CONFIG_SOURCE%" - ) ELSE ( - %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --load="%CONFIG_SOURCE%" - ) - goto end + goto export_cf ) IF exist "%CONFIG_SOURCE%\DT-INF\" ( echo Source type: 1C:EDT project - echo Export "%CONFIG_SOURCE%" to 1C:Designer XML format "%XML_PATH%"... - call %V8_RING_TOOL% edt workspace export --project "%CONFIG_SOURCE%" --configuration-files "%XML_PATH%" --workspace-location "%WS_PATH%" - goto export + goto export_edt ) IF exist "%CONFIG_SOURCE%\Configuration.xml" ( echo Source type: 1C:Designer XML files set XML_PATH=%CONFIG_SOURCE% - goto export + goto export_xml ) echo Error cheking type of configuration "%CONFIG_SOURCE%"! echo Configuration file (*.cf), 1C:Designer XML files or 1C:EDT project expected. exit /b 1 -:export +:export_edt + +echo Export "%CONFIG_SOURCE%" to 1C:Designer XML format "%XML_PATH%"... +call %V8_RING_TOOL% edt workspace export --project "%CONFIG_SOURCE%" --configuration-files "%XML_PATH%" --workspace-location "%WS_PATH%" + +:export_xml IF "%V8_CONVERT_TOOL%" equ "designer" ( echo Creating infobase "%IB_PATH%"... @@ -81,4 +77,15 @@ IF "%V8_CONVERT_TOOL%" equ "designer" ( %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --import="%XML_PATH%" ) +goto end + +:export_cf + +echo Creating infobase "%IB_PATH%" from file "%CONFIG_SOURCE%"... +IF "%V8_CONVERT_TOOL%" equ "designer" ( + %V8_TOOL% CREATEINFOBASE File="%IB_PATH%"; /DisableStartupDialogs /UseTemplate "%CONFIG_SOURCE%" +) ELSE ( + %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --load="%CONFIG_SOURCE%" +) + :end diff --git a/scripts/conf2xml.cmd b/scripts/conf2xml.cmd index 0586364..f34e1a8 100644 --- a/scripts/conf2xml.cmd +++ b/scripts/conf2xml.cmd @@ -3,9 +3,6 @@ rem Convert (dump) 1C configuration file (*.cf) to 1C:Designer XML format rem %1 - path to 1C configuration source (1C configuration file (*.cf), infobase or 1C:EDT project) rem %2 - path to folder to save configuration files in 1C:Designer XML format -rem %3 - convertion tool to use: -rem ibcmd - ibcmd tool (default) -rem designer - batch run of 1C:Designer IF not defined V8_VERSION set V8_VERSION=8.3.20.2290 IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c @@ -46,33 +43,35 @@ echo Checking configuration source type... IF /i "%CONFIG_SOURCE:~-3%" equ ".cf" ( echo Source type: Configuration file ^(CF^) - md "%IB_PATH%" - echo Creating infobase "%IB_PATH%" from file "%CONFIG_SOURCE%"... - IF "%V8_CONVERT_TOOL%" equ "designer" ( - %V8_TOOL% CREATEINFOBASE File="%IB_PATH%"; /DisableStartupDialogs /UseTemplate "%CONFIG_SOURCE%" - ) ELSE ( - %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --load="%CONFIG_SOURCE%" - ) - goto export -) -IF exist "%CONFIG_SOURCE%\DT-INF\" ( - echo Source type: 1C:EDT project - echo Export "%EDT_PATH%" to 1C:Designer XML format "%CONFIG_PATH%"... - md "%WS_PATH%" - call %V8_RING_TOOL% edt workspace export --project "%CONFIG_SOURCE%" --configuration-files "%CONFIG_PATH%" --workspace-location "%WS_PATH%" - goto end + goto export_cf ) IF exist "%CONFIG_SOURCE%\1cv8.1cd" ( echo Source type: Infobase set IB_PATH=%CONFIG_SOURCE% - goto export + goto export_ib +) +IF exist "%CONFIG_SOURCE%\DT-INF\" ( + echo Source type: 1C:EDT project + goto export_edt ) echo Error cheking type of configuration "%CONFIG_SOURCE%"! echo Infobase, configuration file (*.cf) or 1C:EDT project expected. exit /b 1 -:export +:export_cf + +echo Creating infobase "%IB_PATH%" from file "%CONFIG_SOURCE%"... + +md "%IB_PATH%" + +IF "%V8_CONVERT_TOOL%" equ "designer" ( + %V8_TOOL% CREATEINFOBASE File="%IB_PATH%"; /DisableStartupDialogs /UseTemplate "%CONFIG_SOURCE%" +) ELSE ( + %IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --load="%CONFIG_SOURCE%" +) + +:export_ib echo Export configuration from infobase "%IB_PATH%" to 1C:Designer XML format "%CONFIG_PATH%"... IF "%V8_CONVERT_TOOL%" equ "designer" ( @@ -81,6 +80,14 @@ IF "%V8_CONVERT_TOOL%" equ "designer" ( %IBCMD_TOOL% infobase config export --db-path="%IB_PATH%" "%CONFIG_PATH%" --force ) +goto end + +:export_edt + +echo Export "%EDT_PATH%" to 1C:Designer XML format "%CONFIG_PATH%"... +md "%WS_PATH%" +call %V8_RING_TOOL% edt workspace export --project "%CONFIG_SOURCE%" --configuration-files "%CONFIG_PATH%" --workspace-location "%WS_PATH%" + :end echo Clear temporary files... diff --git a/scripts/dp2epf.cmd b/scripts/dp2epf.cmd index 4c01b2d..604c8a4 100644 --- a/scripts/dp2epf.cmd +++ b/scripts/dp2epf.cmd @@ -98,9 +98,6 @@ IF exist "%DP_SOURCE%\DT-INF\" ( ) IF "%DP_SOURCE_IS_EDT%" equ "1" ( echo Source type: 1C:EDT project - echo Export "%EDT_PATH%" to 1C:Designer XML format "%DP_DEST_PATH%"... - md "%WS_PATH%" - md "%XML_PATH%" goto export_edt ) FOR /f %%f IN ('dir /b /a-d "%DP_SOURCE%\*.xml"') DO ( @@ -121,6 +118,10 @@ exit /b 1 :export_edt echo Export external data processors ^& reports from 1C:EDT format "%DP_SOURCE%" to 1C:Designer XML format "%XML_PATH%"... + +md "%WS_PATH%" +md "%XML_PATH%" + call %V8_RING_TOOL% edt workspace export --project "%DP_SOURCE%" --configuration-files "%XML_PATH%" --workspace-location "%WS_PATH%" :export_xml @@ -143,5 +144,6 @@ IF "%DP_SOURCE_IS_EDT%" equ "1" ( %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /LoadExternalDataProcessorOrReportFromFiles "%XML_PATH%\%%~nxf" "%DP_DEST_PATH%" ) ) + echo Clear temporary files... IF exist "%V8_TEMP%" rd /S /Q "%V8_TEMP%" diff --git a/scripts/dp2xml.cmd b/scripts/dp2xml.cmd index 965852a..3fccb48 100644 --- a/scripts/dp2xml.cmd +++ b/scripts/dp2xml.cmd @@ -96,9 +96,6 @@ IF exist "%DP_SOURCE%\DT-INF\" ( ) IF "%DP_SOURCE_IS_EDT%" equ "1" ( echo Source type: 1C:EDT project - echo Export "%EDT_PATH%" to 1C:Designer XML format "%DP_DEST_PATH%"... - md "%WS_PATH%" - call %V8_RING_TOOL% edt workspace export --project "%DP_SOURCE%" --configuration-files "%DP_DEST_PATH%" --workspace-location "%WS_PATH%" goto end ) FOR /f %%f IN ('dir /b /a-d "%DP_SOURCE%\*.epf" "%DP_SOURCE%\*.erf"') DO ( @@ -129,6 +126,14 @@ FOR /f %%f IN ('dir /b /a-d %DP_SOURCE_MASK%') DO ( %V8_TOOL% DESIGNER /IBConnectionString File="%IB_PATH%"; /DisableStartupDialogs /DumpExternalDataProcessorOrReportToFiles "%DP_DEST_PATH%" "%DP_SOURCE_PATH%\%%~nxf" ) +goto end + +:export_xml + +echo Export dataprocessors ^& reports from 1C:EDT project "%DP_SOURCE%" to 1C:Designer XML format "%DP_DEST_PATH%"... +md "%WS_PATH%" +call %V8_RING_TOOL% edt workspace export --project "%DP_SOURCE%" --configuration-files "%DP_DEST_PATH%" --workspace-location "%WS_PATH%" + :end echo Clear temporary files...