From 643802caf80e8a1782d3ac2fd2af479a0509ab9a Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Tue, 14 Jan 2025 10:32:03 +0000 Subject: [PATCH] Regroup all variables to control workflows. Declare all the variables that control whether workflows are enabled (MIR, IMP/IMP_LARGE, COMP, and PAT) in a single block near the beginning of the Makefile. This both ensures that all such variables are always declared before they are used, and makes it easier for users to find them and understand what they are for. --- template/src/ontology/Makefile.jinja2 | 38 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/template/src/ontology/Makefile.jinja2 b/template/src/ontology/Makefile.jinja2 index b6d78e97..46d86b22 100644 --- a/template/src/ontology/Makefile.jinja2 +++ b/template/src/ontology/Makefile.jinja2 @@ -110,6 +110,29 @@ ODK_DEBUG_FILE = debug.log SHELL = $(SCRIPTSDIR)/run-command.sh endif +# ---------------------------------------- +# Workflow control +# ---------------------------------------- +# Set any of the following variables to false to completely disable the +# corresponding workflows. + +# Refresh of mirrors (and all remote resources more generally) +MIR = true + +# Re-generation of import modules +IMP = true + +# Re-generation of "large" import modules +# Note that IMP=false takes precedence over IMP_LARGE=true, that is, +# IMP=false disables the generation of all import modules, large or not. +IMP_LARGE = true + +# Re-generation of component modules +COMP = true + +# Re-generation of pattern-derived files +PAT = true + # ---------------------------------------- # Top-level targets # ---------------------------------------- @@ -464,12 +487,6 @@ ANNOTATION_PROPERTIES={% for p in project.import_group.annotation_properties %}{ # These live in the imports/ folder # This pattern uses ROBOT to generate an import module -# Set to false to bypass all code to generate/refresh import modules -IMP = true - -# Likewise, but for "large" modules only -IMP_LARGE = true - ifeq ($(IMP),true) # Should be able to drop this if robot can just take a big messy list of terms as input. $(IMPORTDIR)/%_terms_combined.txt: $(IMPORTSEED) $(IMPORTDIR)/%_terms.txt @@ -608,9 +625,6 @@ no-mirror-refresh-%: # ---------------------------------------- # Some ontologies contain external and internal components. A component is included in the ontology in its entirety. -# Set to false to bypass all code to generate/refresh components -COMP=true - ifeq ($(COMP),true) .PHONY: all_components all_components: $(OTHER_SRC) @@ -676,9 +690,6 @@ endif # COMP=true # Mirroring upstream ontologies # ---------------------------------------- -# Set to false to bypass all code to create/refresh mirrors -MIR=true - ifeq ($(MIR),true) {% for ont in project.import_group.products %} @@ -793,9 +804,6 @@ endif # DOSDP Templates/Patterns # ---------------------------------------- -# Set to false to bypass all code to generate/refresh patterns -PAT = true - ifeq ($(PAT),true) ALL_PATTERN_FILES=$(wildcard $(PATTERNDIR)/dosdp-patterns/*.yaml)