{
QString cleanFile = QDir::cleanPath(file);
+ foreach (const QString &ex, cd.m_excludes) {
+ QRegExp rx(ex, Qt::CaseSensitive, QRegExp::Wildcard);
+ if (rx.exactMatch(cleanFile))
+ return;
+ }
+
const int index = includeStack.indexOf(cleanFile);
if (index != -1) {
CppFiles::addIncludeCycle(includeStack.mid(index).toSet());
return visitor.absoluteFileValues(QLatin1String(var), projectDir, vPaths, 0);
}
-static QStringList getSources(const ProFileEvaluator &visitor, const QString &projectDir)
+static QStringList getSources(const ProFileEvaluator &visitor, const QString &projectDir,
+ const QStringList &excludes)
{
QStringList baseVPaths;
baseVPaths += visitor.absolutePathValues(QLatin1String("VPATH"), projectDir);
sourceFiles.removeDuplicates();
sourceFiles.sort();
- QStringList excludes;
- foreach (QString ex, visitor.values(QLatin1String("TR_EXCLUDE"))) {
- if (!QFileInfo(ex).isAbsolute())
- ex = QDir(projectDir).absoluteFilePath(ex);
- excludes << QDir::cleanPath(ex);
- }
foreach (const QString &ex, excludes) {
// TODO: take advantage of the file list being sorted
QRegExp rx(ex, Qt::CaseSensitive, QRegExp::Wildcard);
return sourceFiles;
}
+QStringList getExcludes(const ProFileEvaluator &visitor, const QString &projectDir)
+{
+ QStringList excludes;
+ foreach (QString ex, visitor.values(QLatin1String("TR_EXCLUDE"))) {
+ if (!QFileInfo(ex).isAbsolute())
+ ex = QDir(projectDir).absoluteFilePath(ex);
+ excludes << QDir::cleanPath(ex);
+ }
+
+ return excludes;
+}
+
static void excludeProjects(const ProFileEvaluator &visitor, QStringList *subProjects)
{
foreach (const QString &ex, visitor.values(QLatin1String("TR_EXCLUDE"))) {
cd.m_noUiLines = options & NoUiLines;
cd.m_sourceIsUtf16 = options & SourceIsUtf16;
cd.m_includePath = visitor.values(QLatin1String("INCLUDEPATH"));
- QStringList sourceFiles = getSources(visitor, proPath);
+ cd.m_excludes = getExcludes(visitor, proPath);
+ QStringList sourceFiles = getSources(visitor, proPath, cd.m_excludes);
QSet<QString> sourceDirs;
sourceDirs.insert(proPath + QLatin1Char('/'));
foreach (const QString &sf, sourceFiles)