From 0929b399efc00df1ecaa9806011c0feb628566ec Mon Sep 17 00:00:00 2001 From: KeeganForelight Date: Mon, 23 Jan 2023 14:54:30 -0500 Subject: [PATCH] task based building --- .task/checksum/go-build | 1 + Taskfile.dist.yml | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .task/checksum/go-build create mode 100644 Taskfile.dist.yml diff --git a/.task/checksum/go-build b/.task/checksum/go-build new file mode 100644 index 0000000..d41f16a --- /dev/null +++ b/.task/checksum/go-build @@ -0,0 +1 @@ +d7788877e33ce296459440d6cd0fdbd5 diff --git a/Taskfile.dist.yml b/Taskfile.dist.yml new file mode 100644 index 0000000..3d1a766 --- /dev/null +++ b/Taskfile.dist.yml @@ -0,0 +1,46 @@ +version: '3' + +tasks: + clean: + desc: "clean all of the old binaries" + cmds: + - rm -v bin/* 2>/dev/null + + all: + desc: "cleans and builds all" + deps: [clean, bb, server] + + bb: + desc: "Builds and sends to the beaglebone" + cmds: + - task: go-build + vars: + GOARM: 7 + GOARCH: "arm" + GOOS: "linux" + BUILD_DIR: "reactor" + - scp bin/{{.BUILD_DIR}}_{{.GOOS}}_{{.GOARCH}} debian:~/ + + server: + desc: "Builds server binary" + cmds: + - task: go-build + vars: + BUILD_DIR: "server" + GOOS: "{{OS}}" + GOARCH: "{{ARCH}}" + + go-build: + internal: true + cmds: + - go build -o bin/{{.BUILD_DIR}}_{{.GOOS}}_{{.GOARCH}} cmd/{{.BUILD_DIR}}/main.go + sources: + - internal/pkg/**/*.go + - cmd/{{.BUILD_DIR}}/main.go + generates: + - bin/{{.BUILD_DIR}}_{{.GOOS}}_{{.GOARCH}} + env: + GOARM: "{{.GOARM}}" + GOARCH: "{{.GOARCH}}" + GOOS: "{{.GOOS}}" +