VOL-2169 Add LOCAL_LIB_GO and update README
Change-Id: I904605e8178c5fe0e3053717062f4c61b8a47745
diff --git a/Makefile b/Makefile
index 3ccf82b..dc15d72 100644
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@
--build-arg LOCAL_PYVOLTHA=${LOCAL_PYVOLTHA} \
--build-arg LOCAL_PROTOS=${LOCAL_PROTOS}
-.PHONY: simulated_olt simulated_onu local-protosa
+.PHONY: simulated_olt simulated_onu local-protos local-lib-go
# This should to be the first and default target in this Makefile
help:
@@ -74,14 +74,26 @@
@echo "lint-sanity : Verify that 'go vet' doesn't report any issues"
@echo "lint-mod : Verify the integrity of the 'mod' files"
@echo "lint : Shorthand for lint-style & lint-sanity"
+ @echo "local-lib-go : Copies a local version of the VOTLHA dependencies into the vendor directory"
+ @echo "local-protos : Copies a local verison of the VOLTHA protos into the vendor directory"
@echo "test : Generate reports for all go tests"
@echo
## Local Development Helpers
local-protos:
ifdef LOCAL_PROTOS
+ rm -rf vendor/github.com/opencord/voltha-protos/go
mkdir -p vendor/github.com/opencord/voltha-protos/go
- cp -r ${GOPATH}/src/github.com/opencord/voltha-protos/go/* vendor/github.com/opencord/voltha-protos/go
+ cp -r ${LOCAL_PROTOS}/go/* vendor/github.com/opencord/voltha-protos/go
+ rm -rf vendor/github.com/opencord/voltha-protos/go/vendor
+endif
+
+## Local Development Helpers
+local-lib-go:
+ifdef LOCAL_LIB_GO
+ rm -rf vendor/github.com/opencord/voltha-lib-go
+ mkdir -p vendor/github.com/opencord/voltha-lib-go/v2/pkg
+ cp -r ${LOCAL_LIB_GO}/pkg/* vendor/github.com/opencord/voltha-lib-go/v2/pkg/
endif
## Docker targets
@@ -90,7 +102,7 @@
docker-build: simulated_olt
-simulated_olt: local-protos
+simulated_olt: local-protos local-lib-go
docker build $(DOCKER_BUILD_ARGS) -t ${SIMULATEDOLT_IMAGENAME}:${DOCKER_TAG} -t ${SIMULATEDOLT_IMAGENAME}:latest -f docker/Dockerfile.simulated_olt .
docker-push: