-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.bat
76 lines (64 loc) · 1.97 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
:: Batch file to build the following program variants:
::
:: - Windows
:: - Windows with all features (TLS and plugins)
:: - Linux
:: - Linux with all features (TLS and plugins)
:: - PHP plugin for Windows
:: - PHP plugin for Linux
:: - Hot Reload plugin for Windows
:: - Hot Reload plugin for Linux
::
:: Requires Rust to be installed both normally and in WSL.
@echo off
echo Setting up Humphrey build...
echo Building for Windows...
cargo build --release -q
robocopy target/release dist humphrey.exe > nul
cd dist
rename humphrey.exe humphrey_windows.exe
cd ..
echo Building for Linux..
wsl $HOME/.cargo/bin/cargo build --release -q
robocopy target/release dist humphrey > nul
cd dist
rename humphrey humphrey_linux
cd ..
echo Building for Windows (with all features)...
cargo build --release -q --all-features
robocopy target/release dist humphrey.exe > nul
cd dist
rename humphrey.exe humphrey_windows_all_features.exe
cd ..
echo Building for Linux (with all features)...
wsl $HOME/.cargo/bin/cargo build --release -q --all-features
robocopy target/release dist humphrey > nul
cd dist
rename humphrey humphrey_linux_all_features
cd ..
echo Building PHP plugin for Windows...
cd plugins/php
cargo build --release -q
robocopy target/release ../../dist php.dll > nul
cd ../../dist
rename php.dll php_plugin_windows.dll
echo Building PHP plugin for Linux...
cd ../plugins/php
wsl $HOME/.cargo/bin/cargo build --release -q
robocopy target/release ../../dist libphp.so > nul
cd ../../dist
rename libphp.so php_plugin_linux.so
echo Building Hot Reload plugin for Windows...
cd ../plugins/hot-reload
cargo build --release -q
robocopy target/release ../../dist hot_reload.dll > nul
cd ../../dist
rename hot_reload.dll hot_reload_plugin_windows.dll
echo Building Hot Reload plugin for Linux...
cd ../plugins/hot-reload
wsl $HOME/.cargo/bin/cargo build --release -q
robocopy target/release ../../dist libhot_reload.so > nul
cd ../../dist
rename libhot_reload.so hot_reload_plugin_linux.so
cd ..
echo Build complete.