Alien-TinyCC

 view release on metacpan or  search on metacpan

inc/My/Build.pm  view on Meta::CPAN

########################################################################
                       package My::Build;
########################################################################

use strict;
use warnings;
use parent 'Module::Build';

sub ACTION_build {
	my $self = shift;
	
	mkdir 'share';
	
	$self->SUPER::ACTION_build;
}

use File::Path;
sub ACTION_clean {
	my $self = shift;
	
	File::Path::remove_tree('share');
	$self->notes('build_state', '');
	
	# Call system-specific cleanup code
	$self->my_clean;
	
	# Call base class code
	$self->SUPER::ACTION_clean;
}

use File::Copy;
use File::Spec;
sub ACTION_devsetup {
	my $self = shift;
	system qw(git submodule init);
	system qw(git submodule update);
	my $hook_filename = File::Spec->catfile(qw<.git hooks pre-commit>);
	copy 'git-pre-commit-hook.pl' => $hook_filename;
	chmod 0755, $hook_filename;
}

# Reset the tcc source code. This only makes sense if the person has
# src checked out as a git submodule, but then again, the actions for
# which this exists are generally considered author actions anyway.
sub reset_src {
	chdir 'src';
	system qw( git reset --hard HEAD );
	chdir '..';
}

sub ACTION_devclean {
	my $self = shift;
	reset_src;
	$self->ACTION_clean;
}

sub ACTION_devrealclean {
	my $self = shift;
	reset_src;
	$self->ACTION_realclean;
}

# This one's an author action, so I assume they have git and have properly
# configured.
sub ACTION_dist {
	my $self = shift;
	reset_src;



( run in 0.981 second using v1.01-cache-2.11-cpan-8450f2e95f3 )