forked from qt-creator/qt-creator
Add msvc2tasks.pl for converting MSVC warning logs into .tasks files.
Change-Id: Ief673c06f0456fe1055447383c9fbef5a112d69c Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
27
scripts/msvc2tasks.pl
Normal file
27
scripts/msvc2tasks.pl
Normal file
@@ -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";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user