Skip to content
Snippets Groups Projects
Commit c4c1d37f authored by Todd Gamblin's avatar Todd Gamblin
Browse files

refactor: move templates from root to share/spack

- This complies with the unix directory hierarchy standard (which Spack
  attempts to follow)
- Also unclutters the repo root directory.
parent 6517dabb
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ config: ...@@ -21,7 +21,7 @@ config:
# Locations where templates should be found # Locations where templates should be found
template_dirs: template_dirs:
- $spack/templates - $spack/share/spack/templates
# default directory layout # default directory layout
......
...@@ -290,15 +290,15 @@ installation of a package. The table below summarizes the essential ...@@ -290,15 +290,15 @@ installation of a package. The table below summarizes the essential
information associated with the different file formats information associated with the different file formats
that can be generated by Spack: that can be generated by Spack:
+-----------------------------+--------------------+-------------------------------+----------------------------------+----------------------+ +-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
| | **Hook name** | **Default root directory** | **Default template file** | **Compatible tools** | | | **Hook name** | **Default root directory** | **Default template file** | **Compatible tools** |
+=============================+====================+===============================+==================================+======================+ +=============================+====================+===============================+==============================================+======================+
| **Dotkit** | ``dotkit`` | share/spack/dotkit | templates/modules/modulefile.dk | DotKit | | **Dotkit** | ``dotkit`` | share/spack/dotkit | share/spack/templates/modules/modulefile.dk | DotKit |
+-----------------------------+--------------------+-------------------------------+----------------------------------+----------------------+ +-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
| **TCL - Non-Hierarchical** | ``tcl`` | share/spack/modules | templates/modules/modulefile.tcl | Env. Modules/LMod | | **TCL - Non-Hierarchical** | ``tcl`` | share/spack/modules | share/spack/templates/modules/modulefile.tcl | Env. Modules/LMod |
+-----------------------------+--------------------+-------------------------------+----------------------------------+----------------------+ +-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
| **Lua - Hierarchical** | ``lmod`` | share/spack/lmod | templates/modules/modulefile.lua | LMod | | **Lua - Hierarchical** | ``lmod`` | share/spack/lmod | share/spack/templates/modules/modulefile.lua | LMod |
+-----------------------------+--------------------+-------------------------------+----------------------------------+----------------------+ +-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
Spack ships with sensible defaults for the generation of module files, but Spack ships with sensible defaults for the generation of module files, but
......
...@@ -1385,11 +1385,12 @@ Module file templates ...@@ -1385,11 +1385,12 @@ Module file templates
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
The templates that Spack uses to generate module files are stored in the The templates that Spack uses to generate module files are stored in the
``templates/module`` directory, and they all share the same common structure. ``share/spack/templates/module`` directory within the Spack prefix, and
Usually, they start with a header that identifies the type of they all share the same common structure. Usually, they start with a
module being generated. In the case of hierarchical module files it's: header that identifies the type of module being generated. In the case of
hierarchical module files it's:
.. literalinclude:: ../../../templates/modules/modulefile.lua .. literalinclude:: ../../../share/spack/templates/modules/modulefile.lua
:language: jinja :language: jinja
:lines: 1-6 :lines: 1-6
...@@ -1403,7 +1404,7 @@ that can be overridden or extended by users, if need be. ...@@ -1403,7 +1404,7 @@ that can be overridden or extended by users, if need be.
, delimited by ``{% ... %}``, , delimited by ``{% ... %}``,
are also permitted in the template language: are also permitted in the template language:
.. literalinclude:: ../../../templates/modules/modulefile.lua .. literalinclude:: ../../../share/spack/templates/modules/modulefile.lua
:language: jinja :language: jinja
:lines: 73-88 :lines: 73-88
......
config: config:
install_tree: $spack/opt/spack install_tree: $spack/opt/spack
template_dirs: template_dirs:
- $spack/templates - $spack/share/spack/templates
- $spack/lib/spack/spack/test/data/templates - $spack/lib/spack/spack/test/data/templates
- $spack/lib/spack/spack/test/data/templates_again - $spack/lib/spack/spack/test/data/templates_again
build_stage: build_stage:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment