plugins.jinja 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {#- empty string #}
  2. plugins {
  3. {%- if mainClass %}
  4. `application`
  5. {%- else %}
  6. `java-library`
  7. {%- endif %}
  8. {%- if publish %}
  9. `maven-publish`
  10. `signing`
  11. {%- endif -%}
  12. {%- if with_kotlin and kotlin_version %}
  13. kotlin("jvm") version "{{ kotlin_version }}"
  14. {%- if target.with_kotlinc_plugin_allopen|length %}
  15. kotlin("plugin.allopen") version "{{ kotlin_version }}"
  16. {% endif -%}
  17. {%- if target.with_kotlinc_plugin_lombok|length %}
  18. kotlin("plugin.lombok") version "{{ kotlin_version }}"
  19. {% endif -%}
  20. {%- if target.with_kotlinc_plugin_noarg|length %}
  21. kotlin("plugin.noarg") version "{{ kotlin_version }}"
  22. {% endif -%}
  23. {%- if target.with_kotlinc_plugin_serialization|length %}
  24. kotlin("plugin.serialization") version "{{ kotlin_version }}"
  25. {% endif -%}
  26. {%- endif -%}
  27. {%- if has_errorprone %}
  28. id("net.ltgt.errorprone") version "4.1.0"
  29. {%- endif -%}
  30. {#- TODO remove usings annotation_processors semantic -#}
  31. {%- if ("lombok.launch.AnnotationProcessorHider$AnnotationProcessor" in target.annotation_processors) or (target.use_annotation_processor|length and target.use_annotation_processor|select('startsWith', 'contrib/java/org/projectlombok/lombok')|length) %}
  32. id("io.freefair.lombok") version "8.6"
  33. {%- endif %}
  34. }
  35. {%- if jdk_version %}
  36. java {
  37. toolchain {
  38. languageVersion = JavaLanguageVersion.of("{{ jdk_version }}")
  39. }
  40. }
  41. {% endif -%}