Skip to content

Commit

Permalink
Add ability to generate interfaces and package methods from library
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Klues <kklues@nvidia.com>
  • Loading branch information
klueska committed Apr 12, 2024
1 parent b34e706 commit 6f20742
Show file tree
Hide file tree
Showing 4 changed files with 1,325 additions and 883 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ check: $(CHECK_TARGETS)

# Apply go fmt to the codebase
fmt:
go list -f '{{.Dir}}' $(MODULE)/pkg/... \
go list -f '{{.Dir}}' $(MODULE)/pkg/... $(MODULE)/gen/... \
| xargs gofmt -s -l -w

golangci-lint:
Expand Down Expand Up @@ -144,6 +144,10 @@ bindings: .create-bindings .strip-autogen-comment .strip-nvml-h-linenumber
go fmt types_gen.go; \
cd -> /dev/null
rm -rf $(PKG_BINDINGS_DIR)/nvml.yml $(PKG_BINDINGS_DIR)/cgo_helpers.go $(PKG_BINDINGS_DIR)/types.go $(PKG_BINDINGS_DIR)/_obj
go run $(GEN_BINDINGS_DIR)/generateapi.go \
--sourceDir $(PKG_BINDINGS_DIR) \
--output $(PKG_BINDINGS_DIR)/zz_generated.api.go
make fmt

.strip-autogen-comment: SED_SEARCH_STRING := // WARNING: This file has automatically been generated on
.strip-autogen-comment: SED_REPLACE_STRING := // WARNING: THIS FILE WAS AUTOMATICALLY GENERATED.
Expand All @@ -166,6 +170,7 @@ clean-bindings:
rm -f $(PKG_BINDINGS_DIR)/nvml.go
rm -f $(PKG_BINDINGS_DIR)/nvml.h
rm -f $(PKG_BINDINGS_DIR)/types_gen.go
rm -f $(PKG_BINDINGS_DIR)/zz_generated.api.go

# Update nvml.h from the Anaconda package repository
update-nvml-h: JQ ?= $(DOCKER) run -i --rm -v "$(PWD):$(PWD)" -w "$(PWD)" backplane/jq:latest
Expand Down

0 comments on commit 6f20742

Please sign in to comment.