forked from MolotovCherry/virtual-display-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
64 lines (55 loc) · 1.73 KB
/
Makefile.toml
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
[env]
BUILD_TARGET_PATH = { script = ['''
for /f "tokens=*" %%a in ('cargo target-dir') do set target_dir=%%a
echo %target_dir%
'''] }
PROFILE = "-p dev"
[env.prod]
PROD = "1"
PROFILE = "-p prod"
BUILD_FLAGS = "--release"
[tasks.build]
clear = true
script = [
# build virtual-display-driver
"cargo make %PROFILE% --cwd virtual-display-driver build",
# copy all files to single output directory
"cargo make %PROFILE% --cwd virtual-display-driver copy",
# build cli
"cargo build -p virtual-display-driver-cli %BUILD_FLAGS%",
# copy all files to single output directory
"cargo make %PROFILE% --cwd virtual-display-driver-cli copy",
]
[tasks.build-installer]
dependencies = ["build"]
script = [
'''
if defined RELEASE_VERSION (
set release=-i %RELEASE_VERSION%
)
if not defined PROD (
set mode=-d -D
)
del /S /Q /F target\output\*.msi
cargo wix -p virtual-display-driver %release% %mode% --nocapture -I installer/main.wxs -o target\output -C -ext -C WixDifxAppExtension -L -ext -L WixDifxAppExtension -L "C:\Program Files (x86)\WiX Toolset v3.11\bin\difxapp_x64.wixlib"
''',
# load env
'''
if defined CI (
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
) else (
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat"
)
''',
# sign installer
'''
if defined CI (
set sign_options=/f private.pfx /p %PRIVATE_KEY_PASSWORD%
) else (
set sign_options=/sm /n DriverCertificate
)
signtool sign /a /fd SHA256 /v %sign_options% /t http://timestamp.digicert.com target/output/*.msi
''',
]
[config]
default_to_workspace = false