#!/usr/local/bin/perl -w =head1 NAME build_vcp_executable.pl =head1 SYNOPSIS cd VCP bin\build_vcp_executable.pl =head1 DESCRIPTION Builds vcp binaries using PAR's pp command. Make sure you have all the VCP prereqs installed because pp silently won't include any not found. =cut use strict; use lib "lib"; use VCP::Utils qw( scan_pm_files_in ); use VCP::TestUtils qw( run ); ## VCP uses lazy loading extensively... my @modules = sort( ( scan_pm_files_in( "VCP" ), scan_pm_files_in( "VCP::Source" ), scan_pm_files_in( "VCP::Filter" ), scan_pm_files_in( "VCP::Dest" ), scan_pm_files_in( "VCP::Utils" ), scan_pm_files_in( "VCP::UI" ), ) ); my $exe_name = "vcp.exe"; if ( 1 ) { if ( -e $exe_name ) { unlink $exe_name or die $!; } my @cmd = ( "pp", # "-p", "-o", "vcp.par", "-o", $exe_name, "-lib=lib", map( "--add=$_", @modules ), "bin/vcp" ); warn join( " ", @cmd ), "\n"; system @cmd and die $!; } warn "Testing generated executable\n"; delete $ENV{$_} for grep /p4|perl/i, keys %ENV; my $ok = 1; { my $zip_list = "<NO WZUNZIP.EXE OUTPUT>\n"; eval { run [ "wzunzip", "-v", $exe_name ], \undef, \$zip_list; warn "DB_File.pm not in $exe_name, patch the pp perl script\n" unless $zip_list =~ /DB_File\.pm/; 1; } or do { $ok = 0; warn $@, $zip_list; } } unless ( -e "tmp" ) { mkdir "tmp" or die "$!: tmp/"; } use File::Spec; my $abs_exe_name = File::Spec->rel2abs( $exe_name ); chdir "tmp" or die "$!: tmp/"; { my $vcp_output = "<NO VCP.EXE OUTPUT>\n"; eval { run [ $abs_exe_name, "help" ], \undef, \$vcp_output; 1; } or do { $ok = 0; warn $@, $vcp_output; } } die "$exe_name fails test(s).\n" unless $ok; print "$exe_name seems ok, please test in a real application.\n";
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#11 | 4235 | Barrie Slaymaker | - experimental dist/vcp.pl added | ||
#10 | 4164 | Barrie Slaymaker | - dist/vcp-rh8 checked in | ||
#9 | 4154 | Barrie Slaymaker | - dist/vcp.exe passes almost all tests | ||
#8 | 4143 | Barrie Slaymaker | - Further adaptation to vcp.exe packaging format | ||
#7 | 4142 | Barrie Slaymaker | - vcp.exe now comes hardcoded with the modules packed in it | ||
#6 | 4132 | Barrie Slaymaker |
- build_vcp_executable.pl now tests vcp.exe a bit - requires WINZIP command line utility WZUNZIP.EXE in the PATH - vcp.exe should now have all required modules |
||
#5 | 4126 | Barrie Slaymaker |
- Comments with leading hyphens and embedded quotes are now tested for - VCP::Dest::cvs now handles comments with embedded double quotes on Win32 |
||
#4 | 4082 | Barrie Slaymaker |
- dist/vcp.exe now exists for testing - online help and config file commenting are broken still |
||
#3 | 4012 | Barrie Slaymaker | - Remove dependance on pseudohashes (deprecated Perl feature) | ||
#2 | 4007 | Barrie Slaymaker | - bin/* are now all executable | ||
#1 | 3642 | Barrie Slaymaker | - First cut at PAR based script to build vcp.exe |