aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Taskfile.yml37
-rw-r--r--flake.nix1
2 files changed, 38 insertions, 0 deletions
diff --git a/Taskfile.yml b/Taskfile.yml
new file mode 100644
index 0000000..82921bc
--- /dev/null
+++ b/Taskfile.yml
@@ -0,0 +1,37 @@
+version: "3"
+
+tasks:
+ generate:
+ desc: "Generate protobuf code"
+ cmds:
+ - protoc --go_out=internal/weather/pb --go_opt=paths=source_relative protos/weather.proto
+
+ build:
+ desc: "Build all binaries"
+ cmds:
+ - task: generate
+ - go build -o bin/publisher ./cmd/publisher
+ - go build -o bin/subscriber ./cmd/subscriber
+
+ run-publisher:
+ desc: "Run publisher with auto-generation"
+ cmds:
+ - task: generate
+ - go run ./cmd/publisher
+
+ run-subscriber:
+ desc: "Run subscriber with auto-generation"
+ cmds:
+ - task: generate
+ - go run ./cmd/subscriber
+
+ watch:
+ desc: "Watch and rebuild on changes"
+ cmds:
+ - task: generate
+ sources:
+ - "**/*.go"
+ - "**/*.proto"
+ generates:
+ - "internal/weather/pb/*.go"
+ method: timestamp
diff --git a/flake.nix b/flake.nix
index b5a4442..df03a15 100644
--- a/flake.nix
+++ b/flake.nix
@@ -24,6 +24,7 @@
default = pkgs.mkShell {
buildInputs = with pkgs; [
go
+ go-task
golint
gopls
];