-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Makefile and support generating bazel files to allow overriding the dependency in CRDB.
- Loading branch information
1 parent
0c0dc30
commit ae293ba
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,6 @@ go.work.sum | |
|
||
.idea/ | ||
|
||
# Bazel files, generated with 'make gen-bazel'. | ||
/WORKSPACE | ||
BUILD.bazel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
GO := go | ||
PKG := ./... | ||
GOFLAGS := | ||
STRESSFLAGS := | ||
TAGS := crlib_invariants | ||
TESTS := . | ||
|
||
.PHONY: gen-bazel | ||
gen-bazel: | ||
@echo "Generating WORKSPACE" | ||
@echo 'workspace(name = "com_github_cockroachdb_crlib")' > WORKSPACE | ||
@echo 'Running gazelle...' | ||
${GO} run github.com/bazelbuild/bazel-gazelle/cmd/[email protected] update --go_prefix=github.com/cockroachdb/crlib --repo_root=. | ||
@echo 'You should now be able to build Cockroach using:' | ||
@echo ' ./dev build short -- --override_repository=com_github_cockroachdb_crlib=${CURDIR}' | ||
|
||
.PHONY: clean-bazel | ||
clean-bazel: | ||
git clean -dxf WORKSPACE BUILD.bazel '**/BUILD.bazel' | ||
|
||
.PHONY: test | ||
test: | ||
${GO} test -tags '$(TAGS)' ${testflags} -run ${TESTS} ${PKG} | ||
|
||
.PHONY: lint | ||
lint: | ||
${GO} test -tags '$(TAGS)' -run ${TESTS} ./internal/lint | ||
|
||
.PHONY: stress | ||
stress: | ||
${GO} test -tags '$(TAGS)' -exec 'stress -p 2 -maxruns 1000' -v -run ${TESTS} ${PKG} |