Skip to content

Commit

Permalink
Regroup all variables to control workflows.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gouttegd committed Jan 14, 2025
1 parent a8ee15d commit 643802c
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions template/src/ontology/Makefile.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ----------------------------------------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 %}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 643802c

Please sign in to comment.