taskwarrior/performance/load
Felix Schurk 8dd29e0a8a
Change to out-of source build, Update build instructions (#3271)
* update build instructions

Usage of "modern" CMake syntax and using specific out of source build.
Further add example on how to build in parallel, build a specific target
and how to change the compiler.

This closes #3236.
2024-02-25 12:27:52 -05:00

50 lines
1.1 KiB
Perl
Executable file

#! /usr/bin/perl
use strict;
use warnings;
if (open my $fh, '>', 'perf.rc')
{
print $fh "data.location=.\n",
"color=on\n",
"_forcecolor=on\n",
"verbose=label\n",
"hooks=off\n",
"color.debug=\n";
close $fh;
}
my $filename = 'sample-text.txt';
open(my $fh, '<:encoding(UTF-8)', $filename)
or die "Could not open file '$filename' $!";
# Read all the data.
my $id = 1;
while (my $line = <$fh>)
{
if ($. % 20 != 19)
{
# Names are both projects and tags.
$line =~ s/([A-Z]{2,})/$1 project:$1 +$1/g;
}
if ($. % 20 == 19)
{
my $anno_id = $id - 1;
qx{../build/src/task rc:perf.rc rc.gc=off $anno_id annotate $line};
print "[$.] task rc:perf.rc rc.gc=off $anno_id annotate $line\n" if $?;
}
elsif ($. % 4 == 1)
{
qx{../build/src/task rc:perf.rc rc.gc=off add $line};
print "[$.] task rc:perf.rc rc.gc=off add $line\n" if $?;
++$id;
}
else
{
qx{../build/src/task rc:perf.rc rc.gc=off log $line};
print "[$.] task rc:perf.rc rc.gc=off log $line\n" if $?;
}
}
exit 0;