diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /build/plugins/scarab_cant_clash.py | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'build/plugins/scarab_cant_clash.py')
-rw-r--r-- | build/plugins/scarab_cant_clash.py | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/build/plugins/scarab_cant_clash.py b/build/plugins/scarab_cant_clash.py new file mode 100644 index 0000000000..77dc303183 --- /dev/null +++ b/build/plugins/scarab_cant_clash.py @@ -0,0 +1,66 @@ +import _common as common + + +def onacceleo(unit, *args): + if unit.get("YMAKE_JAVA_MODULES") == "yes": + return + flat, kv = common.sort_by_keywords( + {'XSD': -1, 'MTL': -1, 'MTL_ROOT': 1, 'LANG': -1, 'OUT': -1, 'OUT_NOAUTO': -1, 'OUTPUT_INCLUDES': -1, 'DEBUG': 0}, + args + ) + + try: + mtlroot = kv['MTL_ROOT'][0] + except Exception: + mtlroot = unit.path().replace('$S/', '') + + classpath = ['$SCARAB', ] # XXX special word for ya make to replace following paths with real classpath + classpath.append('tools/acceleo') + + depends = [] + if not unit.get('IDE_MSVS_CALL'): + for jar in classpath[1:]: + depends.append(jar) + + classpath = ':'.join(classpath) + + # Generate java cmd + cmd = [ + '-classpath', + classpath, + '-Dfile.encoding=UTF-8', + 'ru.yandex.se.logsng.tool.Cli', + ] + + for xsd in kv.get('XSD', []): + cmd += ['--xsd', xsd] + + for mtl in kv.get('MTL', []): + cmd += ['--mtl', mtl] + + for lang in kv.get('LANG', []): + cmd += ['--lang', lang] + + cmd += ['--output-dir', unit.path().replace('$S/', '${ARCADIA_BUILD_ROOT}/')] + cmd += ['--build-root', '${ARCADIA_BUILD_ROOT}'] + cmd += ['--source-root', '${ARCADIA_ROOT}'] + cmd += ['--mtl-root', mtlroot] + + # Generate RUN_JAVA args + run_java = cmd + + if 'DEBUG' not in kv: + run_java += ['HIDE_OUTPUT'] + + inputs = kv.get('XSD', []) + kv.get('MTL', []) + kv.get('LANG', []) + if inputs: + run_java += ['IN'] + inputs + + for k in 'OUT', 'OUT_NOAUTO', 'OUTPUT_INCLUDES': + if kv.get(k): + run_java += [k] + kv[k] + + if depends: + run_java += ['TOOL'] + depends + + unit.on_run_java(run_java) |