Page 1 of 1

Ignore directory when building distribution

Posted: Sun Jun 02, 2019 11:03 am
by goldo
Hi guys,

I have an 'ignore' directory within the game folder, with various subfolders and files that are useful for testing but not supposed to be released with the game.

I must be stupid, but I cannot figure out the pattern for classifying files as 'ignore' when building a distribution.

The documentation says this:
The classification is done by the build.classify function. It takes a patterns and a space-separated list of filenames. Patterns are matched from first to last, with the first match taking precedence (even if a more-specific pattern follows.) Patterns are matched with and without a leading /. Patterns may include the following special characters:
/
The directory separator.
*
Matches all characters except for the directory separator.
**
Matches all characters.
I have tried the following, unsuccessfully:

Code: Select all

    build.classify('ignore/**', None)
    build.classify('ignore/', None)
    build.classify('ignore**', None)
    build.classify('ignore/**.**', None)
    
When building the distribution, it never fails to include all files within the 'ignore' folder... What am I doing wrong?

Re: Ignore directory when building distribution

Posted: Sun Jun 02, 2019 11:54 am
by Matalla
Why not just delete or move that folder outside the game folder before making the distribution?

Re: Ignore directory when building distribution

Posted: Sun Jun 02, 2019 1:01 pm
by goldo
Well, the point is I want to avoid doing that everytime by using the built-in classify function.

I need the directory inside the game folder otherwise it isn't available for testing (it is a large folder with pictures, so moving it back and forth takes several minutes).

Re: Ignore directory when building distribution

Posted: Sun Jun 02, 2019 4:04 pm
by Imperf3kt
You need to include the filetypes:

Code: Select all

    build.classify('game/ignore/**.png', None)
    build.classify('game/ignore/**.jpg', None)

Re: Ignore directory when building distribution

Posted: Sun Jun 02, 2019 4:48 pm
by goldo
Thanks, I guess I could do that for every file type, but why doesn't this work:

Code: Select all

build.classify('ignore/**.**', None)
Also, it would leave behind all the empty subfolders, correct? I wish I could just skip everything that's in ignore including the folder itself.