aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordeshevoy <deshevoy@yandex-team.com>2024-10-16 21:56:24 +0300
committerdeshevoy <deshevoy@yandex-team.com>2024-10-16 22:14:27 +0300
commitce7a3274ab6f03c596e7b2c8c9f3f972f9b96170 (patch)
tree968820cdbfc5bdf9a958b06d53187d82403f3a79
parent8ab9bd75c4f3786728b1cddccfa54d6f92db3cb3 (diff)
downloadydb-ce7a3274ab6f03c596e7b2c8c9f3f972f9b96170.tar.gz
[build] Add optional SUFFIX to BUNDLE()
commit_hash:340460c18f39c151147e8e942a5e82e8f485f714
-rw-r--r--build/plugins/bundle.py23
-rw-r--r--build/ymake.core.conf4
2 files changed, 18 insertions, 9 deletions
diff --git a/build/plugins/bundle.py b/build/plugins/bundle.py
index 69e3e01681..aec47ffa2c 100644
--- a/build/plugins/bundle.py
+++ b/build/plugins/bundle.py
@@ -3,20 +3,29 @@ import os
def onbundle(unit, *args):
"""
- @usage BUNDLE(<Dir [NAME Name]>...)
+ @usage BUNDLE(<Dir [SUFFIX Suffix] [NAME Name]>...)
Brings build artefact from module Dir under optional Name to the current module (e.g. UNION)
If NAME is not specified, the name of the Dir's build artefact will be preserved
+ Optional SUFFIX allows to use secondary module output. The suffix is appended to the primary output name, so the applicability is limited.
It makes little sense to specify BUNDLE on non-final targets and so this may stop working without prior notice.
Bundle on multimodule will select final target among multimodule variants and will fail if there are none or more than one.
"""
i = 0
while i < len(args):
- if i + 2 < len(args) and args[i + 1] == "NAME":
- target, name = args[i], args[i + 2]
- i += 3
+ target = args[i]
+ i += 1
+
+ if i + 1 < len(args) and args[i] == "SUFFIX":
+ suffix = args[i + 1]
+ i += 2
+ else:
+ suffix = ""
+
+ if i + 1 < len(args) and args[i] == "NAME":
+ name = args[i + 1]
+ i += 2
else:
- target, name = args[i], os.path.basename(args[i])
- i += 1
+ name = os.path.basename(target) + suffix
- unit.on_bundle_target([target, name])
+ unit.on_bundle_target([target, name, suffix])
diff --git a/build/ymake.core.conf b/build/ymake.core.conf
index b59168f2bc..15ac0a5163 100644
--- a/build/ymake.core.conf
+++ b/build/ymake.core.conf
@@ -2725,8 +2725,8 @@ macro ALL_RESOURCE_FILES_FROM_DIRS(PREFIX="", STRIP="", DIRS...) {
_ARF_HELPER(${pre=PREFIX :PREFIX} STRIP ${ARCADIA_ROOT}/${MODDIR}/${STRIP} ${_ALL_RES_DIRS})
}
-macro _BUNDLE_TARGET(Target, Destination) {
- .CMD=$MOVE_FILE ${result:Target} ${noauto;output:Destination} ${hide;kv:"p BN"} ${hide;kv:"pc light-cyan"} $VCS_INFO_DISABLE_CACHE__NO_UID__
+macro _BUNDLE_TARGET(Target, Destination, Suffix) {
+ .CMD=$MOVE_FILE ${result:Target}$Suffix ${noauto;output:Destination} ${hide;kv:"p BN"} ${hide;kv:"pc light-cyan"} $VCS_INFO_DISABLE_CACHE__NO_UID__
}
### @usage: TIMEOUT(TIMEOUT)