forked from maartenba/MvcSiteMapProvider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.bat
77 lines (68 loc) · 1.96 KB
/
Build.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@echo off
GOTO endcommentblock
:: -----------------------------------------------------------------------------------
:: This file will build the MvcSiteMapProvider and package the Nuget builds.
::
:: Syntax:
:: build[.bat] [<options>]
::
:: Available Options:
::
:: -Version:<Version>
:: -v:<Version> - Assembly version number. Default is 4.0.0.
::
:: -PackageVersion:<PackageVersion>
:: -pv:<PackageVersion> - Nuget package version. Default is version's value.
::
:: -Configuration:<Configuration>
:: -config:<Configuration> - MSBuild configuration for the build.
::
:: All options are case insensitive.
::
:: To escape any of the options, put double quotes around the entire value, like this:
:: "-config:Release"
::
:: -----------------------------------------------------------------------------------
:endcommentblock
setlocal enabledelayedexpansion enableextensions
REM Default values
IF "%version%" == "" (
set version=4.0.0
)
IF "%PackageVersion%" == "" (
set PackageVersion=%version%
)
set configuration=Release
IF NOT "%config%" == "" (
set configuration=%config%
)
FOR %%a IN (%*) DO (
FOR /f "useback tokens=*" %%a in ('%%a') do (
set value=%%~a
set test=!value:~0,3!
IF /I !test! EQU -v: (
set version=!value:~3!
)
set test=!value:~0,9!
IF /I !test! EQU -version: (
set version=!value:~9!
)
set test=!value:~0,4!
IF /I !test!==-pv: (
set packageversion=!value:~4!
)
set test=!value:~0,16!
IF /I !test!==-packageversion: (
set packageversion=!value:~16!
)
set test=!value:~0,8!
IF /I !test!==-config: (
set configuration=!value:~8!
)
set test=!value:~0,15!
IF /I !test!==-configuration: (
set configuration=!value:~15!
)
)
)
powershell -Command "& { Import-Module .\build\psake.psm1; $psake.use_exit_on_error = $true; Invoke-psake .\build\runbuild.ps1 -framework 4.0x64 -properties @{\"version\"=\"%version%\";\"configuration\"=\"%configuration%"\";\"packageVersion\"=\"%PackageVersion%"\"} }"