#!/usr/bin/perl # Copyright 2006, Michael Allan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Textbender Software"), to deal in the Textbender Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Textbender Software, and to permit persons to whom the Textbender Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Textbender Software. THE TEXTBENDER SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE TEXTBENDER SOFTWARE OR THE USE OR OTHER DEALINGS IN THE TEXTBENDER SOFTWARE. use strict; use warnings; =pod =head1 DESCRIPTION Demonstration build of textbender. =head1 SYNOPSIS build clean build [I] build --help | --man =head1 ARGUMENTS =over 8 =item B Builds the demo. This is the default argument. =item B Builds the boot jar, textbender.a.r.page.BootApplet.jar. Returns the jar file name. =item B Deletes all build files. =back =cut { use textbender::a::b::Config qw( do_fail ); my $config_path = 'textbender/a/b/demo/build_config.pl'; do $config_path or do_fail $config_path; } sub _shift_options(); # # Shifts command line options into %textbender::a::b::Build::option. # { _shift_options; my $argument = shift; defined $argument or $argument = 'demo'; my $sub_name = 'textbender::a::b::demo::Demo::build_' . $argument; { no strict 'refs'; use textbender::a::b::demo::Demo(); &$sub_name(); } } =pod =head1 OPTIONS =over 8 =cut sub _shift_options() { use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); use textbender::a::b::Build qw( %option ); use textbender::a::b::Console qw( $verbosity ); my @specification; push @specification, 'help|?'; =pod =item --B Outputs a brief help message and exits. =cut push @specification, 'man'; =pod =item --B Outputs the full manual page and exits. =cut push @specification, 'sign!'; $option{'sign'} = 1; # default =pod =item --B | --B Specifies whether or not to sign the jars. By default, jars are signed. =cut push @specification, 'verbose'; =pod =item --B Increases the level of console output. =cut Getopt::Long::GetOptions( \%option, @specification ) or pod2usage( -verbose => 0 ); # and exits defined $option{'help'} and pod2usage( -verbose => 1 ); # and exits defined $option{'man'} and pod2usage( -verbose => 2 ); # and exits defined $option{'verbose'} and $verbosity = 1; } =pod =back =cut