1
0
mirror of https://github.com/arkuznetsov/1CFilesConverter.git synced 2024-11-24 08:33:30 +02:00

refactor: Переработаны проверки типа исходников конфигурации для конвертации отчетов / обработок и валидации EDT.

This commit is contained in:
Artem Kuznetsov 2023-07-22 14:49:15 +03:00
parent 386ca415a9
commit e205f788ee
7 changed files with 206 additions and 121 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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