Main Site Contents Up Previous Next

Project Functions


Cava::Packager::MapFile($filepath);

my $filepath = Cava::Packager::MapFile('C:\some\path\tofile.doc');

You can use this function to record external datafiles used during development. These files will be packaged with your application and at runtime the function will return a path to the packaged file.

This function is an alternative or an addition to creating a Resource Path where the files you require exist in other locations in your filesystem and you require a snapshot of the file at packaging time to be distributed with your application.

You can view and amend the list of files mapped this way using the Mapped Files node of the project tree.

Cava Packager also provides an importable short alias for this function.

use Cava::Packager qw( CMF );
my $filepath = CMF('C:\some\path\tofile.doc');

Before you can use this function you must also call at some prior point in your code:

Cava::Packager::SetProjectPath('/user/myname/pathto/cavaproject');


Cava::Packager::RecordRequire();

Cava::Packager::RecordRequire();

You can use this function once in your code to switch on recording of all modules 'used' or 'required' in your code. This list of modules is then used as an addition to the text scan of your project scripts when your project is built.

You can view and amend the list of modules recorded by using the Recorded Requires node of the project tree.

Before you can use this function you must also call at some prior point in your code:

Cava::Packager::SetProjectPath('/user/myname/pathto/cavaproject');


Cava::Packager::SetProjectPath();

Cava::Packager::SetProjectPath('/user/myname/pathto/cavaproject');

Some functions in Cava::Packager require that you set the path to your project folder before they can be used.This is so that they can either save information or query the project for information. The path you provide should be to your project directory.

For example, if you have the following project file:

'/user/someproject/cava20.cpkgproj'

the call ...

Cava::Packager::SetProjectPath('/user/someproject');

should be used to set the project directory.





Contents Up Previous Next


Cava Packager Copyright © 2006-2012 Mark Dootson