1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
#!/usr/bin/perl
#
#####################################################################
# This program is not guaranteed to work at all, and by using this #
# program you release the author of any and all liability. #
# #
# You may use this code as long as you are in compliance with the #
# license (see the LICENSE file) and this notice, disclaimer and #
# comment box remain intact and unchanged. #
# #
# Script: doxygen-filter-perl #
# Description: pre-filter script for doxygen #
# #
# Written by: Bret Jordan (jordan at open1x littledot org) #
# Created: 2011-10-21 #
#####################################################################
#
#
#
#
use 5.8.8;
use strict;
use warnings;
use Doxygen::Filter::Perl;
use Log::Log4perl;
our $VERSION = '1.71';
$VERSION = eval $VERSION;
# You can not have any debugging turned on if you send the data through
# doxygen as it will mess up the output. So before you run "doxygen Doxyfile"
# make sure you have turned off all of the debugging. This is really only
# here so you can run "doxygen-filter-perl lib/some/path/to/a/perl.pm" and get
# debugging output
my %hDebugConfig = (
'log4perl.oneMessagePerAppender' => 1,
'log4perl.rootlogger' => 'FATAL, SCREEN',
'log4perl.logger.Doxygen::Filter::Perl::_ChangeState' => 'FATAL, SCREEN',
'log4perl.logger.Doxygen::Filter::Perl::_ProcessDoxygenCommentBlock' => 'FATAL, SCREEN',
'log4perl.logger.Doxygen::Filter::Perl::_ProcessPodCommentBlock' => 'FATAL, SCREEN',
'log4perl.logger.Doxygen::Filter::Perl::_ProcessPerlMethod' => 'FATAL, SCREEN',
'log4perl.logger.Doxygen::Filter::Perl::_ConvertPodFormattingToDoxygenFormat' => 'FATAL, SCREEN',
'log4perl.logger.Doxygen::Filter::Perl::_RemovePerlCommentFlags' => 'FATAL, SCREEN',
'log4perl.appender.SCREEN' => 'Log::Log4perl::Appender::Screen',
'log4perl.appender.SCREEN.stderr' => 0,
'log4perl.appender.SCREEN.Threshold' => 'DEBUG',
'log4perl.appender.SCREEN.layout' => 'Log::Log4perl::Layout::PatternLayout',
'log4perl.appender.SCREEN.layout.ConversionPattern' => '%-5p %L %M{1}() - %m%n',
);
Log::Log4perl::init(\%hDebugConfig);
# Lets grab the file name that passed in to the script
my $sFilename = $ARGV[0];
unless (-r $sFilename) { die "This file is not readable\n"; }
$sFilename =~ /\.([a-zA-Z]{1,4})$/;
my $sFileExtention = lc($1);
my $filter;
if ( $sFileExtention eq 'pm' || $sFileExtention eq 'pl')
{
$filter = new Doxygen::Filter::Perl();
$filter->ReadFile($sFilename);
$filter->ProcessFile();
$filter->PrintAll();
}
# Used for debugging
#use Data::Dumper;
#$Data::Dumper::Indent = 1;
#print Dumper($filter->{'_hData'});
|