forked from charlesw/tesseract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.bat
58 lines (49 loc) · 1.45 KB
/
clean.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
goto DefineLogFiles
:DefineLogFiles
set TemporaryLog=clean.Log
set SuccessLog=Success.%TemporaryLog%
set ErrorLog=Error.%TemporaryLog%
goto RemoveLogs
:RemoveLogs
if exist %TemporaryLog% del %TemporaryLog%
if exist %SuccessLog% del %SuccessLog%
if exist %ErrorLog% del %ErrorLog%
goto FindMSBuild
:FindMSBuild
echo searching for .net framework
set Framework=%WINDIR%\Microsoft.NET\Framework
rem set Framework64=%WINDIR%\Microsoft.NET\Framework64
rem f exist "%Framework64%" set Framework=%Framework64%
for /f %%f in ('dir /b /a:D "%Framework%" ^| findstr v[0-9]') do set DotNetFramework=%Framework%\%%f
if defined DotNetFramework goto RunBuildScript
goto DotNetNotFound
:DotNetNotFound
echo Could not locate .Net Framework. Please verify .Net Framework is installed.>%TemporaryLog%
echo .>%TemporaryLog%
set ERRORLEVEL=-1
goto BuildError
:RunBuildScript
@echo %DotNetFramework%\MSBuild.exe build.proj /target:Clean /fl /flp:LogFile=%TemporaryLog%
%DotNetFramework%\MSBuild.exe build.proj /target:Clean /fl /flp:LogFile=%TemporaryLog%
IF %ERRORLEVEL% NEQ 0 goto BuildError
goto BuildSuccess
:BuildSuccess
set MSBuildLog=%SuccessLog%
goto Report
:BuildError
set MSBuildLog=%ErrorLog%
goto Report
:Report
rename %TemporaryLog% %MSBuildLog%
echo.
echo --- Build Log saved as %MSBuildLog% ---
goto End
:End
set TemporaryLog=
set SuccessLog=
set ErrorLog=
set MSBuildLog=
set Framework=
rem set Framework64=
set DotNetFramework=