| 1 | #!/usr/bin/perl -w |
|---|
| 2 | use strict; |
|---|
| 3 | # |
|---|
| 4 | # Example build class. Copy this file to the equivalent place in your |
|---|
| 5 | # plugin or contrib and edit. |
|---|
| 6 | # |
|---|
| 7 | # Read the comments at the top of lib/TWiki/Contrib/Build.pm for |
|---|
| 8 | # details of how the build process works, and what files you |
|---|
| 9 | # have to provide and where. |
|---|
| 10 | # |
|---|
| 11 | # Requires the environment variable TWIKI_LIBS (a colon-separated path |
|---|
| 12 | # list) to be set to point at the build system and any required dependencies. |
|---|
| 13 | # Usage: ./build.pl [-n] [-v] [target] |
|---|
| 14 | # where [target] is the optional build target (build, test, |
|---|
| 15 | # install, release, uninstall), test is the default. |
|---|
| 16 | # Two command-line options are supported: |
|---|
| 17 | # -n Don't actually do anything, just print commands |
|---|
| 18 | # -v Be verbose |
|---|
| 19 | # |
|---|
| 20 | |
|---|
| 21 | # Standard preamble |
|---|
| 22 | BEGIN { unshift @INC, split( /:/, $ENV{TWIKI_LIBS} ) } |
|---|
| 23 | |
|---|
| 24 | use TWiki::Contrib::Build; |
|---|
| 25 | |
|---|
| 26 | # Declare our build package |
|---|
| 27 | package BuildBuild; |
|---|
| 28 | use base qw( TWiki::Contrib::Build ); |
|---|
| 29 | |
|---|
| 30 | sub new { |
|---|
| 31 | my $class = shift; |
|---|
| 32 | return bless( $class->SUPER::new( "FuncContrib" ), $class ); |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | # Example: Override the build target |
|---|
| 36 | sub target_build { |
|---|
| 37 | my $this = shift; |
|---|
| 38 | |
|---|
| 39 | $this->SUPER::target_build(); |
|---|
| 40 | |
|---|
| 41 | # Do other build stuff here |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | # Create the build object |
|---|
| 45 | my $build = new BuildBuild(); |
|---|
| 46 | |
|---|
| 47 | # Build the target on the command line, or the default target |
|---|
| 48 | $build->build($build->{target}); |
|---|
| 49 | |
|---|