From fd67a9b8bf364ceecfba250dc6136045891c18bb Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 4 Sep 2023 21:03:39 +0200 Subject: [PATCH] Improve Taskfile Adds dependencies and sources to Taskfile. Signed-off-by: phoenix --- .gitignore | 5 ++++- Taskfile.yml | 24 +++++++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index c37392f..0322d8c 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,10 @@ *.out # Dependency directories (remove the comment below to include it) -# vendor/ +vendor/ + +# Task files +.task # Go workspace file go.work diff --git a/Taskfile.yml b/Taskfile.yml index c6485dc..16b15ee 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -2,17 +2,31 @@ version: '3' -vars: - GREETING: Hello, World! - tasks: default: cmds: - go build -o weblug cmd/weblug/*.go -# silent: true + silent: false + aliases: [weblug] + generates: + - weblug + sources: + - cmd/weblug/*.go static: cmds: - - CGO_ENABLED=0 go build -ldflags="-w -s" -o weblug cmd/weblug/*.go + - go build -ldflags="-w -s" -o weblug cmd/weblug/*.go + env: + CGO_ENABLED: '0' + silent: false + aliases: [weblug-static] + generates: + - weblug + sources: + - cmd/weblug/*.go test: + deps: [weblug] + # Ensure a weblug binary is present + preconditions: + - test -f weblug cmds: - sudo bash -c "cd test && ./blackbox.sh"