forked from itext/itextsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildAll.bat
More file actions
168 lines (125 loc) · 4.97 KB
/
BuildAll.bat
File metadata and controls
168 lines (125 loc) · 4.97 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
@echo off
if not defined msbuildExec (
set msbuildExec=msbuild
)
if not defined gitExec (
set gitExec=git
)
if not defined sevenZipExec (
set sevenZipExec=7z
)
echo Cleaning up...
call "%gitExec%" reset --hard
call "%gitExec%" pull
call "%gitExec%" clean -qfdx
if errorlevel 1 goto cleanUpFailed
echo Creating archives with sources...
rem zip itextsharp-src-core.zip
call "%sevenZipExec%" a -tzip itextsharp-src-core.zip -r .\core\* > nul
if errorlevel 1 goto archiveFailed
rem zip itextsharp-src-pdfa.zip
call "%sevenZipExec%" a -tzip itextsharp-src-pdfa.zip -r .\extras\itextsharp.pdfa\* > nul
if errorlevel 1 goto archiveFailed
rem zip itextsharp-src-xtra.zip
call "%sevenZipExec%" a -tzip itextsharp-src-xtra.zip -r .\extras\iTextSharp.xtra\* > nul
if errorlevel 1 goto archiveFailed
rem zip itextsharp-src-xmlworker.zip
call "%sevenZipExec%" a -tzip itextsharp-src-xmlworker.zip -r .\extras\itextsharp.xmlworker\* > nul
if errorlevel 1 goto archiveFailed
echo Building binaries...
rem rebuild core Release
call "%msbuildExec%" core\itextsharp.csproj /t:Rebuild /p:Configuration=Release,Platform=AnyCPU > nul
if errorlevel 1 goto buildFailed
rem rebuild core Release_woDrawing
call "%msbuildExec%" core\itextsharp.csproj /t:Rebuild /p:Configuration=Release_woDrawing,Platform=AnyCPU > nul
if errorlevel 1 goto buildFailed
rem rebuild pdfa Release
call "%msbuildExec%" extras\itextsharp.pdfa\itextsharp.pdfa.csproj /t:Rebuild /p:Configuration=Release,Platform=AnyCPU > nul
if errorlevel 1 goto buildFailed
rem rebuild xtra Release
call "%msbuildExec%" extras\iTextSharp.xtra\iTextSharp.xtra.csproj /t:Rebuild /p:Configuration=Release,Platform=AnyCPU > nul
if errorlevel 1 goto buildFailed
rem rebuild xmlworker Release
call "%msbuildExec%" extras\itextsharp.xmlworker\itextsharp.xmlworker.csproj /t:Rebuild /p:Configuration=Release,Platform=AnyCPU > nul
if errorlevel 1 goto buildFailed
echo Creating archives with binaries...
rem zip core dll Release itextsharp-dll-core.zip
call "%sevenZipExec%" a -tzip itextsharp-dll-core.zip -r .\core\bin\Release\* > nul
if errorlevel 1 goto archiveFailed
rem zip core dll Release_woDrawing itextsharp-dll-core-wo_Drawing.zip
call "%sevenZipExec%" a -tzip itextsharp-dll-core-wo_Drawing.zip -r .\core\bin\Release_woDrawing\* > nul
if errorlevel 1 goto archiveFailed
rem zip pdfa dll Release itextsharp-dll-pdfa.zip
call "%sevenZipExec%" a -tzip itextsharp-dll-pdfa.zip .\extras\itextsharp.pdfa\bin\Release\itextsharp.pdfa.dll > nul
if errorlevel 1 goto archiveFailed
rem zip xtra dll Release itextsharp-dll-xtra.zip
call "%sevenZipExec%" a -tzip itextsharp-dll-xtra.zip .\extras\iTextSharp.xtra\bin\Release\itextsharp.xtra.dll > nul
if errorlevel 1 goto archiveFailed
rem zip xmlworker dll Release itextsharp-dll-xmlworker.zip
call "%sevenZipExec%" a -tzip itextsharp-dll-xmlworker.zip .\extras\itextsharp.xmlworker\bin\Release\itextsharp.xmlworker.dll > nul
if errorlevel 1 goto archiveFailed
echo Creating resulting archives...
rem add to result notice.txt
call "%sevenZipExec%" a -tzip itextsharp-all.zip .\notice.txt > nul
if errorlevel 1 goto archiveFailed
rem add to result archives
call "%sevenZipExec%" a -tzip itextsharp-all.zip itextsharp-dll-core.zip itextsharp-dll-core-wo_Drawing.zip itextsharp-dll-pdfa.zip itextsharp-dll-xtra.zip itextsharp-src-core.zip itextsharp-src-pdfa.zip itextsharp-src-xtra.zip > nul
if errorlevel 1 goto archiveFailed
rem add to result archives
call "%sevenZipExec%" a -tzip itextsharp.xmlworker-all.zip itextsharp-src-xmlworker.zip itextsharp-dll-xmlworker.zip > nul
if errorlevel 1 goto archiveFailed
rem delete temp archives
call :deleteTempFiles
echo Success!
pause
exit
:buildFailed
echo:
echo Binaries build failed. Please, make sure that either msbuildExec path variable is defined or msbuild.exe is available to call from command line. The process will be aborted.
echo:
call :deleteTempFiles
pause
exit
:cleanUpFailed
echo:
echo Cleaning up failed. Please, make sure that either gitExec path variable is defined or git.exe is available to call from command line. The process will be aborted.
echo:
pause
exit
:archiveFailed
echo:
echo Archive creating failed. Please, make sure that either sevenZipExec path variable is defined or 7z.exe is available to call from command line. The process will be aborted.
echo:
call :deleteTempFiles
pause
exit
:deleteTempFiles
echo Deleting temporarily created zip files...
if exist itextsharp-dll-core.zip (
del itextsharp-dll-core.zip
)
if exist itextsharp-dll-core-wo_Drawing.zip (
del itextsharp-dll-core-wo_Drawing.zip
)
if exist itextsharp-dll-pdfa.zip (
del itextsharp-dll-pdfa.zip
)
if exist itextsharp-dll-xtra.zip (
del itextsharp-dll-xtra.zip
)
if exist itextsharp-src-core.zip (
del itextsharp-src-core.zip
)
if exist itextsharp-src-pdfa.zip (
del itextsharp-src-pdfa.zip
)
if exist itextsharp-src-xtra.zip (
del itextsharp-src-xtra.zip
)
if exist itextsharp-src-xmlworker.zip (
del itextsharp-src-xmlworker.zip
)
if exist itextsharp-dll-xmlworker.zip (
del itextsharp-dll-xmlworker.zip
)
exit /b