[VOL-5222] - Upgrade golang version for VOLTHA jobs
Makefile
--------
o Remove redundant rm -fr java_temp commands, makefile target
java-clean is already setup to remove the temp directory.
o Add flag LOCAL_FIX_PERMS=1 to adjust permissions so make
build, test and lint can be used locally. Not perfect but close
(new files created from docker are still a problem).
makefiles/etc/include.mk
makefiles/etc/features.mk
------------------------
o Copy in banner functions from repo:onf-make.
makefiles/golang/commands.mk
makefiles/golang/include.mk
makefiles/golang/upgrade.mk
----------------------------
o Added target golang-version to display version from docker image.
o Added target golang-upgrade to update min version required by go.mod.
[HOWTO: Test]
-------------
o make help | grep golang
o make help-golang
o make golang-version
o make golang-upgrade # golang-version-upgrade=1.21.5
o make sterile build test LOCAL_FIX_PERMS=1
Change-Id: I4ffe0cd8785769d00d1b0a802fa49aebef3142f7
diff --git a/Makefile b/Makefile
index 7a9991f..e1c4b16 100755
--- a/Makefile
+++ b/Makefile
@@ -101,7 +101,6 @@
clean :: python-clean java-clean go-clean
sterile :: clean
- $(RM) -r java_temp
## -----------------------------------------------------------------------
## Python targets
@@ -253,17 +252,17 @@
java-protos-dirs += java_temp/src/main/java/org/opencord/voltha/adapter_service
mkdir-args += -vp
-# mkdir-args += --mode=0777# # Only a problem for local docker builds
java-protos: voltha.pb
$(call banner-enter,target $@)
-# $(RM) -fr java_temp
mkdir $(mkdir-args) $(java-protos-dirs)
+
$(docker-sh) $(quote-double) find $(java-protos-dirs) -print0 \
| xargs -0 -n1 /bin/ls -ld $(quote-double)
+ $(if $(LOCAL_FIX_PERMS),chmod -R o+w java_temp)
@${PROTOC_SH} $(quote-double) \
set -e -o pipefail; \
for x in ${PROTO_FILES}; do \
@@ -271,6 +270,7 @@
protoc --java_out=java_temp/src/main/java -I protos \$$x; \
done\
$(quote-double)
+ $(if $(LOCAL_FIX_PERMS),chmod -R o-w java_temp)
# Move files into place after all prototypes have generated.
# TODO: Remove the extra step, use makefile deps and