proto_source_sets.jinja 659 B

12345678910111213141516171819202122
  1. {#- empty string #}
  2. sourceSets {
  3. main {
  4. java.srcDir("$buildDir/generated/sources/proto/main/java")
  5. {%- if target.proto_grpc %}
  6. java.srcDir("$buildDir/generated/sources/proto/main/grpc")
  7. {%- endif %}
  8. }
  9. test {
  10. java.srcDir("$buildDir/generated/sources/proto/test/java")
  11. {%- if target.proto_grpc %}
  12. java.srcDir("$buildDir/generated/sources/proto/test/grpc")
  13. {%- endif %}
  14. }
  15. }
  16. {%- if target.jar_source_set is defined -%}
  17. {%- for source_set in target.jar_source_set -%}
  18. {%- set srcdir_glob = split(source_set, ':') %}
  19. sourceSets.main.java.srcDirs += "{{ srcdir_glob[0] }}"
  20. {% endfor -%}
  21. {%- endif %}