view dox_task.pl @ 14:d997ff96acf1

sync
author sergey
date Mon, 19 May 2014 18:34:16 +0400
parents fa7a99c2d079
children 573a92d54f07
line wrap: on
line source

#!/usr/bin/perl -w
use lib '.';
use config;
use config::bootstrap;
use strict;
use URI;


use IMPL::require {
	DoxygenTask => 'Benzin::Doxygen::MakedocTask',
	HG => 'Benzin::SCC::Mercurial',
	Config => 'IMPL::Config'
};

my @repos = (
	{
		doxyfile => '_doc/doxyfile',
		src => 'https://hg.implab.org/pub/ImplabNet'
	},
	{
		doxyfile => 'Doc/doxyfile',
		src => 'https://hg.implab.org/private/Pallada.PoiskAvia'
	}
);

my $base = Config->AppDir('mercurial-data');

foreach my $desc (@repos) {
	my $name = pop (@{[split /\//, $desc->{src}]});
	print "processing: $name\n";  
	my $dir = File::Spec->catdir($base,$name);
	my $update;
	if (-d $dir) {
		
		my $repo = HG->new($dir,\%config::hgSettings);
		my $income = $repo->Income();
		if (@$income) {
			print "donwloading changes\n";
			$repo->Pull(['-u']);
			$update = 1;
		}
	} else {
		print "clonning $name to $dir\n";
		my $repo = HG->Clone($desc->{src},$dir,[],\%config::hgSettings);
		$update = 1;
	}
	
	if ($update) {
		print "updating $name";
		my $task = DoxygenTask->new(
			doxyfile => File::Spec->catdir($dir,$desc->{doxyfile}),
			makedoc => 1,
			dataDirPath => Config->AppDir('doxygen-data', $name),
			connection => $config::doxConnection  
		);
		
		$task->DoWork();
	} else {
		print "$name is up to date\n";
	}
}

#xmlDocPath => '/home/sergey/projects/Dusel/_doc/xml',
#    collectionName => 'dusel',
#    doxyfile => '/home/sergey/projects/Dusel/_doc/doxyfile',
#    dataDirPath => File::Spec->catdir($base,'doxygen-data','dusel'),
#    connection => $doxConnection,
#    language => 'csharp'

#my $task = DoxygenTask->new(
#	%config::doxSource
#);

#$task->DoWork();

print "completed\n";