Modifies Makefile to support multiple plugins
Introduces new convention for plugins that fixes multi plugin support Each plugin name will exist at : - cmd/<plugin name>/main.go Definitions to call plugin registration - internal/plugin/<plugin name> Implementations for Navigation, Tab and Print as appropriate Change-Id: I6f5e71900eb90b26917216ebd1a2749acc4f5a52
This commit is contained in:
parent
e4e14c891a
commit
b273aab419
12
Makefile
12
Makefile
@ -8,6 +8,7 @@ GIT_VERSION=$(shell git describe --match 'v*' --always)
|
||||
# Override the value of the version variable in main.go
|
||||
LD_FLAGS= '-X main.version=$(GIT_VERSION)'
|
||||
GO_FLAGS= -ldflags=$(LD_FLAGS)
|
||||
PLUGINS:= $(shell ls cmd)
|
||||
|
||||
ifdef XDG_CONFIG_HOME
|
||||
OCTANT_PLUGINSTUB_DIR ?= ${XDG_CONFIG_HOME}/octant/plugins
|
||||
@ -20,11 +21,16 @@ endif
|
||||
|
||||
DIRS = internal pkg
|
||||
RECURSIVE_DIRS = $(addsuffix /...,$(DIRS))
|
||||
#.PHONY: install-plugin
|
||||
#install-plugin:
|
||||
# mkdir -p $(OCTANT_PLUGINSTUB_DIR)
|
||||
# go build -o $(OCTANT_PLUGINSTUB_DIR)/airship-ui-plugin $(GO_FLAGS) opendev.org/airship/airshipui/cmd/airshipui
|
||||
|
||||
.PHONY: install-plugin
|
||||
install-plugin:
|
||||
.PHONY: install-plugins
|
||||
install-plugins: $(PLUGINS)
|
||||
$(PLUGINS):
|
||||
mkdir -p $(OCTANT_PLUGINSTUB_DIR)
|
||||
go build -o $(OCTANT_PLUGINSTUB_DIR)/airship-ui-plugin $(GO_FLAGS) opendev.org/airship/airshipui/cmd/airshipui
|
||||
go build -o $(OCTANT_PLUGINSTUB_DIR)/$@-plugin $(GO_FLAGS) opendev.org/airship/airshipui/cmd/$@
|
||||
|
||||
.PHONY: test
|
||||
test: generate
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"opendev.org/airship/airshipui/internal/plugin"
|
||||
"opendev.org/airship/airshipui/internal/plugin/airshipui"
|
||||
)
|
||||
|
||||
var (
|
||||
|
Loading…
x
Reference in New Issue
Block a user