add -pro-debug option: trace .pro evaluation (like qmake -d)
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>
Thu, 8 Aug 2013 16:33:23 +0000 (18:33 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 27 Aug 2013 11:34:14 +0000 (13:34 +0200)
Change-Id: I2f6a3d43fa5e65fb6bfa44c17d833d9b8a30e06a
Reviewed-by: hjk <hjk121@nokiamail.com>
src/linguist/lupdate/lupdate.pro
src/linguist/lupdate/main.cpp

index da38078..da4a58b 100644 (file)
@@ -12,6 +12,8 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
 include(../shared/formats.pri)
 include(../shared/proparser.pri)
 
+DEFINES += PROEVALUATOR_DEBUG
+
 SOURCES += \
     main.cpp \
     merge.cpp \
index c94b653..dd2133d 100644 (file)
@@ -229,6 +229,8 @@ static void printUsage()
         "           different file suffix. Projects are recursed into and merged.\n"
         "    -pro-out <directory>\n"
         "           Virtual output directory for processing subsequent .pro files.\n"
+        "    -pro-debug\n"
+        "           Trace processing .pro files. Specify twice for more verbosity.\n"
         "    -source-language <language>[_<region>]\n"
         "           Specify the language of the source strings for new files.\n"
         "           Defaults to POSIX if not specified.\n"
@@ -693,6 +695,7 @@ int main(int argc, char **argv)
     UpdateOptions options =
         Verbose | // verbose is on by default starting with Qt 4.2
         HeuristicSameText | HeuristicSimilarText | HeuristicNumber;
+    int proDebug = 0;
     int numFiles = 0;
     bool metTsFlag = false;
     bool recursiveScan = true;
@@ -720,6 +723,9 @@ int main(int argc, char **argv)
         } else if (arg == QLatin1String("-silent")) {
             options &= ~Verbose;
             continue;
+        } else if (arg == QLatin1String("-pro-debug")) {
+            proDebug++;
+            continue;
         } else if (arg == QLatin1String("-target-language")) {
             ++i;
             if (i == argc) {
@@ -996,6 +1002,7 @@ int main(int argc, char **argv)
         option.qmake_abslocation = QString::fromLocal8Bit(qgetenv("QMAKE"));
         if (option.qmake_abslocation.isEmpty())
             option.qmake_abslocation = app.applicationDirPath() + QLatin1String("/qmake");
+        option.debugLevel = proDebug;
         option.initProperties();
         option.setCommandLineArguments(QDir::currentPath(),
                                        QStringList() << QLatin1String("CONFIG+=lupdate_run"));