forked from OPCFoundation/UA-ModelCompiler
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
PublishModel.bat
42 lines (34 loc) · 1.42 KB
/
PublishModel.bat
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
@ECHO off
SETLOCAL
set MODELCOMPILER=.\Bin\Release\OOI.ModelCompilerUI.exe
set SOURCE=%1
set TARGET=%2
set OUTPUT=.\Bin\nodesets
set INPUT=.\Opc.Ua.ModelCompiler\Design
set CSVINPUT=.\Opc.Ua.ModelCompiler\CSVs
IF NOT "%3"=="" (set INPUT=%INPUT%.%3) else (set INPUT=%INPUT%.v104)
IF NOT "%3"=="" (set OUTPUT=%OUTPUT%\%3) else (set OUTPUT=%OUTPUT%\master)
IF NOT "%3"=="" set VERSION=-version %3
IF NOT "%4"=="" set EXCLUDE=-exclude %4
IF "%3"=="v105" set OUTPUT=%ROOT%..\nodesets\master
IF "%3"=="v103" set CSVINPUT=%INPUT%
ECHO Building Model %TARGET%
IF NOT EXIST "%OUTPUT%\%TARGET%" MKDIR "%OUTPUT%\%TARGET%"
ECHO %MODELCOMPILER% %VERSION% %EXCLUDE% -d2 "%INPUT%\%SOURCE%.xml" -cg "%CSVINPUT%\%SOURCE%.csv" -o2 "%OUTPUT%\%TARGET%\\" %USEALLOWSUBTYPES%
%MODELCOMPILER% %VERSION% %EXCLUDE% -d2 "%INPUT%\%SOURCE%.xml" -cg "%CSVINPUT%\%SOURCE%.csv" -o2 "%OUTPUT%\%TARGET%\\" %USEALLOWSUBTYPES%
IF %ERRORLEVEL% NEQ 0 ( ECHO Failed %TARGET% & EXIT /B 3 )
ECHO Copying Model files to %OUTPUT%\%TARGET%\%SOURCE%
COPY "%INPUT%\%SOURCE%.xml" "%OUTPUT%\%TARGET%\%SOURCE%.xml"
TYPE "%CSVINPUT%\%SOURCE%.csv" | FINDSTR /V /E Unspecified > "%OUTPUT%\%TARGET%\%SOURCE%.csv"
DEL /f /q "%OUTPUT%\%TARGET%\*NodeSet.xml"
GOTO theEnd
ECHO Updating License
ECHO ON
CALL UpdateLicense "%OUTPUT%\%TARGET%"
@ECHO OFF
:noModelCompiler
ECHO.
ECHO ModelCompiler not found. Please make sure it is compiled in RELEASE mode.
ECHO Searched for: %MODELCOMPILER%
:theEnd
ENDLOCAL