forked from nmap/npcap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaskfile.yaml
102 lines (91 loc) · 2.77 KB
/
taskfile.yaml
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
96
97
98
99
100
101
102
# yaml-language-server: $schema=https://taskfile.dev/schema.json
# cspell:ignore taskfile,vcpkg,msbuild,makefiles,deinit
version: '3'
vars:
DEFAULT_CONFIG: Release
DEFAULT_PLATFORM: x64
DEFAULT_SOLUTION: packetWin7/vs14/npcap.sln
PLATFORMS: [x64]
CONFIGURATIONS:
- Debug
- Release
tasks:
default:
cmds:
- task: build
run:
deps: [msbuild]
vars:
TARGET_EXE: '{{ joinPath .TASKFILE_DIR "bin" .DEFAULT_CONFIG "npcap.exe" }}'
cmds:
- cmd: echo "Running the application."
- cmd: >-
cmd.exe /D /E:ON /C
"
echo Starting '{{ shellQuote .TARGET_EXE }}' &&
"{{ shellQuote .TARGET_EXE }}"
"
build-all-configurations:
aliases: [check, lint, ci]
silent: true
cmds:
- for: { var: CONFIGURATIONS }
task: build-all-platforms
vars: { CONFIG: '{{ .ITEM }}' }
build-all-platforms:
silent: true
cmds:
- for: { var: PLATFORMS }
task: msbuild
vars: { PLATFORM: '{{ .ITEM }}', CONFIG: '{{ .CONFIG }}' }
msbuild:
aliases: [build, b]
silent: true
vars:
MSBUILD:
sh: | # shell
strings=("Preview" "Enterprise" "Professional" "Community")
for str in "${strings[@]}"
do
result="C:/Program Files/Microsoft Visual Studio/2022/${str}/MSBuild/Current/Bin/amd64/MSBuild.exe"
if [ -e "$result" ]; then
echo "$result"
break
fi
done
MSBUILD_CONFIG: '{{ .CONFIG | default .DEFAULT_CONFIG }}'
MSBUILD_SOLUTION: '{{ joinPath .TASKFILE_DIR (.SOLUTION | default .DEFAULT_SOLUTION) }}'
MSBUILD_PLATFORM: '{{ .PLATFORM | default .DEFAULT_PLATFORM }}'
cmds:
- cmd: echo "Building '{{ .MSBUILD_SOLUTION }}' with '{{ .MSBUILD_CONFIG }}' configuration."
- cmd: >-
"{{fromSlash .MSBUILD}}"
/m
/t:Build
/p:Configuration="{{.MSBUILD_CONFIG}}"
/p:Platform="{{.MSBUILD_PLATFORM}}"
"{{fromSlash .MSBUILD_SOLUTION}}"
cmake-clang:
aliases: [clang]
cmds:
- task: cmake-build
vars: { CMAKE_PRESET: 'x64-windows-clang' }
cmake-check:
cmds:
- task: cmake-build
pre-commit:
cmds:
- git add --renormalize .
- git reset --mixed
- task revert-whitespace
cmake-build:
internal: true
vars:
CM_BUILD_CMAKE_PRESET: '{{ .CMAKE_PRESET | default "x64-windows" }}'
cmds:
- cmd: cmake --preset "{{ .CM_BUILD_CMAKE_PRESET }}"
- cmd: cmake --build --preset "{{ .CM_BUILD_CMAKE_PRESET }}"
- cmd: cmake --build --preset "{{ .CM_BUILD_CMAKE_PRESET }}" --target install
revert-whitespace:
cmds:
- cmd: git diff -U0 -w --no-color | git apply --cached --ignore-whitespace --unidiff-zero -