diff 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 diff
--- a/dox_task.pl	Mon May 19 04:34:28 2014 +0400
+++ b/dox_task.pl	Mon May 19 18:34:16 2014 +0400
@@ -3,18 +3,74 @@
 use config;
 use config::bootstrap;
 use strict;
-use IMPL::Config;
+use URI;
+
 
 use IMPL::require {
 	DoxygenTask => 'Benzin::Doxygen::MakedocTask',
-	DoxModel => 'Benzin::Doxygen::Model',
-	InlineFactory => 'IMPL::Object::InlineFactory'
+	HG => 'Benzin::SCC::Mercurial',
+	Config => 'IMPL::Config'
 };
 
-my $task = DoxygenTask->new(
-	%config::doxSource
+my @repos = (
+	{
+		doxyfile => '_doc/doxyfile',
+		src => 'https://hg.implab.org/pub/ImplabNet'
+	},
+	{
+		doxyfile => 'Doc/doxyfile',
+		src => 'https://hg.implab.org/private/Pallada.PoiskAvia'
+	}
 );
 
-$task->DoWork();
+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";
\ No newline at end of file