Skip to content

Commit

Permalink
Use different license header based on distribution (CE/EE) (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-vanyasin authored Sep 28, 2023
1 parent f54fbe7 commit 63f8c04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ deps/
**/*.enterprise.go
**/enterprise/**
enterprise.mk
license-header.enterprise.txt
local/
tools/codegen/boilerplate.go.txt
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ EXCLUDE_FILES := *generated.deepcopy.go
SOURCES_QUERY := find ./ -type f -name '*.go' ! -name '*.pb.go' $(foreach EXCLUDE_DIR,$(EXCLUDE_DIRS), ! -path "*/$(EXCLUDE_DIR)/*") $(foreach EXCLUDE_FILE,$(EXCLUDE_FILES), ! -path "*/$(EXCLUDE_FILE)")
SOURCES := $(shell $(SOURCES_QUERY))

NON_EE_SOURCES_QUERY := $(SOURCES_QUERY) ! -name '*.enterprise.go'
NON_EE_SOURCES := $(shell $(NON_EE_SOURCES_QUERY))

YAML_EXCLUDE_DIRS := vendor .gobuild deps tools pkg/generated/clientset pkg/generated/informers pkg/generated/listers chart/kube-arangodb/templates chart/kube-arangodb-crd/templates chart/arangodb-ingress-proxy/templates
YAML_EXCLUDE_FILES :=
YAML_QUERY := find ./ -type f -name '*.yaml' $(foreach EXCLUDE_DIR,$(YAML_EXCLUDE_DIRS), ! -path "*/$(EXCLUDE_DIR)/*") $(foreach EXCLUDE_FILE,$(YAML_EXCLUDE_FILES), ! -path "*/$(EXCLUDE_FILE)")
Expand Down Expand Up @@ -246,7 +249,7 @@ allall: all
.PHONY: license-verify
license-verify:
@echo ">> Verify license of files"
@$(GOPATH)/bin/addlicense -f "./tools/codegen/license-header.txt" -check $(SOURCES) $(PROTOSOURCES)
@$(GOPATH)/bin/addlicense -f "./tools/codegen/license-header.txt" -check $(NON_EE_SOURCES) $(PROTOSOURCES)

.PHONY: license-range-verify
license-range-verify:
Expand All @@ -271,7 +274,7 @@ yamlfmt:
.PHONY: license
license:
@echo ">> Ensuring license of files"
@$(GOPATH)/bin/addlicense -f "./tools/codegen/license-header.txt" $(SOURCES) $(PROTOSOURCES)
@$(GOPATH)/bin/addlicense -f "./tools/codegen/license-header.txt" $(NON_EE_SOURCES) $(PROTOSOURCES)

.PHONY: fmt-verify
fmt-verify: license-verify
Expand Down

0 comments on commit 63f8c04

Please sign in to comment.