From bfa6943e12b8946e82299f621c182133524b996f Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Sat, 18 Apr 2026 22:05:47 +0100 Subject: [PATCH] Import components when seeding the -edit file. When seeding a new repository, if the ODK is configured to manage import declarations, then we shoud generate import declarations not only for the import modules and the patterns-derived definitions, but also for the components. This is what we do here. --- src/incatools/odk/templates/_dynamic_files.jinja2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/incatools/odk/templates/_dynamic_files.jinja2 b/src/incatools/odk/templates/_dynamic_files.jinja2 index 07e3e9a..4e43566 100644 --- a/src/incatools/odk/templates/_dynamic_files.jinja2 +++ b/src/incatools/odk/templates/_dynamic_files.jinja2 @@ -32,6 +32,11 @@ import: {{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ proj {% endfor -%} {% endif -%} {% endif -%} +{% if project.components is defined -%} +{% for component in project.components.products -%} +import: {{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/components/{{ component.filename }} +{% endfor -%} +{% endif -%} {% if project.use_dosdps -%} import: {{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/patterns/definitions.owl {% if project.import_pattern_ontology -%} @@ -85,7 +90,11 @@ Import(<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ proj {% endfor -%} {% endif -%} {% endif %} - +{% if project.components is defined -%} +{% for component in project.components.products -%} +Import(<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/components/{{ component.filename }}>) +{% endfor -%} +{% endif -%} {% if project.use_dosdps -%} Import(<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/patterns/definitions.owl>) {% if project.import_pattern_ontology -%}