metaonly module xdc.bld.Manifest

The manifest object for the release file post-processing model

Each package release corresponds to an archive of a subset of the developent package's contents. The contents of each release are specified by an instance of the Release module. Each instance of the Release module can optionally specify a "release script" that can modify each file prior to it being added to the archive. This script runs in the context of the "release file post-processing" model. [ more ... ]
XDCscript usage meta-domain sourced in xdc/bld/Manifest.xdc
var Manifest = xdc.useModule('xdc.bld.Manifest');
module-wide constants & types
        obj.operation// the JavaScript function to run = Any  ...
        obj.args// additional arguments for operation = Any[]  ...
        obj.newFileName// the new file name = String  ...
        obj.newFileMode// either "r" or "rw" = String  ...
module-wide config parameters
    Manifest.releaseName// The release's name = String undefined;
module-wide functions
 
DETAILS
Each package release corresponds to an archive of a subset of the developent package's contents. The contents of each release are specified by an instance of the Release module. Each instance of the Release module can optionally specify a "release script" that can modify each file prior to it being added to the archive. This script runs in the context of the "release file post-processing" model.
This module is the root of the "release file post-processing" model. Each file in a release may be optionally post-processed by a filter specified in filterMap. Other fields of this module provide a release-specific "context" for the operation of the filters. For example, a filter may use packageName, releaseName, and buildCount to prefix all C sources with comments that identify where they originated.
All the fields of this module (except filterMap) are initialized before a "release script" is run. After the release script completes, the release archive is created according to the filters specifed in filterMap. Files that have no filter are copied without modification into the release.
struct Manifest.Filter

A file filter descriptor

XDCscript usage meta-domain
var obj = new Manifest.Filter;
 
    obj.operation = Any  ...
    // the JavaScript function to run
    obj.args = Any[]  ...
    // additional arguments for operation
    obj.newFileName = String  ...
    // the new file name
    obj.newFileMode = String  ...
    // either "r" or "rw"
FIELDS
operation — a JavaScript function that filters the specified input file and puts the results in specified output file; it is the output file that is archived as part of the release (not the input file).
The operation is called as follows:
		operation(filter, src, dst, base)
where:
filter
the filter object associated with the file being processed (which specified operation as the function to call)
src
input file name (relative to the current working directory)
dst
output file name (relative to the current working directory)
base
string name of the file as it appears in the array Manifest.files; unlike dst, it does not contain a temporary directory name prefix.
args — array of arbitrary arguments passed to operation (as a field of the filter object passed as the first argument to operation)
newFileName — the new name of the output file relative to the top of the archive. Normally this name should include the package's name but, in situations where a release must support a non-RTSC conformant physical design, newFileName can be anything.
newFileMode — the access permissions of the output file. Normally the file will have the access permissions that exist at the time archive is created. However, there may be times when the developer wants/needs to make a file readonly that is (for development purposes) writable. Only two modes are supported "r" (readonly) and "rw" (readable and writable).
SEE
config Manifest.buildCount  // module-wide

A unique build count for the released package

XDCscript usage meta-domain
Manifest.buildCount = String undefined;
DETAILS
This string contains is a decimal number that increments at least once every time the package is released. This string together with the compatibility key forms a unique version number for the package.
READONLY
This value is initialized before the release script or any of its filters are run and should not be modified.
config Manifest.compatibilityKey  // module-wide

The released package's compatibility key

XDCscript usage meta-domain
Manifest.compatibilityKey = String undefined;
DETAILS
This string contains the value declared in the package's package.xdc specification file.
READONLY
This value is initialized before the release script or any of its filters are run and should not be modified.
config Manifest.files  // module-wide

An array of files in the release

XDCscript usage meta-domain
Manifest.files = String[] undefined;
DETAILS
The file names in this array include the package's name; i.e., these names are relative to the package's repository rather than the package's build directory.
This value is initialized before the release script or any of its filters are run, and it contains the the names of the files specified directly or indirectly by the package's build script.
By default, this list does not contain all files in this package release, it excludes files that are commonly copied verbatim into the release (see below). To get the complete list you must call Manifest.getAllFiles.
The excluded files are those that are indirectly included either via
It is possible to remove files from a release by removing it from this array; only files in this array or that are in the specified verbatim directories, the directories named above, will appear in the release. To remove files that are in any of these directories use Manifest.getAllFiles to re-initialize files so that it contains all of the release's files, then selectivly remove the files from this array.
It is also possible to add files to a release by adding files to this array. In fact, files added to the release can be generated by the filter operation specified for the file in filterMap. However, since these files are only present in releases of a package (they are not built as part of the normal build of all files and only appear in installed releases of a package), packages that must be built as part of building this release should not refer to these files.
config Manifest.filterMap  // module-wide

A map of filters for each file in the release

XDCscript usage meta-domain
Manifest.filterMap = Manifest.Filter[string] undefined;
DETAILS
This map is indexed by the name of the file (as it appears in the files array) in the release and defines for each file a filter that is applied to the file before it is archived in a release.
EXAMPLE
The following script fragment illustrates how one can filter all *.c files in a release through a custom JavaScript function named copyright.
      function copyright(args, ...) { ...}

      for (var i = 0; i < Manifest.files.length; i++) {
          var fileName = Manifest.files[i];
          if (fileName.match(/\.c$/) != null) {
              Manifest.filterMap[fileName] = {operation: copyright};
          }
      }
SEE
config Manifest.packageName  // module-wide

The released package's name

XDCscript usage meta-domain
Manifest.packageName = String undefined;
DETAILS
This string contains the value declared in the package's package.xdc specification file.
READONLY
This value is initialized before the release script or any of its filters are run and should not be modified.
config Manifest.releaseName  // module-wide

The release's name

XDCscript usage meta-domain
Manifest.releaseName = String undefined;
DETAILS
This string contains the value declared in the package's package.bld build script; it is the name of the output archive without the ".tar" extension.
READONLY
This value is initialized before the release script or any of its filters are run and should not be modified.
Manifest.getAllFiles()  // module-wide

Read the entire release manifest into the Manifest.files array

XDCscript usage meta-domain
Manifest.getAllFiles(String[] verbatimDirs) returns Void
ARGUMENTS
verbatimDirs — array of strings naming directories relative to the package's base directory. Each directory named in this array (and all the files and sub-directories it contains) is excluded from the Manifest.files array and is automatically added to the release without change.
If this array is null or empty, all files in the release are read into the Manifest.files array.
DETAILS
This function re-reads the release's manifest into the Manifest.files array but only excludes the directories whose names appear in the String array verbatimDirs.
generated on Tue, 24 Aug 2010 15:39:30 GMT