Files
micro--go-micro/cmd/micro/cli/new/template/makefile.go
T
wehub-resource-sync e071084ebe
govulncheck / govulncheck (push) Has been cancelled
Lint / golangci-lint (push) Has been cancelled
Run Tests / Unit Tests (push) Has been cancelled
Run Tests / Etcd Integration Tests (push) Has been cancelled
Harness (E2E) / Harnesses (mock LLM) (push) Has been cancelled
Harness (E2E) / Provider harnesses (live LLM conformance) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:40:33 +08:00

120 lines
2.0 KiB
Go

package template
// MakefileNoProto is the default Makefile: no proto target, nothing to
// generate, so the service builds and runs with no protoc toolchain.
var MakefileNoProto = `.PHONY: build run dev test test-coverage clean docker lint fmt deps
# Build the service
build:
go build -o bin/{{.Alias}} .
# Run the service
run:
go run .
# Run with hot reload (requires air: go install github.com/air-verse/air@latest)
dev:
air
# Run tests
test:
go test -v ./...
# Run tests with coverage
test-coverage:
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# List MCP tools exposed by this service
mcp-tools:
micro mcp list
# Start MCP server for Claude Code
mcp-serve:
micro mcp serve
# Clean build artifacts
clean:
rm -rf bin/ coverage.out coverage.html
# Build Docker image
docker:
docker build -t {{.Alias}}:latest .
# Lint code
lint:
golangci-lint run ./...
# Format code
fmt:
go fmt ./...
goimports -w .
# Update dependencies
deps:
go mod tidy
go mod download
`
var Makefile = `.PHONY: proto build run test clean docker
# Generate protobuf files
proto:
protoc --proto_path=. --micro_out=. --go_out=. proto/*.proto
# Build the service
build:
go build -o bin/{{.Alias}} .
# Run the service
run:
go run .
# Run with hot reload (requires air: go install github.com/air-verse/air@latest)
dev:
air
# Run tests
test:
go test -v ./...
# Run tests with coverage
test-coverage:
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# List MCP tools exposed by this service
mcp-tools:
micro mcp list
# Test an MCP tool interactively
mcp-test:
micro mcp test
# Start MCP server for Claude Code
mcp-serve:
micro mcp serve
# Clean build artifacts
clean:
rm -rf bin/ coverage.out coverage.html
# Build Docker image
docker:
docker build -t {{.Alias}}:latest .
# Lint code
lint:
golangci-lint run ./...
# Format code
fmt:
go fmt ./...
goimports -w .
# Update dependencies
deps:
go mod tidy
go mod download
`