-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.cmd
131 lines (99 loc) · 3.63 KB
/
build.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
@ECHO OFF
SETLOCAL
CALL %CTKBLDROOT%setupEnv.cmd
SET BASENAME=Cyotek.Drawing.BitmapFont
SET RELDIR=src\bin\Release\
SET PRJFILE=src\%BASENAME%.csproj
SET DLLNAME=%BASENAME%.dll
SET DISTDIR=dist\
SET DEMOPRJFILE=%BASENAME%.sln
SET DEMORELDIR=fontviewer\bin\Release\
SET DEMORELDIR2=textmaker\bin\Release\
SET DEPDIR=%DISTDIR%demo\
IF EXIST %RELDIR%*.nupkg DEL /F %RELDIR%*.nupkg
IF EXIST %RELDIR%*.snupkg DEL /F %RELDIR%*.snupkg
IF EXIST %RELDIR%*.zip DEL /F %RELDIR%*.zip
IF EXIST %DEPDIR% RMDIR /Q /S %DEPDIR%
IF EXIST %DISTDIR% RMDIR /Q /S %DISTDIR%
MKDIR %DISTDIR%
CALL runtests.cmd
IF %ERRORLEVEL% NEQ 0 GOTO :failed
CALL :builddemo
IF %ERRORLEVEL% NEQ 0 GOTO :failed
CALL :buildpackage
IF %ERRORLEVEL% NEQ 0 GOTO :failed
ENDLOCAL
GOTO :eof
:buildfailed
:failed
CECHO {0c}ERROR {#}: Build failed.{\n}
EXIT /b 1
:builddemo
%msbuildexe% %DEMOPRJFILE% /p:Configuration=Release /verbosity:minimal /nologo /t:Clean,Build
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
MKDIR %DEPDIR%
MKDIR %DEPDIR%\samples
COPY %DEMORELDIR%ctkbmfnt.exe %DEPDIR%demo.exe
COPY %DEMORELDIR%ctkbmfnt.pdb %DEPDIR%demo.pdb
COPY %DEMORELDIR%ctkbmfnt.exe.config %DEPDIR%demo.exe.config
COPY %DEMORELDIR%%BASENAME%.dll %DEPDIR%
COPY %DEMORELDIR%%BASENAME%.pdb %DEPDIR%
COPY %DEMORELDIR%Cyotek.Windows.Forms.ImageBox.dll %DEPDIR%
COPY %DEMORELDIR%about.txt %DEPDIR%
COPY %DEMORELDIR%samples\*.* %DEPDIR%samples
COPY %DEMORELDIR2%ctktxtmk.exe %DEPDIR%
COPY %DEMORELDIR2%ctktxtmk.pdb %DEPDIR%
COPY %DEMORELDIR2%ctktxtmk.exe.config %DEPDIR%
COPY %DEMORELDIR2%Cyotek.Windows.Forms.ColorPicker.dll %DEPDIR%
COPY %DEMORELDIR2%samples\*.ctm %DEPDIR%samples
PUSHD %DEPDIR%
CALL signcmd demo.exe
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd ctktxtmk.exe
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd %BASENAME%.dll
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
%zipexe% a %BASENAME%.Demo.2.x.x.zip -r
POPD
MOVE %DEPDIR%*.zip %DISTDIR%
EXIT /b %ERRORLEVEL%
:buildpackage
dotnet build %PRJFILE% --configuration Release
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
PUSHD %RELDIR%
CALL signcmd net35\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd net40\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd net452\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd net462\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd net472\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd net48\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd net5.0\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd netcoreapp2.1\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd netcoreapp2.2\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd netcoreapp3.1\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd netstandard1.3\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd netstandard2.0\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL signcmd netstandard2.1\%DLLNAME%
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
%zipexe% a %BASENAME%.2.x.x.zip -r
POPD
MOVE %RELDIR%*.zip %DISTDIR%
dotnet pack %PRJFILE% --configuration Release --no-build
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL sign-package %RELDIR%*.nupkg
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
CALL sign-package %RELDIR%*.snupkg
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
EXIT /b %ERRORLEVEL%