Creating a Package

From RAD Studio
Jump to: navigation, search

Go Up to Creating and Editing Packages


Refer to Understanding the structure of a package for more information about the steps outlined here.

To create a package in Delphi

  1. Choose File > New > Package - Delphi. The generated package appears in the Project Manager. The Project Manager displays a Requires node and a Contains node for the new package.
  2. To add a unit to the Contains clause:
    1. Right-click the Contains node in the Project Manager and select Add.
    2. In the Add Unit page, type a .pas file name in the Unit file name edit box, or click Browse to browse for the file, and then click OK. The unit you've selected appears under the Contains node in the Project Manager.
    You can add additional units by repeating this step.
  3. To add a package to the Requires clause:
    1. Right-click the Requires node in the Project Manager and select Add Reference.
    2. In the Requires page, type a .dcp file name in the Package name edit box, or click Browse to browse for the file, and then click OK. The package you've selected appears under the Requires node in the Project Manager.
    You can add additional packages by repeating this step.
  4. In the Project Manager, right-click your package and select Compile.

To create a package in C++Builder

  1. Choose File > New > Package - C++Builder.
  2. The generated package is displayed in the Package editor.
  3. The Package editor shows a Requires node and a Contains node for the new package.
  4. To add a unit to the Contains list, click the Add to package speed button. In the Add unit page, type a .cpp file name in the Unit file name edit box, or click Browse to browse for the file, and then click OK. The unit you've selected appears under the Contains node in the Package editor. You can add additional units by repeating this step.
  5. To add a package to the Requires list, click the Add to package speed button. In the Requires page, type a .bpi file name in the Package name edit box, or click Browse to browse for the file, and then click OK. The package you've selected appears under the Requires node in the Package editor. You can add additional packages by repeating this step.
  6. Click the Options speed button, and decide what kind of package you want to build.
    • To create a design-time only package (a package that cannot be used at run time), select the Designtime only radio button.
    • To create a runtime-only package (a package that cannot be installed), select the Runtime only radio button.
    • To create a package that is available at both design time and runtime, select the Designtime and runtime radio button.
  7. In the Package editor, click the Compile package speed button to compile your package.
Note: You can also click the Install button to force a make.

See Also