summaryrefslogtreecommitdiffstats
path: root/build/plugins/res.py
diff options
context:
space:
mode:
authororivej <[email protected]>2022-02-10 16:45:01 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:01 +0300
commit2d37894b1b037cf24231090eda8589bbb44fb6fc (patch)
treebe835aa92c6248212e705f25388ebafcf84bc7a1 /build/plugins/res.py
parent718c552901d703c502ccbefdfc3c9028d608b947 (diff)
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'build/plugins/res.py')
-rw-r--r--build/plugins/res.py62
1 files changed, 31 insertions, 31 deletions
diff --git a/build/plugins/res.py b/build/plugins/res.py
index c01b999ed6f..a937caba816 100644
--- a/build/plugins/res.py
+++ b/build/plugins/res.py
@@ -42,41 +42,41 @@ def onfat_resource(unit, *args):
# https://msdn.microsoft.com/ru-ru/library/windows/desktop/ms682425.aspx
for part_args in split(args, 8000):
output = listid(part_args) + '.cpp'
- inputs = [x for x, y in iterpair(part_args) if x != '-']
- if inputs:
- inputs = ['IN'] + inputs
+ inputs = [x for x, y in iterpair(part_args) if x != '-']
+ if inputs:
+ inputs = ['IN'] + inputs
- unit.onrun_program(['tools/rescompiler', output] + part_args + inputs + ['OUT_NOAUTO', output])
+ unit.onrun_program(['tools/rescompiler', output] + part_args + inputs + ['OUT_NOAUTO', output])
unit.onsrcs(['GLOBAL', output])
-def onresource_files(unit, *args):
- """
+def onresource_files(unit, *args):
+ """
@usage: RESOURCE_FILES([DONT_PARSE] [PREFIX {prefix}] [STRIP prefix_to_strip] {path})
This macro expands into
RESOURCE([DONT_PARSE] {path} resfs/file/{prefix}{path}
- resfs/src/resfs/file/{prefix}{remove_prefix(path, prefix_to_strip)}={rootrel_arc_src(path)}
- )
-
- resfs/src/{key} stores a source root (or build root) relative path of the
- source of the value of the {key} resource.
-
- resfs/file/{key} stores any value whose source was a file on a filesystem.
- resfs/src/resfs/file/{key} must store its path.
-
+ )
+
+ resfs/src/{key} stores a source root (or build root) relative path of the
+ source of the value of the {key} resource.
+
+ resfs/file/{key} stores any value whose source was a file on a filesystem.
+ resfs/src/resfs/file/{key} must store its path.
+
DONT_PARSE disables parsing for source code files (determined by extension)
Please don't abuse: use separate DONT_PARSE macro call only for files subject to parsing
- This form is for use from other plugins:
- RESOURCE_FILES([DEST {dest}] {path}) expands into RESOURCE({path} resfs/file/{dest})
+ This form is for use from other plugins:
+ RESOURCE_FILES([DEST {dest}] {path}) expands into RESOURCE({path} resfs/file/{dest})
@see: https://wiki.yandex-team.ru/devtools/commandsandvars/resourcefiles/
- """
- prefix = ''
+ """
+ prefix = ''
prefix_to_strip = None
- dest = None
- res = []
+ dest = None
+ res = []
first = 0
if args and not unit.enabled('_GO_MODULE'):
@@ -85,21 +85,21 @@ def onresource_files(unit, *args):
if args and args[0] == 'DONT_PARSE':
first = 1
-
+
args = iter(args[first:])
- for arg in args:
- if arg == 'PREFIX':
- prefix, dest = next(args), None
- elif arg == 'DEST':
- dest, prefix = next(args), None
+ for arg in args:
+ if arg == 'PREFIX':
+ prefix, dest = next(args), None
+ elif arg == 'DEST':
+ dest, prefix = next(args), None
elif arg == 'STRIP':
prefix_to_strip = next(args)
- else:
- path = arg
+ else:
+ path = arg
key = 'resfs/file/' + (dest or (prefix + (path if not prefix_to_strip else remove_prefix(path, prefix_to_strip))))
- src = 'resfs/src/{}={}'.format(key, rootrel_arc_src(path, unit))
- res += ['-', src, path, key]
-
+ src = 'resfs/src/{}={}'.format(key, rootrel_arc_src(path, unit))
+ res += ['-', src, path, key]
+
if unit.enabled('_GO_MODULE'):
unit.on_go_resource(res)
else: