summaryrefslogtreecommitdiff
path: root/Taskfile.yaml
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-23 17:13:45 +0300
committerPaul Buetow <paul@buetow.org>2025-06-23 17:13:45 +0300
commit97e0151ba6a260195ced76ab69d3e3bd58ba68fc (patch)
treecf158f895aa353ba9a6308358f4c333924bcfa14 /Taskfile.yaml
Initial gitsyncer implementation with version support
- Initialize Go module for github.com/paul/gitsyncer - Add version package with version info (v0.1.0) - Implement main.go with --version flag support - Create comprehensive Taskfile.yaml for build automation - Add CLAUDE.md with project documentation The binary can be built with 'task' or 'go build -o gitsyncer ./cmd/gitsyncer' 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'Taskfile.yaml')
-rw-r--r--Taskfile.yaml94
1 files changed, 94 insertions, 0 deletions
diff --git a/Taskfile.yaml b/Taskfile.yaml
new file mode 100644
index 0000000..94a968b
--- /dev/null
+++ b/Taskfile.yaml
@@ -0,0 +1,94 @@
+version: '3'
+
+vars:
+ BINARY_NAME: gitsyncer
+ BUILD_DIR: .
+ CMD_PATH: ./cmd/gitsyncer
+ LDFLAGS: -s -w
+
+tasks:
+ default:
+ desc: Build the gitsyncer binary
+ cmds:
+ - go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.CMD_PATH}}
+
+ build:
+ desc: Build the gitsyncer binary
+ cmds:
+ - go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.CMD_PATH}}
+
+ build-all:
+ desc: Build for all supported platforms
+ cmds:
+ - task: build-linux
+ - task: build-darwin
+ - task: build-windows
+
+ build-linux:
+ desc: Build for Linux
+ cmds:
+ - GOOS=linux GOARCH=amd64 go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}}-linux-amd64 {{.CMD_PATH}}
+
+ build-darwin:
+ desc: Build for macOS
+ cmds:
+ - GOOS=darwin GOARCH=amd64 go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}}-darwin-amd64 {{.CMD_PATH}}
+ - GOOS=darwin GOARCH=arm64 go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}}-darwin-arm64 {{.CMD_PATH}}
+
+ build-windows:
+ desc: Build for Windows
+ cmds:
+ - GOOS=windows GOARCH=amd64 go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}}-windows-amd64.exe {{.CMD_PATH}}
+
+ run:
+ desc: Build and run the gitsyncer binary
+ cmds:
+ - task: build
+ - ./{{.BINARY_NAME}}
+
+ test:
+ desc: Run tests
+ cmds:
+ - go test ./...
+
+ test-verbose:
+ desc: Run tests with verbose output
+ cmds:
+ - go test -v ./...
+
+ clean:
+ desc: Clean build artifacts
+ cmds:
+ - rm -f {{.BINARY_NAME}}
+ - rm -f {{.BINARY_NAME}}-*
+
+ mod-tidy:
+ desc: Tidy go modules
+ cmds:
+ - go mod tidy
+
+ fmt:
+ desc: Format Go code
+ cmds:
+ - go fmt ./...
+
+ vet:
+ desc: Run go vet
+ cmds:
+ - go vet ./...
+
+ lint:
+ desc: Run golangci-lint
+ cmds:
+ - golangci-lint run
+
+ install:
+ desc: Install gitsyncer to $GOPATH/bin
+ cmds:
+ - go install {{.CMD_PATH}}
+
+ version:
+ desc: Show version
+ deps: [build]
+ cmds:
+ - ./{{.BINARY_NAME}} --version \ No newline at end of file