File: build.cmd

package info (click to toggle)
log4net 1.2.10%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 16,720 kB
  • ctags: 3,590
  • sloc: cs: 25,174; xml: 8,133; cpp: 91; makefile: 57; ansic: 7
file content (111 lines) | stat: -rw-r--r-- 2,833 bytes parent folder | download | duplicates (6)
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
@ECHO OFF

REM We are going to change the environment variables, so protect the current settings.
SETLOCAL ENABLEDELAYEDEXPANSION

IF "%1"=="-?" GOTO CommandLineOptions

REM Figure out the path to the log4net directory
CALL :ComputeBase %~f0
SET LOG4NET_DIR=%RESULT%
ECHO LOG4NET_DIR is %LOG4NET_DIR%

REM Get path to NAnt.exe

REM Try and determine if NAnt is in the PATH
SET NANTEXE_PATH=nant.exe
"%NANTEXE_PATH%" -help >NUL: 2>NUL:
IF NOT ERRORLEVEL 1 goto FoundNAnt

REM Try hard coded path for NAnt
SET NANTEXE_PATH=C:\Program Files\NAnt\nant-0.85-nightly-2006-03-06\bin\nant.exe
"%NANTEXE_PATH%" -help >NUL: 2>NUL:
IF NOT ERRORLEVEL 1 goto FoundNAnt

REM We have not found NAnt
ECHO.
ECHO NAnt does not appear to be installed. NAnt.exe failed to execute.
ECHO Please ensure NAnt is installed and can be found in the PATH.
GOTO EndError


:FoundNAnt
ECHO NANTEXE_PATH is %NANTEXE_PATH%

REM Setup the build file
IF EXIST nant.build (
	SET BUILD_FILE=nant.build
) ELSE (
	SET BUILD_FILE=%LOG4NET_DIR%\log4net.build
)

ECHO BUILD_FILE is %BUILD_FILE%


IF "%1"=="package" GOTO Package

"%NANTEXE_PATH%" "-buildfile:%BUILD_FILE%" %1 %2 %3 %4 %5 %6 %7 %8
GOTO EndOk

:Package
IF "%2"=="" GOTO NoProjectVersion

"%NANTEXE_PATH%" "-buildfile:%BUILD_FILE%" package "-D:package.version=%2" %3 %4 %5 %6 %7 %8
GOTO EndOk

:NoProjectVersion
ECHO.
ECHO SYNTAX ERROR: Missing Version String.
ECHO Please specify the version number of log4net that you want to package.
GOTO CommandLineOptions

:CommandLineOptions
ECHO.
ECHO Use the following command line syntax:
ECHO.
ECHO     build.cmd -?
ECHO     build.cmd -projecthelp
ECHO     build.cmd [nant target]
ECHO     build.cmd package [version string]
ECHO.
ECHO To get a list of all NAnt build targets run build.cmd with the -projecthelp option.
ECHO If no NAnt target is specified then the default target is 'compile-all'. This will compile all configurations on all available frameworks.
ECHO When using the 'package' command the version label for the package must be specified.
ECHO.
ECHO     Examples:
ECHO.
ECHO     build.cmd compile-mono-1.0
ECHO     build.cmd compile-all
ECHO     build.cmd package 1.3.0
ECHO     build.cmd package 2.1.0-alpha
ECHO.
GOTO EndError


REM ------------------------------------------
REM Expand a string to a full path
REM ------------------------------------------
:FullPath
SET RESULT=%~f1
GOTO :EOF

REM ------------------------------------------
REM Compute the current directory
REM given a path to this batch script.
REM ------------------------------------------
:ComputeBase
SET RESULT=%~dp1
REM Remove the trailing \
SET RESULT=%RESULT:~0,-1%
CALL :FullPath %RESULT%
GOTO :EOF


:EndOk
ENDLOCAL
EXIT /B 0

:EndError
ENDLOCAL
EXIT /B 1