To create a package the program mkpkg can be used. The set of files to put into the package should be in the desired location in the $(StudioDir) directory. The mkpkg command should be run with $(StudioDir) as the working directory and all files to go into the package must be refered to using relative paths. A package must have a package description file that is placed in the $(StudioDir)/packages directory. The package description file name must end with _package.xml. If a package is to create entries in the new project wizard then it must have a file name project_templates.xml.
For example a package MyNewTarget would supply the following files.
- A project template file called targets/MyNewTarget/project_templates.xml.
- The $(StudioDir) relative files that define the functionality of the package.
- A package description file called packages/MyNewTarget_package.xml.
The package file MyNewTarget.hzq would be created using the following command line
mkpkg -c packages/MyNewTarget.hzq targets/MyNewTarget/project_templates.xm .. packages/MyNewTarget_package.xml
You can list the contents of the package using the -t option
mkpkg -t packages/MyNewTarget.hzq
You can remove an entry from a package using the -d option
mkpkg -d packages/MyNewTarget.hzq -d fileToRemove
You can add or replace a file into an existing package using the -r option
mkpkt -r packages/MyNewTarget.hzq -r fileToAddOrReplace
You can automate the package creation process using a Combining project type.
- Using the new project wizard create a combining project in the directory $(StudioDir).
- Set the Output File Path property to be $(StudioDir)/packages/mypackage.hzq
- Set the Combine command property to $(StudioDir)/bin/mkpkg -c $(CombiningOutputFilePath) $(CombiningRelInputPaths)
- Add the files you want to go into the package into the project using the project explorer.
- Right click on the project node in the project explorer and build.
When a package is installed the files in the package are copied into the desired $(StudioDir) relative locations. When a file is copied into the $(StudioDir)/packages directory and it's filename ends with _package.xml the file $(StudioDir)/packages/installed_packages.xml is updated with an entry
<include filename="MyNewTarget_package.xml">.
During development of a package you can manually edit this file. The same applies to the file $(StudioDir)/targets/project_templates.xml which will contain a reference to your project_templates.xml file.
Usage:
mkpkg [options] package file1 file2 ..
Options | |
-c |
Create a new package. |
-d |
Remove files from a package. |
-r |
Replace files in a package. |
-t |
List the contents of a package. |
-v |
verbose. |
-V |
show verbose. |