!include twikiplugins/WysiwygPlugin/lib/TWiki/Plugins/WysiwygPluginThis will include the WysiwygPlugin in the release package. Note that there is a script in the TWiki tools directory (TWiki 4.2 and later) called check_manifest.pl that can be run at any time to check the contents of your MANIFEST against what is checked into Subversion.
DEPENDENCIESTheDEPENDENCIES file specifies dependencies on other extensions and
perl modules. Each line of the file is a single dependency:
name, version, type, descriptionwhere
$TWIKI_PACKAGES
or $PLUGINS_URL).
Calculating DEPENDENCIESWhen your module (the depender) depends on another module (a dependee), it is important to think carefully about what version of the dependee your module requires. When you are working with TWiki modules (such as contribs and plugins) you should list the version number of the module that you tested with. Normally you will want to use a> condition, so that more recent versions will also work. If a dependency on a TWiki module fails (because the module isn't installed, for example) then the installer script will pull the latest version of the module from TWiki.org, whether that is the required version or not. This is a limitation of the way plugins are stored on TWiki.org.
When you are working with CPAN modules, you need to take account of the fact that there are two types of CPAN modules; built-ins and add-ons.
Built-ins are perl modules that are pre-installed in the perl distribution. Since these modules are usually very stable, it is generally safe to express the version dependency as ">0" (i.e. "any version of the module will do").
Note however that the list of built-in modules is constantly growing with each new release of perl. So your module may be installed with a perl version that doesn't have the required module pre-installed. In this case, CPAN will automatically try to upgrade the perl version! There is no way around this, other than for the admin on the target system to manually install the module (download frm CPAN and build locally). You can help out the admin by expressing the dependency clearly, thus:
File::Find,>0,cpan,This module is shipped as part of standard perl from perl 5.8.0 onwards. If your perl installation is older than this, you should either upgrade perl, or manually install this module. If you allow this installer to continue, it will automatically upgrade your perl installation which is probably not what you want!
ONLYIFA dependency may optionally be preceded by a condition that limits the cases where the dependency applies. The condition is specified using a line that contansONLYIF ( condition ), where condition is a Perl
conditional. This is most useful for enabling dependencies only for certain
versions of TWiki. For example,
TWiki::Rhinos,>=1.000,perl,Required. Download from TWiki:Plugins/RhinosContrib and install. ONLYIF ($TWiki::Plugins::VERSION < 1.025) TWiki::Plugins::CairoContrib, >=1.000, perl, Optional, only required if the plugin is to be run with versions of TWiki before Cairo. Available from the TWiki:Plugins/CairoContrib repository.Thus CairoContrib is only a dependency if the installation is being done on a TWiki where the TWiki::Plugins::VERSION is less than 1.025.
The ONLYIF only applies to the next dependency in the file.
Writing a build scriptThe easiest way to write a new build script is to use thecreate_new_extension.pl script, which is part of the BuildContrib.
pseudo-install.pl script to
soft-link your plugin code into your development TWiki. This script uses the
MANIFEST you write and creates softlinks in your development TWiki that allow
you to run your test code without having to do a full re-install each time you
make a change.
If you have a pre-existing extension, and you want to package it for use with
BuildContrib, then you need to create the module directory and write the
build.pl, MANIFEST and DEPENDENCIES files. The easiest way to do this
is to copy those files from an existing extension in subversion, and modify
them for your extension.
Preparing the InstallerThe installer script generated by the builder when targetrelease is used is based on a template. This template is populated with lists of files and dependencies needed to make the extension-specific installer script.
You can extend this script by providing PREINSTALL, POSTINSTALL,
PREUNINSTALL, and/or POSTUNINSTALL files in the module directory.
These optional files are embedded into the template install script
at the appropriate stage of the installation. Read
lib/TWiki/Contrib/BuildContrib/TEMPLATE_installer.pl (in the BuildContrib)
to see how they fit in. The POD comments in that module indicate the functions
that are most likely to be useful to anyone writing a script extension.
TestingYou are stongly recommended to develop a unit test suite for your extension. Unit tests are kept in thetest/unit/<name> directory for each extension.
To run the unit tests you will need to set up the test environment described
in http://twiki.org/cgi-bin/view/Codev/TestCasesTutorial#SettingUpATestEnvironment. That page also includes extensive information on writing testcases.
The easiest way to generate tests for your extension is to copy the approach taken in another extension. See for example ActionTrackerPlugin and CommentPlugin, which both have extensive test suites.
Tests are run using
Building a releaseWhen you are almost ready to release, you should
Token expansionTherelease target automatically expands certain tokens in .txt files
and in the installer script. The following tokens are supported:
build.pl. For example,
TODO: add code sample here?
UploadWhen you are happy the release package is built correctly, you can upload it.
upload target will upload to TWiki.org. You will be prompted
to enter an alternate upload target, should you require it (e.g. to upload to
private corporate repository). The upload updates the topic and any associated
Var topics published by the extension, and uploads zip, tgz, md5 and installer
files.
Install supportInstaller scripts build by BuildContrib are important for the full functioning of the extensions installer inconfigure.
The installer script shipped with the package is very simple. By default all
it does is to check the dependencies you list, and if necessary download and
install any missing TWiki and CPAN modules. Other dependencies are simply
checked. In TWiki-4.0 and later releases, TWiki topics shipped with the
module are automatically merged into any existing local copies, ensuring
histories are preserved.
If you want your installer to do anything else then you will need to write a POSTINSTALL script.
Installation InstructionsYou are strongly recommended to use this Contrib to help split your code development away from your live TWiki environment, as described above. %$INSTALL_INSTRUCTIONS%Contrib InfoAnother great TWiki extension from the WikiRing - Working together to improve your wiki experience!
|
|
Ideas, requests, problems regarding WikiRing? Send feedback Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.BuildContrib |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||