| 
1 |  | -.PHONY: build build-dev build-linux build-linux-arm64 clean docs docs-cli docs-local docs-nav install lint local-down local-up test uninstall validate-registry  | 
 | 1 | +.PHONY: build build-dev build-linux build-linux-arm64 clean docs docs-cli docs-local docs-nav install lint local-down local-up test uninstall validate-registry check-licenses check-notice notice  | 
2 | 2 | 
 
  | 
3 | 3 | MODULE_PATH := github.com/mozilla-ai/mcpd/v2  | 
4 | 4 | 
 
  | 
@@ -29,7 +29,40 @@ LDFLAGS := -s -w -X '$(MODULE_PATH)/internal/cmd.version=$(VERSION)' \  | 
29 | 29 | # Build flags for optimization  | 
30 | 30 | BUILDFLAGS := -trimpath  | 
31 | 31 | 
 
  | 
32 |  | -lint:  | 
 | 32 | +# The license types allowed to be imported by the project  | 
 | 33 | +ALLOWED_LICENSES := Apache-2.0,MIT,BSD-2-Clause,BSD-3-Clause,ZeroBSD,Unlicense  | 
 | 34 | + | 
 | 35 | +check-licenses:  | 
 | 36 | +	@echo "Checking licenses..."  | 
 | 37 | +	@go install github.com/google/go-licenses/v2@latest  | 
 | 38 | +	@set -e; \  | 
 | 39 | +	if go-licenses check ./... --ignore github.com/mozilla-ai/mcpd/v2 --allowed_licenses=$(ALLOWED_LICENSES); then \  | 
 | 40 | +		echo "✓ All licenses are allowed."; \  | 
 | 41 | +	else \  | 
 | 42 | +		echo "License check failed: some dependencies have disallowed licenses."; \  | 
 | 43 | +		exit 1; \  | 
 | 44 | +	fi  | 
 | 45 | + | 
 | 46 | +check-notice:  | 
 | 47 | +	@echo "Checking NOTICE..."  | 
 | 48 | +	@go install github.com/google/go-licenses/v2@latest  | 
 | 49 | +	@tmp=$$(mktemp); \  | 
 | 50 | +	trap "rm -f $$tmp" EXIT; \  | 
 | 51 | +	go-licenses report ./... --ignore github.com/mozilla-ai/mcpd/v2 --template build/licenses/notice.tpl > $$tmp; \  | 
 | 52 | +	if ! cmp -s NOTICE $$tmp; then \  | 
 | 53 | +		echo "NOTICE is out of date. Regenerate it with 'make notice'"; \  | 
 | 54 | +		exit 1; \  | 
 | 55 | +	else \  | 
 | 56 | +		echo "✓ NOTICE is up to date"; \  | 
 | 57 | +	fi  | 
 | 58 | + | 
 | 59 | +notice:  | 
 | 60 | +	@echo "Generating NOTICE..."  | 
 | 61 | +	@go install github.com/google/go-licenses/v2@latest  | 
 | 62 | +	@go-licenses report ./... --ignore github.com/mozilla-ai/mcpd/v2 --template build/licenses/notice.tpl > NOTICE  | 
 | 63 | +	@echo "✓ NOTICE generated"  | 
 | 64 | + | 
 | 65 | +lint: check-notice  | 
33 | 66 | 	golangci-lint run --fix -v  | 
34 | 67 | 
 
  | 
35 | 68 | test: lint  | 
 | 
0 commit comments