proto_dependencies.jinja 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. {#- empty string #}
  2. dependencies {
  3. {%- for library in target.consumer if library.classpath -%}
  4. {%- if library.prebuilt and library.jar and (library.type != "contrib" or target.handler.build_contribs) %}
  5. implementation(files("$project_root/{{ library.jar }}"))
  6. {%- else -%}
  7. {%- set classpath = library.classpath -%}
  8. {%- if classpath|replace('"','') == classpath -%}
  9. {%- set classpath = '"' + classpath + '"' -%}
  10. {%- endif %}
  11. {%- if library.type != "contrib" %}
  12. implementation
  13. {%- else %}
  14. api
  15. {%- endif -%}({{ classpath }})
  16. {%- if library.excludes.consumer is defined %} {
  17. {% for exclude in library.excludes.consumer -%}
  18. {% set classpath = exclude.classpath|replace('"','') -%}
  19. {% set classpath_parts = split(classpath, ':') -%}
  20. exclude(group = "{{ classpath_parts[0] }}", module = "{{ classpath_parts[1] }}")
  21. {% endfor -%}
  22. }
  23. {%- endif -%}
  24. {%- endif -%}
  25. {%- endfor -%}
  26. {%- if target.proto_namespace %}
  27. protobuf(files(File(mainProtosDir, "{{ target.proto_namespace }}")))
  28. {%- else %}
  29. protobuf(files(mainProtosDir))
  30. {%- endif %}
  31. }