template_processor: Allow to skip files or directories #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Templated file names can now contain expressions to control if the file or directory should be generated or skipped. If the expression evaluates to a non-empty string, that string is used as file or directory name. If the expression evaluates to an empty string the generation of that file or directory is skipped.
This can be used to provide custom files in the source repo that are not overridden by a template.
For example the directory:
addon/depends/windows/{{ "mingw" if not config.nomingw }}
is not generated if'nomingw': True
is added to the config.@garbear is this what you meant with your comment in kodi-game/game.libretro.2048#6?
I fear in its current form the template engine cannot skip a directory based on the existence of a file in the source repo. With this change, we would just need to add
depends/windows/2048/CMakeLists.txt
and removedepends/windows/mingw/*
. The other changes from https://github.com/kodi-game/game.libretro.2048/pull/6/files (appveyor, common/2048/CMakeLists.txt) would remain as they are, but that shouldn't be an issue.Maybe also interesting for @Rechi.