From 1b96d0169028b0d4d59bfd5d15ba138652745833 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 17 May 2022 14:20:59 +0200 Subject: [PATCH] tool/depot: allow versioned entries in used_apis Normally, the APIs listed in 'used_apis' files do not carry a version but implictly refer to the current version. This patch allows for specifiying an concrete version. This is a useful feature in the context of the Goa tool. --- tool/depot/mk/dependencies.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tool/depot/mk/dependencies.inc b/tool/depot/mk/dependencies.inc index 65aa528d5e..7bcf9cf336 100644 --- a/tool/depot/mk/dependencies.inc +++ b/tool/depot/mk/dependencies.inc @@ -101,10 +101,18 @@ ARCHIVES(src) := $(sort ${ARCHIVES(src)}\ # # Extend ARCHIVES(api) with the APIs used by ARCHIVES(src) # - +# The 'used_apis' file can contain fully specified entries or shortcuts. +# A fully specified entry has the form '/api//version'. +# A shortcut has the form '/version'. In this case, the '' is +# implicitely equal to the depot user of the src archive. +# _used_apis = $(call file_content,$(call used_apis_file,$1)) -src_api_archives = $(addprefix $(call archive_user,$1)/api/,$(call _used_apis,$1)) +api_full_specified = $(call path_element,4,$1) + +src_api_archives = $(foreach A,$(call _used_apis,$1),\ + $(if $(call api_full_specified,$A),\ + $A,$(addprefix $(call archive_user,$1)/api/,$A))) ARCHIVES(api) := $(sort ${ARCHIVES(api)} $(foreach A,${ARCHIVES(src)},\ $(call src_api_archives,$A)))