diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-12-12 15:00:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-12 15:00:43 +0000 |
commit | 42701242eaf5be980cb935631586d0e90b82641c (patch) | |
tree | 6dbf5fcd37d3c16591e196c4a69d166e3ab3a398 /build/export_generators | |
parent | 7f5a9f394dbd9ac290cabbb7977538656b3a541e (diff) | |
parent | f7c04b5876af3d16849ab5e3079c0eabbd4e3a00 (diff) | |
download | ydb-42701242eaf5be980cb935631586d0e90b82641c.tar.gz |
Merge pull request #12554 from vitalyisaev2/YQ-3839.with_rightlib.3
Import from Arcadia + YDB FQ: turning gateways_config.proto into a file without external dependencies
Diffstat (limited to 'build/export_generators')
6 files changed, 19 insertions, 18 deletions
diff --git a/build/export_generators/gradle/generator.toml b/build/export_generators/gradle/generator.toml index bccc600a73..aeb7ccaf4b 100644 --- a/build/export_generators/gradle/generator.toml +++ b/build/export_generators/gradle/generator.toml @@ -27,6 +27,7 @@ junit5_test="flag" app_main_class="str" enable_preview="flag" use_annotation_processor="list" +use_errorprone="flag" publish="flag" publish_group="str" diff --git a/build/export_generators/ide-gradle/build.gradle.kts.jinja b/build/export_generators/ide-gradle/build.gradle.kts.jinja index 36aa47faa9..d0a9040f05 100644 --- a/build/export_generators/ide-gradle/build.gradle.kts.jinja +++ b/build/export_generators/ide-gradle/build.gradle.kts.jinja @@ -1,3 +1,14 @@ +{%- macro OutDirs(run, prefix, suffix) -%} +{%- if run.args|length and run.out_dir|length -%} +{%- for out_dir in run.out_dir -%} +{%- set out_dirs = select_by_ends(run.args, "/" + out_dir) -%} +{%- if out_dirs|length %} +{{ prefix }}{{ out_dirs|first }}{{ suffix }} +{%- endif -%} +{%- endfor -%} +{%- endif -%} +{%- endmacro -%} + {%- include "[generator]/vars.jinja" -%} {%- include "[generator]/import.jinja" -%} {%- include "[generator]/repositories.jinja" -%} diff --git a/build/export_generators/ide-gradle/generator.toml b/build/export_generators/ide-gradle/generator.toml index 4bd8f5947f..2ca73ff555 100644 --- a/build/export_generators/ide-gradle/generator.toml +++ b/build/export_generators/ide-gradle/generator.toml @@ -31,6 +31,7 @@ app_main_class="str" jar_source_set="list" enable_preview="flag" use_annotation_processor="list" +use_errorprone="flag" publish="flag" publish_group="str" diff --git a/build/export_generators/ide-gradle/run_java_program.jinja b/build/export_generators/ide-gradle/run_java_program.jinja index a28ba73bc5..6f0597a86a 100644 --- a/build/export_generators/ide-gradle/run_java_program.jinja +++ b/build/export_generators/ide-gradle/run_java_program.jinja @@ -4,14 +4,14 @@ val runJav{{ loop.index }} = task<JavaExec>("runJavaProgram{{ loop.index }}") { group = "build" description = "Code generation by run java program" -{%- if run.classpath|length %} -{% for classpath in run.classpath -%} +{%- set classpaths = run.classpath|reject('eq', '@.cplst') -%} +{%- if classpaths|length -%} +{% for classpath in classpaths -%} {%- set rel_file_classpath = classpath|replace('@', '')|replace(export_root, '')|replace(arcadia_root, '') %} + val classpaths = "$project_root/" + File("$project_root{{ rel_file_classpath }}").readText().trim().replace(":", ":$project_root/") classpath = files(classpaths.split(":")) {%- endfor -%} -{% else %} - classpath = sourceSets.main.get().runtimeClasspath {%- endif %} mainClass.set("{{ run.args[0] }}") diff --git a/build/export_generators/ide-gradle/source_sets.jinja b/build/export_generators/ide-gradle/source_sets.jinja index 47dc8a8180..75268d66aa 100644 --- a/build/export_generators/ide-gradle/source_sets.jinja +++ b/build/export_generators/ide-gradle/source_sets.jinja @@ -31,7 +31,7 @@ sourceSets { java.srcDir("src/intTest/java") resources.srcDir("src/intTest/resources") {%- for extra_target in extra_targets -%} -{%- if extra_target|length -%} +{%- if extra_target.runs|length -%} {%- for run in extra_target.runs -%} {{ OutDirs(run, ' java.srcDir("', '")') }} {%- endfor -%} diff --git a/build/export_generators/ide-gradle/vars.jinja b/build/export_generators/ide-gradle/vars.jinja index db363b3cbc..b83c0dfac2 100644 --- a/build/export_generators/ide-gradle/vars.jinja +++ b/build/export_generators/ide-gradle/vars.jinja @@ -3,7 +3,7 @@ {%- set with_kotlin = target.with_kotlin -%} {%- set kotlin_version = target.kotlin_version -%} {%- set has_junit5_test = extra_targets|selectattr('junit5_test') -%} -{%- set has_errorprone = target.consumer|selectattr('jar', 'startsWith', 'contrib/java/com/google/errorprone/error_prone_annotations')|length -%} +{%- set has_errorprone = target.use_errorprone and not disable_errorprone -%} {%- if not target.required_jdk -%} {%- set has_required_jdk = false -%} @@ -13,15 +13,3 @@ {%- set has_required_jdk = true -%} {%- set required_jdk = target.required_jdk -%} {%- endif -%} - -{%- macro OutDirs(runs, prefix, suffix) -%} -{%- if run.args|length and run.out_dir|length -%} -{%- for out_dir in run.out_dir -%} -{#- search all run arguments ended by /<out_dir> -#} -{%- set out_dirs = select_by_ends(run.args, "/" + out_dir) -%} -{%- if out_dirs|length %} -{{ prefix }}{{ out_dirs|first }}{{ suffix }} -{%- endif -%} -{%- endfor -%} -{%- endif -%} -{%- endmacro -%} |