aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordimdim11 <dimdim11@yandex-team.com>2025-03-13 14:13:38 +0300
committerdimdim11 <dimdim11@yandex-team.com>2025-03-13 14:40:28 +0300
commit3a5d2af37147a26e942377ce7cd22204b808cbdd (patch)
treeec01eaa3317a2ba8a249a6ed008e96cceb8f19e4
parent202fe61b9a81ca8fff0aa72f46e3b479bb708d4f (diff)
downloadydb-3a5d2af37147a26e942377ce7cd22204b808cbdd.tar.gz
Fix api/implementation in dependencies
Fix api/implementation in dependencies commit_hash:aa1b09da88d81da729b276275c0e02342fe30c05
-rw-r--r--build/export_generators/gradle/build.gradle.kts.jinja58
-rw-r--r--build/export_generators/gradle/build.gradle.kts.proto.jinja29
2 files changed, 53 insertions, 34 deletions
diff --git a/build/export_generators/gradle/build.gradle.kts.jinja b/build/export_generators/gradle/build.gradle.kts.jinja
index ccf0a34e6e..c7df3e7588 100644
--- a/build/export_generators/gradle/build.gradle.kts.jinja
+++ b/build/export_generators/gradle/build.gradle.kts.jinja
@@ -34,41 +34,47 @@ java {
}
dependencies {
-{% if has_junit5_test -%}
+{%- if has_junit5_test %}
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
api("org.apache.commons:commons-math3:3.6.1")
api("com.google.guava:guava:31.0.1-jre")
{% endif -%}
-{% for library in target.consumer -%}
-{% set classpath = library.classpath -%}
-{% if classpath|replace('"','') == classpath -%}
-{% set classpath = '"' + classpath + '"' -%}
-{% endif -%}
-{% if mainClass -%}
-{% if library.excludes.consumer is defined %}
- implementation({{ classpath }}) {
-{% for exclude in library.excludes.consumer if exclude.classpath -%}
-{% set classpath = exclude.classpath|replace('"','') -%}
-{% set classpath_parts = split(classpath, ':') -%}
- exclude(group = "{{ classpath_parts[0] }}", module = "{{ classpath_parts[1] }}")
-{% endfor -%}
- }
-{% else -%}
+{%- for library in target.consumer if library.classpath -%}
+{%- set classpath = library.classpath -%}
+{%- if classpath|replace('"','') == classpath -%}
+{%- set classpath = '"' + classpath + '"' -%}
+{%- endif -%}
+{%- if library.type != "contrib" %}
implementation({{ classpath }})
-{% endif -%}
-{% else -%}
+{%- else %}
api({{ classpath }})
-{% endif -%}
+{%- endif -%}
+{%- if library.excludes.consumer is defined %} {
+{% for exclude in library.excludes.consumer if exclude.classpath -%}
+{%- set classpath = exclude.classpath|replace('"','') -%}
+{%- set classpath_parts = split(classpath, ':') -%}
+ exclude(group = "{{ classpath_parts[0] }}", module = "{{ classpath_parts[1] }}")
+{% endfor -%}
+ }
+{%- endif -%}
{% endfor -%}
-{% for extra_target in extra_targets -%}
-{% for library in extra_target.consumer -%}
-{% set classpath = library.classpath -%}
-{% if classpath|replace('"','') == classpath -%}
-{% set classpath = '"' + classpath + '"' -%}
-{% endif -%}
+{%- for extra_target in extra_targets -%}
+{%- for library in extra_target.consumer if library.classpath -%}
+{%- set classpath = library.classpath -%}
+{%- if classpath|replace('"','') == classpath -%}
+{%- set classpath = '"' + classpath + '"' -%}
+{%- endif %}
testImplementation({{ classpath }})
+{%- if library.excludes.consumer is defined %} {
+{% for exclude in library.excludes.consumer if exclude.classpath -%}
+{%- set classpath = exclude.classpath|replace('"','') -%}
+{%- set classpath_parts = split(classpath, ':') -%}
+ exclude(group = "{{ classpath_parts[0] }}", module = "{{ classpath_parts[1] }}")
+{% endfor -%}
+ }
+{%- endif -%}
{% endfor -%}
-{% endfor -%}
+{% endfor %}
}
{% if has_junit5_test -%}
diff --git a/build/export_generators/gradle/build.gradle.kts.proto.jinja b/build/export_generators/gradle/build.gradle.kts.proto.jinja
index 1d84696c13..bdc805ded6 100644
--- a/build/export_generators/gradle/build.gradle.kts.proto.jinja
+++ b/build/export_generators/gradle/build.gradle.kts.proto.jinja
@@ -27,14 +27,27 @@ java {
}
dependencies {
-{%- for library in target.consumer -%}
-{% set classpath = library.classpath -%}
-{% if classpath|replace('"','') == classpath -%}
-{% set classpath = '"' + classpath + '"' -%}
-{% endif %}
- api({{ classpath }})
-{%- endfor %}
-{% if target.proto_namespace %}
+{%- for library in target.consumer if library.classpath -%}
+{%- set classpath = library.classpath -%}
+{%- if classpath|replace('"','') == classpath -%}
+{%- set classpath = '"' + classpath + '"' -%}
+{%- endif %}
+{%- if library.type != "contrib" %}
+ implementation
+{%- else %}
+ api
+{%- endif -%}({{ classpath }})
+{%- if library.excludes.consumer is defined %} {
+{% for exclude in library.excludes.consumer -%}
+{% set classpath = exclude.classpath|replace('"','') -%}
+{% set classpath_parts = split(classpath, ':') -%}
+ exclude(group = "{{ classpath_parts[0] }}", module = "{{ classpath_parts[1] }}")
+{% endfor -%}
+ }
+{%- endif -%}
+{%- endfor -%}
+
+{%- if target.proto_namespace %}
protobuf(files(File(buildProtoDir, "{{ target.proto_namespace }}")))
{%- else %}
protobuf(files(buildProtoDir))