Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • the source code is available for report generation
    Note: I have written a This simple Perl script that copies all the source code into one directory
    structure instead of being scattered under the java/src directories. This allows report generation for all reports to point to the same source code directory.

$root=When you have your Sakai source code
$target=Where you want your condensed tree
$filter=The directory pattern to search for

Code Block
titleExample source code condenser
borderStylesolid
#!/usr/bin/perl
use File::Copy;
use File::Find;

my $root="/home/alan/temp/coverage/src/trunk";
my $target="/home/alan/temp/coverage/src/condensed_trunk";
my $filter="src/java/";
my @parts;

print "Copying and condensing source ready for htmlzing\n";
#print "mkdir $target\n";
mkdir("$target", 0755) || die "Cannot mkdir $target: $!";
find (\&wanted, $root);

sub wanted{
    @parts=split(/$filter/,$File::Find::name);
       
     if ((-d $_)&&($parts[1] ne "")){
                if (!(-d "$target/$parts[1]" )){
   
             mkdir("$target/$parts[1]", 0755) || die "Cannot mkdir $target/$parts[1]: $!";
       
        }
        
    }else{
 
              if ($_=~/.java$/){
        
             copy($File::Find::name,"$target/$parts[1]") or print "Naming error: File cannot be copied.\n$File::Find::name";

                }
       
    }
}
  • Javac compiles the source code with debug option on
    Note: Running maven pack-demo compiles with debug on by default

...