From 8a8524a02918393ef0b499c6c2981157f79a31fb Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 27 Jan 2026 19:14:27 +0000 Subject: [PATCH] add taskfile --- Taskfile.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Taskfile.yml diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..4252926 --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,54 @@ +version: '3' + +vars: + PROGRAM: exclude + SHELL: '{{if eq .OS "Windows_NT"}}powershell{{end}}' + BIN_DIR: bin + VERSION: + sh: 'git describe --tags $(git rev-list --tags --max-count=1)' + +tasks: + default: + desc: Build the exclude project + cmds: + - task: build + + build: + desc: Build the exclude project + deps: [vet] + cmds: + - task: build-windows + - task: build-linux + + vet: + desc: Vet the code + deps: [fmt] + cmds: + - go vet ./... + + fmt: + desc: Fmt the code + cmds: + - go fmt ./... + + build-windows: + desc: Build the exclude project for Windows + cmds: + - GOOS=windows GOARCH=amd64 go build -o {{.BIN_DIR}}/{{.PROGRAM}}_windows_amd64.exe -ldflags="-X main.version={{.VERSION}}" + internal: true + + build-linux: + desc: Build the exclude project for Linux + cmds: + - GOOS=linux GOARCH=amd64 go build -o {{.BIN_DIR}}/{{.PROGRAM}}_linux_amd64 -ldflags="-X main.version={{.VERSION}}" + internal: true + + test: + desc: Run tests + cmds: + - go test ./... + + clean: + desc: Clean the build artifacts + cmds: + - '{{.SHELL}} rm -r {{.BIN_DIR}}' \ No newline at end of file