summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-01-20 11:08:35 +0100
committerFriedemann Kleint <Friedemann.Kleint@digia.com>2014-01-21 10:17:52 +0100
commite5f146edd27e74ea6f37fac385268617c6dfacf9 (patch)
treebd07633214273ef650a482189b6f5da8bb3f02b3 /scripts
parentfac8a8a0dc13c28088d4ea907616c9809b14786e (diff)
downloadqt-creator-e5f146edd27e74ea6f37fac385268617c6dfacf9.tar.gz
Add msvc2tasks.pl for converting MSVC warning logs into .tasks files.
Change-Id: Ief673c06f0456fe1055447383c9fbef5a112d69c Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/msvc2tasks.pl27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/msvc2tasks.pl b/scripts/msvc2tasks.pl
new file mode 100644
index 0000000000..b6266dd526
--- /dev/null
+++ b/scripts/msvc2tasks.pl
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+msvc2tasks.pl - Convert MSVC warnings into Qt Creator task files.
+
+=head1 SYNOPSIS
+
+ msvc2tasks.pl < logfile > taskfile
+
+=cut
+
+use strict;
+
+while (my $line = <STDIN> ) {
+ chomp($line);
+ # --- extract file name based matching:
+ # c:\foo.cpp(395) : warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
+ if ($line =~ /^([^(]+)\((\d+)\) : warning (C\d+:.*)$/) {
+ my $fileName = $1;
+ my $lineNumber = $2;
+ my $text = $3;
+ $fileName =~ s|\\|/|g;
+ $text =~ s|\\|/|g; # Fix file names mentioned in text since tasks file have backslash-escaping.
+ print $fileName, "\t", $lineNumber, "\twarn\t", $text,"\n";
+ }
+}