forked from apache/logging-log4net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cmd
executable file
·131 lines (106 loc) · 3.58 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
rem
rem
rem Licensed to the Apache Software Foundation (ASF) under one
rem or more contributor license agreements. See the NOTICE file
rem distributed with this work for additional information
rem regarding copyright ownership. The ASF licenses this file
rem to you under the Apache License, Version 2.0 (the
rem "License"); you may not use this file except in compliance
rem with the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing,
rem software distributed under the License is distributed on an
rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
rem KIND, either express or implied. See the License for the
rem specific language governing permissions and limitations
rem under the License.
rem
rem
@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\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