- Imported packages from separate repos: - github.com/Snider/config -> pkg/config - github.com/Snider/display -> pkg/display - github.com/Snider/help -> pkg/help - github.com/Snider/i18n -> pkg/i18n - github.com/Snider/updater -> pkg/updater - Moved core code from root to pkg/core - Flattened nested package structures - Updated all import paths to github.com/Snider/Core/pkg/* - Added Display interface to Core - Updated go.work for workspace modules Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
40 lines
1 KiB
Makefile
40 lines
1 KiB
Makefile
.PHONY: build dev release-local test coverage
|
|
|
|
BINARY_NAME=updater
|
|
CMD_PATH=./cmd/updater
|
|
|
|
# Default LDFLAGS to empty
|
|
LDFLAGS = ""
|
|
|
|
# If VERSION is set, override LDFLAGS
|
|
ifdef VERSION
|
|
LDFLAGS = -ldflags "-X 'github.com/snider/updater.Version=$(VERSION)'"
|
|
endif
|
|
|
|
.PHONY: generate
|
|
generate:
|
|
@echo "Generating code..."
|
|
@go generate ./...
|
|
|
|
build: generate
|
|
@echo "Building $(BINARY_NAME)..."
|
|
@cd $(CMD_PATH) && go build $(LDFLAGS)
|
|
|
|
dev: build
|
|
@echo "Running $(BINARY_NAME)..."
|
|
@$(CMD_PATH)/$(BINARY_NAME) --check-update
|
|
|
|
release-local:
|
|
@echo "Running local release with GoReleaser..."
|
|
@~/go/bin/goreleaser release --snapshot --clean
|
|
|
|
test:
|
|
@echo "Running tests..."
|
|
@go test ./...
|
|
|
|
coverage:
|
|
@echo "Generating code coverage report..."
|
|
@go test -coverprofile=coverage.out ./...
|
|
@echo "Coverage report generated: coverage.out"
|
|
@echo "To view in browser: go tool cover -html=coverage.out"
|
|
@echo "To upload to Codecov, ensure you have the Codecov CLI installed (e.g., 'go install github.com/codecov/codecov-cli@latest') and run: codecov -f coverage.out"
|