aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-06 08:19:15 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-06 08:19:15 +0300
commit60928c4d649ea546659f6f1eedd7ab80947dcbd2 (patch)
tree98e4a670083df4eba3915040c69930f44b20277e
parent7e9dc13d9120d62ad81b627f1017ecab025abfe1 (diff)
downloadydb-60928c4d649ea546659f6f1eedd7ab80947dcbd2.tar.gz
intermediate changes
ref:5bc2a57c5d394201cd37814df101c8d32e444ce8
-rw-r--r--build/plugins/copy_files_to_build_prefix.py2
-rw-r--r--build/plugins/res.py11
-rw-r--r--build/ymake.core.conf26
3 files changed, 35 insertions, 4 deletions
diff --git a/build/plugins/copy_files_to_build_prefix.py b/build/plugins/copy_files_to_build_prefix.py
index c8a6e07511..242c993766 100644
--- a/build/plugins/copy_files_to_build_prefix.py
+++ b/build/plugins/copy_files_to_build_prefix.py
@@ -7,7 +7,7 @@ CURDIR = '${CURDIR}/'
BINDIR = '${BINDIR}/'
-def oncopy_files_to_build_prefix(unit, *args):
+def on_copy_files_to_build_prefix(unit, *args):
keywords = {'PREFIX': 1, 'GLOBAL': 0}
# NB! keyword 'GLOBAL' is a way to skip this word from the list of files
diff --git a/build/plugins/res.py b/build/plugins/res.py
index a937caba81..5a868fe100 100644
--- a/build/plugins/res.py
+++ b/build/plugins/res.py
@@ -1,4 +1,5 @@
from _common import iterpair, listid, pathid, rootrel_arc_src, tobuilddir, filter_out_by_keyword
+import ymake
def split(lst, limit):
@@ -88,6 +89,9 @@ def onresource_files(unit, *args):
args = iter(args[first:])
for arg in args:
+ if arg == 'DONT_PARSE':
+ # ignore explicit specification
+ continue
if arg == 'PREFIX':
prefix, dest = next(args), None
elif arg == 'DEST':
@@ -104,3 +108,10 @@ def onresource_files(unit, *args):
unit.on_go_resource(res)
else:
unit.onresource(res)
+
+def onall_resource_files(unit, *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')
+
diff --git a/build/ymake.core.conf b/build/ymake.core.conf
index fea257c93d..fe30de9c72 100644
--- a/build/ymake.core.conf
+++ b/build/ymake.core.conf
@@ -5307,6 +5307,26 @@ macro COPY_FILE_WITH_CONTEXT(FILE, DEST, AUTO?"AUTO":"", OUTPUT_INCLUDES[]) {
.CMD=$COPY_FILE($FILE $DEST $AUTO OUTPUT_INCLUDES $FILE $OUTPUT_INCLUDES)
}
+### This is to join $ALL_RES_ and $EXT
+macro _ARF_HELPER(Args...) {
+ RESOURCE_FILES($Args)
+}
+
+### @usage ALL_RESOURCE_FILES(Ext [PREFIX {prefix}] [STRIP {strip}] Dirs...)
+###
+### This macro collects all files with extension `Ext` and
+### Passes them to `RESOURCE_FILES` macro as relative to current directory
+###
+### `PREFIX` and `STRIP` have the same meaning as in `ROURCES_FILES`, both are applied over moddir-relative paths
+###
+### Note: This macro can be used multiple times per ya.make, but only once for each Ext value
+### Note: Wildcards are not allowed neither as Ext nor in Dirs
+macro ALL_RESOURCE_FILES(EXT, PREFIX="", STRIP="", DIRS...) {
+ _GLOB(ALL_RES_$EXT ${suf=/*.$EXT:DIRS})
+ _ARF_HELPER(${pre=PREFIX :PREFIX} STRIP ${ARCADIA_ROOT}/${MODDIR}${pre=/:STRIP} ${pre=$ALL_RES_:EXT})
+}
+
+
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__
}
@@ -7652,9 +7672,9 @@ macro USE_EXT_PROTO(EXTRA_TAGS...) {
### FILES() macro). Currently this macro copies only files with the following
### extensions: .proto, .gztproto, .ev
macro _RAW_PROTO_SRCS(FILES...) {
- COPY_FILES_TO_BUILD_PREFIX(${ext=.proto:FILES} PREFIX ${_EXT_PROTO_DIR})
- COPY_FILES_TO_BUILD_PREFIX(${ext=.gztproto:FILES} PREFIX ${_EXT_PROTO_DIR})
- COPY_FILES_TO_BUILD_PREFIX(${ext=.ev:FILES} PREFIX ${_EXT_PROTO_DIR})
+ _COPY_FILES_TO_BUILD_PREFIX(${ext=.proto:FILES} PREFIX ${_EXT_PROTO_DIR})
+ _COPY_FILES_TO_BUILD_PREFIX(${ext=.gztproto:FILES} PREFIX ${_EXT_PROTO_DIR})
+ _COPY_FILES_TO_BUILD_PREFIX(${ext=.ev:FILES} PREFIX ${_EXT_PROTO_DIR})
}
module PROTO_DESCRIPTIONS: _BARE_UNIT {