This repository has been archived by the owner on Sep 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.bat
95 lines (90 loc) · 2.2 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
::
:: Copyright: 2017-2019 sel-project
:: License: MIT
::
@echo off
set compiler=dmd
set build=debug
set arch=
set config=default
set plugins=
set portable=
:loop
if "%1"=="" (
goto build
) else if "%1" == "-h" (
goto help
) else if "%1" == "--help" (
goto help
) else if "%1" == "--dmd" (
set compiler=dmd
) else if "%1" == "--ldc" (
set compiler=ldc2
) else if "%1" == "-c" (
set compiler=%2
shift
) else if "%1" == "debug" (
set build=debug
) else if "%1" == "release" (
set build=release
) else if "%1" == "-a" (
set arch=%2
shift
) else if "%1" == "default" (
set config=default
) else if "%1" == "classic" (
set config=default
) else if "%1" == "hub" (
set config=hub
) else if "%1" == "node" (
set config=node
) else if "%1" == "--no-plugins" (
set plugins=--no-plugins
) else if "%1" == "-np" (
set plugins=--no-plugins
) else if "%1" == "--portable" (
set portable=--portable
) else if "%1" == "--clean" (
del dub.selections.json
del builder\dub.selections.json
del builder\init\dub.selections.json
)
shift
goto loop
:build
if "%arch%" == "" (
if /I "%processor_architecture%" == "amd64" (
set arch=x86_64
) else if /I "%processor_architecture%" == "x86_64" (
set arch=x86_64
) else (
set arch=x86
)
)
if "%arch%" == "x86" (
if "%compiler%" == "dmd" (
set arch=x86_mscoff
)
)
cd builder\init
dub run --compiler=%compiler% --build=%build% --arch=%arch% -- %config% %plugins% %portable%
if %errorlevel% neq 0 (
cd ..\..
exit /b %errorlevel%
)
cd ..
dub build --compiler=%compiler% --build=%build% --arch=%arch%
cd ..
goto :eof
:help
echo Usage: build.bat [-h] [--dmd^|--ldc^|-c COMPILER] [debug^|release] [-a ARCH] [default^|hub^|node] [-np] [--clean]
echo(
echo Optional aguments:
echo -h, --help Show this message and exit
echo --dmd, --ldc Compile using the DMD or LDC compiler
echo -c COMPILER Compile using the spcified compiler
echo debug, release Compile using DUB's debug or release mode
echo -a ARCH Specify the architecture to build for
echo default, hub, node Compile the specified configuration for Selery
echo -np, --no-plugins Compile without plugins
echo --clean Remove dub.selections.json files