forked from arkuznetsov/1CFilesConverter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
edt-validate.cmd
63 lines (53 loc) · 1.77 KB
/
edt-validate.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@ECHO OFF
rem Validate 1C configuration using 1C:EDT (ring tool)
rem %1 - path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format)
rem %2 - path to validation report file
if not defined V8_VERSION set V8_VERSION=8.3.20.2290
if not defined V8_TEMP set V8_TEMP=%TEMP%\1c
FOR /F "usebackq tokens=1 delims=" %%i IN (`where ring`) DO (
set RING_TOOL="%%i"
)
IF "%VALIDATE_PATH%" equ "" (
set VALIDATE_PATH=%V8_TEMP%\tmp_edt
)
set WS_PATH=%V8_TEMP%\edt_ws
set CLEAN_AFTER_VALIDATION=0
set CONFIG_PATH=%1
if defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=%
set REPORT_FILE=%2
if defined REPORT_FILE (
set REPORT_FILE=%REPORT_FILE:"=%
set REPORT_FILE_PATH=%~dp2
)
if not defined CONFIG_PATH (
echo Missed parameter 1 "path to 1C configuration (binary (*.cf), 1C:Designer XML format or 1C:EDT format)"
exit /b 1
)
if not defined REPORT_FILE (
echo Missed parameter 2 "path to validation report file"
exit /b 1
)
echo Clear temporary files...
if exist "%WS_PATH%" (
rd /S /Q "%WS_PATH%"
)
del "%REPORT_FILE%"
md "%REPORT_FILE_PATH%"
echo Prepare project for validation...
IF exist "%CONFIG_PATH%\DT-INF\" (
set VALIDATE_PATH=%CONFIG_PATH%
) else (
set CLEAN_AFTER_VALIDATION=1
IF exist "%CONFIG_PATH%\Configuration.xml" (
call %~dp0xml2edt.cmd "%CONFIG_PATH%" "%VALIDATE_PATH%"
) else (
call %~dp0cf2edt.cmd "%CONFIG_PATH%" "%VALIDATE_PATH%"
)
)
echo Run validation in "%VALIDATE_PATH%"...
call %RING_TOOL% edt workspace validate --project-list "%VALIDATE_PATH%" --workspace-location "%WS_PATH%" --file "%REPORT_FILE%"
echo Clear temporary files...
rd /S /Q "%WS_PATH%"
IF "%CLEAN_AFTER_VALIDATION%" equ "1" (
rd /S /Q "%VALIDATE_PATH%"
)