aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorspreis <spreis@yandex-team.com>2023-11-13 05:33:49 +0300
committerspreis <spreis@yandex-team.com>2023-11-13 05:51:57 +0300
commit8037faa61b34ba46c742efe468451b96c4b55c69 (patch)
treeff4bc7f5a5f57cc2052f4d3b2b7e85f3a0a9a954 /build
parent4abf85baae59e2393868790fa21539430c9cc1b0 (diff)
downloadydb-8037faa61b34ba46c742efe468451b96c4b55c69.tar.gz
Introduce ALL_RESOURCE_FILES_FROM_DIRS
Diffstat (limited to 'build')
-rw-r--r--build/plugins/res.py12
-rw-r--r--build/ymake.core.conf15
2 files changed, 25 insertions, 2 deletions
diff --git a/build/plugins/res.py b/build/plugins/res.py
index c7d1027061..bd3d3abe23 100644
--- a/build/plugins/res.py
+++ b/build/plugins/res.py
@@ -65,11 +65,19 @@ def onresource_files(unit, *args):
unit.onresource(res)
-def onall_resource_files(unit, *args):
+def on_all_resource_files(unit, macro, *args):
# This is only validation, actual work is done in ymake.core.conf implementation
for arg in args:
if '*' in arg or '?' in arg:
- ymake.report_configure_error('Wildcards in [[imp]]ALL_RESOURCE_FILES[[rst]] are not allowed')
+ ymake.report_configure_error('Wildcards in [[imp]]{}[[rst]] are not allowed'.format(macro))
+
+
+def onall_resource_files(unit, *args):
+ on_all_resource_files(unit, 'ALL_RESOURCE_FILES', args)
+
+
+def onall_resource_files_from_dirs(unit, *args):
+ on_all_resource_files(unit, 'ALL_RESOURCE_FILES_FROM_DIRS', args)
def on_ya_conf_json(unit, conf_file):
diff --git a/build/ymake.core.conf b/build/ymake.core.conf
index 6fa2cfc7b5..e51a2c19a4 100644
--- a/build/ymake.core.conf
+++ b/build/ymake.core.conf
@@ -2560,6 +2560,21 @@ macro ALL_RESOURCE_FILES(EXT, PREFIX="", STRIP="", DIRS...) {
_ARF_HELPER(${pre=PREFIX :PREFIX} STRIP ${ARCADIA_ROOT}/${MODDIR}/${STRIP} ${pre=$ALL_RES_:EXT})
}
+### @usage ALL_RESOURCE_FILES_FROM_DIRS([PREFIX {prefix}] [STRIP {strip}] Dirs...)
+###
+### This macro collects all files non-recursively from listed Dirs and
+### Passes them to `RESOURCE_FILES` macro as relative to current directory
+### The macro is usefull if literally all files are needed because `ALL_RESOURCE_FILES` requires extension to be specified
+###
+### `PREFIX` and `STRIP` have the same meaning as in `ROURCES_FILES`, both are applied over moddir-relative paths
+###
+### Note: This macro can be used only once per ya.make
+### Note: Wildcards are not allowed neither as Ext nor in Dirs
+macro ALL_RESOURCE_FILES_FROM_DIRS(PREFIX="", STRIP="", DIRS...) {
+ _GLOB(_ALL_RES_DIRS ${suf=/*:DIRS})
+ _ARF_HELPER(${pre=PREFIX :PREFIX} STRIP ${ARCADIA_ROOT}/${MODDIR}/${STRIP} ${_ALL_RES_DIRS})
+}
+
macro _BUNDLE_TARGET(Target, Destination) {
.CMD=$MOVE_FILE ${result:Target} ${output;noauto:Destination} ${kv;hide:"p BN"} ${kv;hide:"pc light-cyan"} $VCS_INFO_DISABLE_CACHE__NO_UID__
}