jdk.jinja 1.0 KB

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