1
0
mirror of https://github.com/arkuznetsov/1CFilesConverter.git synced 2025-02-19 19:00:09 +02:00

refactor: Скрипты выгрузки конфигурации, внешних отчетов и обработок приведены к единой структуре.

This commit is contained in:
Artem Kuznetsov 2023-07-26 15:40:27 +03:00
parent 49642e72e7
commit 0bc991989e
6 changed files with 68 additions and 51 deletions

View File

@ -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

View File

@ -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 (

View File

@ -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

View File

@ -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...

View File

@ -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%"

View File

@ -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...