diff --git a/source/dub/generators/generator.d b/source/dub/generators/generator.d index 8010988..340197e 100644 --- a/source/dub/generators/generator.d +++ b/source/dub/generators/generator.d @@ -279,14 +279,23 @@ if (buildsettings.copyFiles.length) { logInfo("Copying files for %s...", pack); - foreach (f; buildsettings.copyFiles) { - auto src = Path(f); - if (!src.absolute) src = pack_path ~ src; - auto dst = target_path ~ Path(f).head; - logDiagnostic(" %s to %s", src.toNativeString(), dst.toNativeString()); - try { - copyFile(src, dst, true); - } catch logWarn("Failed to copy to %s", dst.toNativeString()); + foreach (f; dirEntries(pack_path.toNativeString(), SpanMode.breadth)) + { + foreach(copyGlob; buildsettings.copyFiles) + { + if(f.globMatch(copyGlob)) + { + auto src = Path(f); + if (!src.absolute) src = pack_path ~ src; + auto dst = target_path ~ Path(f).head; + logDiagnostic(" %s to %s", src.toNativeString(), dst.toNativeString()); + try { + copyFile(src, dst, true); + } catch logWarn("Failed to copy to %s", dst.toNativeString()); + + break; + } + } } } }