jdk.jinja 1.1 KB

12345678910111213141516171819202122232425262728
  1. {%- set jdk_version = false -%}
  2. {%- if target.required_jdk -%}
  3. {%- set jdk_version = target.required_jdk -%}
  4. {%- elif target.jdk_version -%}
  5. {%- set jdk_version = target.jdk_version -%}
  6. {%- elif not target and extra_targets|length -%}
  7. {%- set jdk_version_targets = extra_targets|selectattr('jdk_version') -%}
  8. {%- if jdk_version_targets|length -%}
  9. {%- set jdk_version_target = jdk_version_targets|first -%}
  10. {%- set jdk_version = jdk_version_target.jdk_version -%}
  11. {%- else -%}
  12. {%- set jdk_version = '17' -%}
  13. {%- endif -%}
  14. {%- else -%}
  15. {%- set jdk_version = '17' -%}
  16. {%- endif -%}
  17. {%- set jdk_path = false -%}
  18. {%- if target.jdk_path and target.jdk_path != "NOT_FOUND" -%}
  19. {%- set jdk_path = target.jdk_path -%}
  20. {#- If no main target, but exists extra_targets -#}
  21. {%- elif not target and extra_targets|length -%}
  22. {%- set jdk_path_targets = extra_targets|selectattr('jdk_path')|rejectattr('jdk_path', 'eq', 'NOT_FOUND') -%}
  23. {%- if jdk_path_targets|length -%}
  24. {%- set jdk_path_target = jdk_path_targets|first -%}
  25. {%- set jdk_path = jdk_path_target.jdk_path -%}
  26. {%- endif -%}
  27. {%- endif -%}