aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/bundle.py
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 /build/plugins/bundle.py
parent8ab9bd75c4f3786728b1cddccfa54d6f92db3cb3 (diff)
downloadydb-ce7a3274ab6f03c596e7b2c8c9f3f972f9b96170.tar.gz
[build] Add optional SUFFIX to BUNDLE()
commit_hash:340460c18f39c151147e8e942a5e82e8f485f714
Diffstat (limited to 'build/plugins/bundle.py')
-rw-r--r--build/plugins/bundle.py23
1 files changed, 16 insertions, 7 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])