Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template_processor: Allow to skip files or directories #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fetzerch
Copy link
Member

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 remove depends/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.

@Rechi
Copy link
Contributor

Rechi commented Mar 19, 2018

depends/common/{{ game.name }}/windows-deps.txt may also have to be removed/not added in that case.

@coveralls
Copy link

coveralls commented Nov 15, 2018

Coverage Status

Coverage increased (+0.03%) to 78.562% when pulling 8deedd6 on skip_dirs into c674a45 on master.

@fetzerch
Copy link
Member Author

While refactoring the code, I noticed that this should be already possible: A file is not generated if its content is empty. I'll update this change accordingly.

@fetzerch
Copy link
Member Author

@Rechi Is it still the case that 2048 should be compiled without mingw on windows? Then I'll merge this as well.

@fetzerch
Copy link
Member Author

There's a bit more todo: (see https://github.com/kodi-game/game.libretro.2048/pull/6/files)

  • depends/common/2048/CMakeLists.txt
  • depends/windows/2048/2048.txt
  • appveyor.yml

@Rechi
Copy link
Contributor

Rechi commented Nov 21, 2018

Although it would be nice to get rid of mingw, there is no use if it is only done for one.
Additionally one would have to keep the cmake project in sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants