-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
build.bat
72 lines (65 loc) · 1.85 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
@echo off
GOTO endcommentblock
:: -----------------------------------------------------------------------------------
:: This file will build jquery.dirtyforms and package the distribution using Nuget and NPM.
::
:: Syntax:
:: build[.bat] [<options>]
::
:: Available Options:
::
:: -Version:<Version>
:: -v:<Version> - Version number. Default is empty (which means to use the version from the package.json file).
:: If not supplied, a build and NuGet pack is performed rather than a full release.
::
:: -Debug:<Version>
:: -d:<Version> - Debug Mode. Default is true.
:: If true, the local repository is updated, but push to the remote repository are done with
:: the --dry-run switch, so the remote repository is not actually changed.
::
:: All options are case insensitive.
::
:: To escape any of the options, put double quotes around the entire value, like this:
:: "-debug:false"
::
:: -----------------------------------------------------------------------------------
:endcommentblock
setlocal enabledelayedexpansion enableextensions
REM Default values
set version=
set debug=true
IF NOT "%PackageVersion%" == "" (
set version=%PackageVersion%
echo PackageVersion: %PackageVersion%
)
IF NOT "%DebugMode%" == "" (
set debug=%DebugMode%
echo DebugMode: %DebugMode%
)
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,3!
IF /I !test! EQU -d: (
set debug=!value:~3!
)
set test=!value:~0,7!
IF /I !test! EQU -debug: (
set debug=!value:~7!
)
)
)
call npm install
IF "version" == "" (
call node_modules\.bin\gulp
) ELSE (
call node_modules\.bin\gulp release --version=%version% --debug=%debug%
)