[Solved] How to include assets from folder but not from subfolders

I have assets folder for sounds that contains a some of subfolders with different sound sets for test case purpose. I do not want to include this subfolders to the compilled swf and I am trying to do

<assets path="assets/sound" rename="snd" include="*.mp3" exclude="*/*.*" if="flash" />

but it doesn’t helps - sounds from subfolders are embedded into swf.

It is not a problem to move subfolders away, but I’d like to know is there a way to exclude all subfolders via xml?

try <assets path="assets/sound" rename="snd" include="*.mp3" exclude="your folder name" if="flash" />
I think you can add more than one using “,”

It only checks against one string. Maybe the string it checks against happens to use a backslash rather than a slash?

Try exclude="*[/\\]". (You shouldn’t need the ending wildcards, but you definitely do need the first one.)

For reference:

Actually, it’s “|”.

2 Likes

[quote=“juakob, post:2, topic:1287”][/quote]
I want exclude all subfolders regardless of their names. But thanks, you get me idea to use pattern like “excluded_pattern”. That works if I add this pattern to name for each subfolder. But I’d like to know common solution if it exists.

Didn’t work.

Oh, I see. The text to match will never contain either a slash or backslash, because it checks the directory name(s) separately from the names of the files inside.

For instance, if you’ve got a file at assets/sound/subfolder/Sound.mp3, it’ll check “subfolder” for exclusion, and then check “Sound.mp3”, but it won’t check “subfolder/Sound.mp3”.

One fix would be to assume that your files will all have dots and your folders won’t, and then exclude everything that lacks a dot:

exclude="[^.]+$"

(Due to the modifications Lime makes, this will actually check for either dots or backslashes. But as we’ve already established, there aren’t any backslashes.)

That works as I need, thanks!