Versions Compared

Key

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

...

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";
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";
        }
    }
}

Instrument code

Once emma.jar sits in the appropriate directory then the following command should bring up the help information for EMMA:

...