forked from Dolibarr/dolibarr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdolibarr-doxygen-build.pl
executable file
·55 lines (41 loc) · 1.63 KB
/
dolibarr-doxygen-build.pl
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
#!/usr/bin/perl
#--------------------------------------------------------------------
# Lance la generation de la doc dev doxygen
#--------------------------------------------------------------------
# Detecte repertoire du script
($DIR=$0) =~ s/([^\/\\]+)$//;
$DIR||='.';
$DIR =~ s/([^\/\\])[\\\/]+$/$1/;
$OPTIONS="";
#$OPTIONS="-d Preprocessor";
$CONFFILE="dolibarr-doxygen.doxyfile";
use Cwd;
my $dir = getcwd;
print "Current dir is: $dir\n";
print "Running dir for doxygen must be: $DIR\n";
if (! -s $CONFFILE)
{
print "Error: current directory for building Dolibarr doxygen documentation is not correct.\n";
print "\n";
print "Change your current directory then, to launch the script, run:\n";
print '> perl .\dolibarr-doxygen-build.pl (on Windows)'."\n";
print '> perl ../dolibarr-doxygen-build.pl (on Linux or BSD)'."\n";
sleep 4;
exit 1;
}
$SOURCE="../..";
# Get version $MAJOR, $MINOR and $BUILD
$result = open( IN, "< " . $SOURCE . "/htdocs/filefunc.inc.php" );
if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; }
while (<IN>) {
if ( $_ =~ /define\('DOL_VERSION', '([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; }
}
close IN;
($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
if ($MINOR eq '') { die "Error can't detect version into ".$SOURCE . "/htdocs/filefunc.inc.php"; }
$version=$MAJOR.".".$MINOR.".".$BUILD;
print "Running doxygen for version ".$version.", please wait...\n";
print "cat $CONFFILE | sed -e 's/x\.y\.z/".$version."/' | doxygen $OPTIONS - 2>&1\n";
$result=`cat $CONFFILE | sed -e 's/x\.y\.z/$version/' | doxygen $OPTIONS - 2>&1`;
print $result;
0;