Tornado API Reference : Project Scripting Library
cmpScriptLib - TCL scripting commands for project manipulation
cmpProjOpen - open a project
cmpProjClose - close the currently open project
cmpProjCreate - create a project and open it
cmpProjCopy - create a copy of an existing project and open it
cmpProjDelete - delete the currently open project
cmpProjHandleGet - get the handle to the currently open project
cmpBuild - build the project
cmpBuildRuleSet - set the build rule for the project
cmpBuildSpecSet - set the active buildSpec
cmpBuildSpecCreate - create a new buildSpec
cmpBuildMacroSet - set a build macro
cmpBuildMacroGet - get a build macro
cmpBuildFlagsAdd - add flags to the build
cmpAdd - add components to vxWorks
cmpRemove - remove components from vxWorks
cmpListGet - get a list of components in vxWorks
cmpParamSet - set a parameter in the current project
cmpParamGet - get a parameter
cmpFileListGet - get a list of files in the project
cmpFileAdd - add a file to the project
cmpFileRemove - remove a file from the project
cmpLoad - dynamically load components
autoscale - automatically scale vxWorks
cmpUnavailListGet - list unavailable components
cmpValidate - validate the component configuration
cmpTest - test the component descriptor files for errors
cmpInfo - get info about a set of components
Tornado comes with a project facility that allows one to graphically organize source files into projects, change the build rules, and configure the operating system. See the Tornado Users Guide for details on what facilities the project facility offers. This library provides a way to perform these tasks in a script. To use this library, one must first source this library from wtxtcl. As an example, suppose you wanted to do a clean build of your project every night. One could write a script as follows:
example.tcl:
source [wtxPath host resource app-config Project cmpScriptLib.tcl] cmpProjOpen myProjectFile.wpj cmpBuild clean cmpBuildOne can execute the script from a UNIX or Windows command shell by typing "wtxtcl example.tcl." Alternatively, one can type the scripting commands directly into the wtxtcl shell.
cmpProjOpen - open a project
This routine opens a project file and sets it as the active project for all subsequent scripting commands. This first closes any project that was previously opened.
prjFile - project file to open
N/A
cmpProjClose - close the currently open project
Close and save the currently open project.
N/A
cmpProjCreate - create a project and open it
This routine creates a project and opens it. If the project already exists, it just opens it. The last argument to this routine is prjType, which can be either vxWorks (a system image project), or vxApp (a downloadable application). The default is vxWorks. The project file to be created must live in a directory which does not already exists, and by convension should end in a .wpj extension.
For vxWorks projects, arg should be the name of a BSP directory in target/config (e.g., pc386) If no project file name is specified, a default project name of $(WIND_BASE)/target/proj/bsp_vx/bsp_vx.wpj is used, where bsp is the name of the BSP directory.
For vxApp projects, arg should be the name of a toolchain, in the form ::tc_CPUTOOL (e.g., ::tc_PPC604gnu).
arg - prjType-specific argument prjFile - name of the project file to be created prjType - type of project (vxWorks or vxApp)
N/A
cmpProjCopy - create a copy of an existing project and open it
Make a copy of an existing project, and open the copy. This is useful if you want to make configuration changes but not disturb the original project. The project file being created has the same restrictions as described in cmpProjCreate.
newPrjFile - project file to create oldPrjFile - existing project file
cmpScriptLib, cmpProjCreate
N/A
cmpProjDelete - delete the currently open project
Delete the currently open project.
N/A
cmpProjHandleGet - get the handle to the currently open project
This routine returns the "project handle" to the currently open project. Since this library supports only one open project at a time, one does not need to use this routine in order to use this library. However this library is built on top of lower-level libraries that must be passed a project handle. These libraries are currently not documented
a project handle
cmpBuild - build the project
This routine builds the project using the currently active buildSpec. The build output goes to stdout and stderr. If no rule is specified, it builds the default rule for the currently active buildSpec. The "clean" rule removes all binaries.
rule - (optional) build rule to invoke
N/A
cmpBuildRuleSet - set the build rule for the project
This routine sets the default build rule for the active buildSpec within the currently open project. Available build rules depend on the project type. For example, vxWorks projects support clean, vxWorks, vxWorks_rom, vxWorks_romResident, and vxWorks_romCompress. vxApp projects support linkedObjs, archive, and objects.
rule - build rule to set
N/A
cmpBuildSpecSet - set the active buildSpec
A project can contain one or more buildSpecs. This routine is used to set the active buildSpec.
build - name of the buildSpec to set as active
N/A
cmpBuildSpecCreate - create a new buildSpec
Create a new buildSpec for the project, and set it as the active buildSpec. One can create a buildSpec by copying an existing buildSpec, or create a new one for a different toolchain. If arg is of the form ::tc_CPUTOOL (e.g., ::tc_PPC604gnu), then a build is created for that toolchain. Otherwise arg is interpreted to be the name of an existing build.
build - name of the buildSpec to create arg - name of a toolchain or existing build
N/A
cmpBuildMacroSet - set a build macro
Set the value of a build macro for the active buildSpec. Build macros include RAM_LOW_ADRS, CFLAGS, etc.
macro - name of the build macro to set value - value to assign the macro
N/A
cmpBuildMacroGet - get a build macro
Get the value of a build macro for the active buildSpec. Build macros include RAM_LOW_ADRS, CFLAGS, etc.
macro - name of the build macro to set value - value to assign the macro
The value of the macro
cmpBuildFlagsAdd - add flags to the build
This routine is just a quick way to append to the build macros CFLAGS and CFLAGS_AS. It could also be acheived using cmpBuildMacro[GS]et
cmpAdd - add components to vxWorks
This routine adds one or more optional vxWorks components to the project. For example, one can "cmpAdd INCLUDE_NFS" to add the NFS client to the vxWorks image. If a folder is specified (e.g., FOLDER_NETWORK), then all default components below that folder are added. The tool will also add any other components needed by the ones being added, as determined by dependency analysis. If the global tcl variable cmpInteractive is set to "true", then the user will be prompted to confirm before the components and dependencies are added.
components - list of components to add
N/A
cmpRemove - remove components from vxWorks
This routine removes one or more optional vxWorks components from the project. For example, one can "cmpRemove INCLUDE_NFS" to remove the NFS client from the vxWorks image. If a folder is specified (e.g., FOLDER_NETWORK), then all components below that folder are removed. The tool will also remove any components that require by the ones being removed, as determined by dependency analysis. If the global tcl variable cmpInteractive is set to "true", then the user will be prompted to confirm before the components and dependencies are removed.
components - list of components to remove
N/A
cmpListGet - get a list of components in vxWorks
This routine returns the list of components in the current vxWorks project.
a list of components
cmpParamSet - set a parameter in the current project
This routine sets the value of a component parameter. For example, the component INCLUDE_IOS has parameter MAX_FDS (max # file descriptors that can be open at once). One can use "cmpParamSet MAX_FDS 60" to increase the value to 60.
N/A
cmpParamGet - get a parameter
This routine gets the value of a component parameter. For example, the component INCLUDE_IOS has parameter MAX_FDS (max # file descriptors that can be open at once). One can use "cmpParamGet MAX_FDS" to get the current value of that parameter.
the parameter value, or an empty string if no such parameter exists
cmpFileListGet - get a list of files in the project
This routine returns the list of source files in the project.
a list of files in the project
cmpFileAdd - add a file to the project
This routine adds a source file to the project
file - full path to the file being added
cmpFileRemove - remove a file from the project
This routine removes a source file from the project
file - full path to the file being removed
cmpLoad - dynamically load components
This routine dynamically loads one or more components to a running target. To use this, you must first be connected to a tgtsvr using wtxToolAttach. This routine will extract all needed object modules from the vxWorks archive, and link them together. It will also build the initialization code needed to initialize the component(s) and all dependent components. It then loads the modules and the initialization code, and calls the initialization code.
Example: To load the vxWorks target shell, do "cmpLoad FOLDER_SHELL"
cmps - components to load mods - (optional) set of additional object modules to load
N/A
cmpScriptLib, wtxToolAttach
autoscale - automatically scale vxWorks
configure vxWorks components based on what is required by the project source files. The default is to tell you what scaling can/should be done, and why. Passing parameter "terse" prints only terse information. Passing paramter "shrink" causes autoscaling to actually be done.
arg - (optional) default is verbose. can also be shrink or terse.
N/A
cmpUnavailListGet - list unavailable components
This routine returns a list of components that are known but not available. A component is not available if it is not installed in the tree (e.g., an optional product), or it requires an unavailable component.
a list of components
cmpValidate - validate the component configuration
Check if the current component configuration is valid. It returns a list of the form {{cmp1 err1} {cmp2 err2} ...} where cmpX is the name of a misconfigured component, and errX is an error string describing what is wrong with the component.
an error list, or an empty string if the configuration is valid.
cmpTest - test the component descriptor files for errors
This routine tests the component descriptor files for semantic errors. For example, it makes sure all components are contained in exactly one folder. It prints all diagnostic information to stdout. This routine is a diagnostic tool for component developers to test that their new components were written correctly. It has two optional parameters. components allows one to restrict the set of components being tested. buildTest allows one to verify that each component can be built individually. The most common reason a component would fail the build test is if the component descriptor does not have a HDR_FILE containing a prototype for the components initialization routine.
components - (optional) list of components to test (default is all) buildTest - (optional) pass any value to see if components can build
N/A
cmpInfo - get info about a set of components
Print basic information about a component, including the subtree (other components required by this component), and supertree (other components that require this component). The subtree and supertree are computed using the engine's dependency analyizer. This routine is primarily used by component authors who want to check on the scalability of their components.
components - list of components to analyze
N/A