metaonly module xdc.tools.closure.Main

Utility that creates a closed bundle

The purpose of this tool is to build a bundle containing all packages loaded in the process of configuring an application. The bundle is built in a user-selected repository, which can be then relocated to a different location or to a different host, where the application being configured can be recompiled and relinked. [ more ... ]
Configuration settings sourced in xdc/tools/closure/Main.xdc
var Main = xdc.useModule('xdc.tools.closure.Main');
module-wide config parameters
        '[-v] [-f] [-i pkg1 [-i pkg2 ...]] [-d dst_dir] package_base_dir'
    ];
module-wide functions
    Main.exec// xs script entry point(Any args) returns Any
    Main.main// xs shell entry point(Any args) returns Any
per-instance config parameters
    var params = new Main.Params// Instance config-params object;
        params.aggFilter// Perform aggressive filtering = Bool false;
        params.destination// Name of the destination directory = String "";
        params.includes// Additional packages to be included in the bundle = String[] [ ];
        params.verboseFlag// Print informative messages during execution = Bool false;
per-instance functions
    inst.run// Underlying implementation of the command(Cmdr.Instance cmdr, String[] args) returns Any
 
DETAILS
The purpose of this tool is to build a bundle containing all packages loaded in the process of configuring an application. The bundle is built in a user-selected repository, which can be then relocated to a different location or to a different host, where the application being configured can be recompiled and relinked.
The closure tool can run only after xdc.tools.configuro runs and finishes the configuration step. Then, `xdc.tools.closure' detects all packages involved in the configuration and copies them to a new repository. All absolute paths in the relevant generated files that could be accessed by the user's makefile, when the application is rebuilt, are transformed into the paths relative to the the directory containing the closed bundle.
Some files in the copied packages are deleted to keep the size of the closed bundle manageable. The default settings delete only selected files, but a user has an option of requesting aggressive filtering of files, which leaves in the closed bundle only header files and libraries referenced by linker command files.
EXAMPLES
xs xdc.tools.configuro -t gnu.targets.arm.GCArmv6 -o configPkg --cb memory.cfg xs xdc.tools.closure -d D:/bundle C:/examples/memory/configPkg
After xdc.tools.configuro creates a configuration in configPkg, xdc.tools.closure gathers all packages loaded during the configuration in a repository located in D:/bundle
 
config Main.usage  // module-wide

Usage for this command

Configuration settings
Main.usage = String[] [
    '[-v] [-f] [-i pkg1 [-i pkg2 ...]] [-d dst_dir] package_base_dir'
];
 
 
Main.exec()  // module-wide

xs script entry point

Configuration settings
Main.exec(Any args) returns Any
 
DETAILS
This function is called from within other XDCscript scripts and performs the same operations as main() except that, rather than output the return value of inst.run(), this value is simply returned to the caller of exec().
 
Main.main()  // module-wide

xs shell entry point

Configuration settings
Main.main(Any args) returns Any
 
DETAILS
This function
  • creates a no-arg instance, inst, of the module inheriting this interface;
  • parses command line arguments placing all options in the config params of the inheriting module;
  • creates a xdc.tools.Cmdr instance, cmdr;
  • calls inst.run() with the cmdr and any command line command line arguments not parsed as options; and
  • outputs the return result from inst.run()
Instance Config Parameters

Configuration settings
var params = new Main.Params;
// Instance config-params object
    params.aggFilter = Bool false;
    // Perform aggressive filtering
    params.destination = String "";
    // Name of the destination directory
    params.includes = String[] [ ];
    // Additional packages to be included in the bundle
    params.verboseFlag = Bool false;
    // Print informative messages during execution
 
config Main.Params.aggFilter  // instance

Perform aggressive filtering

Configuration settings
var params = new Main.Params;
  ...
params.aggFilter = Bool false;
 
 
config Main.Params.destination  // instance

Name of the destination directory

Configuration settings
var params = new Main.Params;
  ...
params.destination = String "";
 
 
config Main.Params.includes  // instance

Additional packages to be included in the bundle

Configuration settings
var params = new Main.Params;
  ...
params.includes = String[] [ ];
 
 
config Main.Params.verboseFlag  // instance

Print informative messages during execution

Configuration settings
var params = new Main.Params;
  ...
params.verboseFlag = Bool false;
 
 
Main.run()  // instance

Underlying implementation of the command

Configuration settings
inst.run(Cmdr.Instance cmdr, String[] args) returns Any
 
DETAILS
Since this method is used to support both command line tools and other XDCscript scripts, it is important to avoid explicit termination of the JVM via java.lang.System.exit(); doing so precludes callers from handling failures.
Implementations should instead call
generated on Tue, 29 Jul 2014 18:36:52 GMT