Toby Inkster avatar Toby Inkster committed 83d3c98

XT::Manager stuff; package_flavour config option

Comments (0)

Files changed (3)

 	'dist_maker|D=s',
 	'help|usage|h',
 	'licence_class|l=s',
+	'package_flavour=s',
 	'use|M=s@',
 	'version|v',
 	);
   --dist_maker=S, -D=S     Class to use to create distribution.
   --help, -h               Show this help.
   --licence_class=S, -l=S  Perl class with licensing data.
+  --package_flavour=S      use Module::Package::RDF::$flavour.
   --use S, -M=S            Distribution should use these modules.
   --version=S, -v=S        Initial version number.
 
 dist_maker defaults to "App::mkdist", but any package that provides the same
 API should work.
 
+package_flavour defaults to 'standard'.
+
 Example:
 
   mkdist --author name="Toby Inkster" \

lib/App/mkdist.pm

 	
 	return $template->fill_in(
 		-hash => \%hash,
-		);
+	);
 }
 
 sub _iofile
 	$self->{abstract} ||= 'a module that does something-or-other';
 	$self->{version}  ||= '0.001';
 	
+	$self->{package_flavour} ||= 'standard';
+	
 	$self->{version_ident} = 'v_'.$self->{version};
 	$self->{version_ident} =~ s/\./-/g;
 	
 	$self->{licence} = $self->{licence_class}->new({
 		year    => $self->{copyright}{year},
 		holder  => $self->{copyright}{holder},
-		});
+	});
 	
 	# 'includes' is 'use' minus some modules we handle specially
 	$self->{includes} = [grep {!/^(autodie|boolean|common_sense|strict|warnings|moose|5\.[0-9_]+|namespace_clean)$/} keys %{$self->{use}}];
 		push @mr, 'autodie'          if $self->{use}{autodie};
 		push @mr, 'boolean'          if $self->{use}{boolean};
 		push @mr, 'common::sense'    if $self->{use}{common_sense};
-		push @mr, 'namespace::clean' if $self->{use}{namespace_clean}
-		                             || $self->{use}{moose};
+		push @mr, 'namespace::clean' if $self->{use}{namespace_clean} || $self->{use}{moose};
 		
 		if (@mr)
 		{
 {
 	my ($self) = @_;
 	
-	$self->_iofile( $self->{module_filename} )
-		->print( $self->_fill_in_template('module') );
+	$self->_iofile( $self->{module_filename} )->print( $self->_fill_in_template('module') );
 }
 
 sub create_makefile_pl
 {
 	my ($self) = @_;
 	
-	$self->_iofile('Makefile.PL')
-		->print($self->_fill_in_template('Makefile.PL'));
+	$self->_iofile('Makefile.PL')->print($self->_fill_in_template('Makefile.PL'));
 }
 
 sub create_metadata
 {
 	my ($self) = @_;
 	
-	$self->_iofile($_)
-		->print($self->_fill_in_template($_))
+	$self->_iofile($_)->print($self->_fill_in_template($_))
 		foreach grep { m#^meta/# } $self->_get_template_names;
 }
 
 {
 	my ($self) = @_;
 	
-	$self->_iofile($_)
-		->print($self->_fill_in_template($_))
+	$self->_iofile($_)->print($self->_fill_in_template($_))
 		foreach grep { m#^t/# } $self->_get_template_names;
 }
 
 {
 	my ($self) = @_;
 	
-	$self->_iofile($_)
-		->print($self->_fill_in_template($_))
+	$self->_iofile($_)->print($self->_fill_in_template($_))
 		foreach grep { m#^xt/# } $self->_get_template_names;
+	
+	my $xtdir = io->catdir($ENV{HOME}, qw(perl5 xt));
+	$self->_iofile("xt/".$_->filename)->print(scalar $_->slurp)
+		foreach grep { $_->filename =~ /\.t$/ } $xtdir->all;
 }
 
 1;
 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
 COMMENCE Makefile.PL
-use inc::Module::Package 'RDF {$mpr_version}';
+use inc::Module::Package 'RDF:{$package_flavour} {$mpr_version}';
 
 COMMENCE meta/changes.pret
 # This file acts as the project's changelog.
 <{$licence->url}>
 	dc:title  "{$licence->name}".
 
+COMMENCE meta/people.pret
+# This file contains data about the project developers.
+
+@prefix : <http://xmlns.com/foaf/0.1/>.
+
 cpan:{uc $author->{cpanid}}
-	foaf:name  "{$author->{name}}";
-	foaf:mbox  <mailto:{$author->{mbox}}>.
+	:name  "{$author->{name}}";
+	:mbox  <mailto:{$author->{mbox}}>.
 
 COMMENCE meta/makefile.pret
 # This file provides instructions for packaging.
 	perl_version_from m`{$module_name}`;
 	version_from      m`{$module_name}`;
 	readme_from       m`{$module_name}`;
-	test_requires     p`Test::More 0.61` {$requires} .
+	test_requires     p`Test::More 0.61` {$requires};
+	.
 
 COMMENCE t/01basic.t
 use Test::More tests => 1;
 BEGIN \{ use_ok('{$module_name}') \};
 
-COMMENCE xt/01pod.t
-use Test::More;
-eval "use Test::Pod 1.00";
-plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
-all_pod_files_ok();
+COMMENCE xt/03meta_uptodate.config
+\{"package":"{$dist_name}"\}
 
-COMMENCE xt/02pod_coverage.t
-use Test::More;
-use Test::Pod::Coverage;
-
-my @modules = qw({$module_name});
-pod_coverage_ok($_, "$_ is covered") for @modules;
-done_testing(scalar @modules);
-
-COMMENCE xt/03meta_uptodate.t
-use Test::More tests => 1;
-use Test::RDF::DOAP::Version;
-doap_version_ok('{$dist_name}', '{$module_name}');
-
-COMMENCE xt/04eol.t
-use Test::EOL;
-all_perl_files_ok();
 		dcs:versus my:v_0-007 ;
 		dcs:item   [ a dcs:Bugfix ; rdfs:label "Get t/01basic.t working again."@en ] ;
 	] .
+
+my:project :release my:v_0-009 .
+my:v_0-009
+	a               :Version ;
+	dc:issued       "2012-09-25"^^xsd:date ;
+	:revision       "0.009"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/Module-Package-RDF-0.009.tar.gz> ;
+	dcs:changeset [
+		dcs:versus my:v_0-008 ;
+		dcs:item   [ rdfs:label "App::mkdist now pulls author tests from ~/perl5/xt rather than producing hard-coded ones."@en ] ;
+		dcs:item   [ rdfs:label "Module::Install::StandardDocuments."@en; a dcs:Addition ] ;
+		dcs:item   [ rdfs:label "bin/mkdist now sports a --package_flavour option."@en ] ;
+	] .
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.