Previous Topic Next topic Print topic


To create a custom project template

You can create your own project templates to use in the IDE to create applications.

A custom template is actually an existing project so, first, you need to create and configure a project that includes required source files and settings. You can store the project in a dedicated templates folder on your machine (or a folder in your source control system). Once you have created your custom template, you need to configure your IDE to search for templates in your templates folder.

Note: A project template can only be used to produce projects of the same project type.

To create a project to use as a custom template:

  1. In the IDE, create a project of the desired project type.
  2. Add existing files to the project or add new ones to it, and add the required source code to them.
  3. Configure the project and the file properties.
  4. Build the project and ensure there are no build errors.

    The project is stored in a subfolder of the current workspace. This subfolder includes the source programs and the build output, the .project file and some other files with information about the project and the build and debug configurations.

To save the project in a templates folder:

  1. On your file system, navigate to the project folder in your workspace.
  2. If you do not want to distribute the build output files (such as .gnt, .dll, exe) as part of the template, either delete the output folder or the individual files.
  3. Copy and paste the project folder into your templates folder (such as c:\myprojecttemplates).

Instead of saving the project in the templates folder in this way, you could export it from the IDE as follows:

  1. In the IDE, select your project in the PL/I, COBOL Explorer or Team Developer Tree view.
  2. Click File > Export.
  3. In the Export dialog box, expand General, click File System, then click Next.
  4. Ensure the check box for your project is enabled in the left-hand pane.
  5. In the right-hand pane, ensure you have selected only the source files and not the output files.
  6. In the To directory field, specify the path to your dedicated templates folder (c:\myprojecttemplates).
  7. Click Finish.

    This stored the project file and the selected source files in your templates folder.

Note: It is a good practice to use a single folder to store all of your templates. You can use any subfolder structure within that location. When you want to use the templates, you need to configure the IDE preferences to search for templates in the templates folder. The IDE will scan all subfolders of the templates folder, and will display the relevant project and file types in a tree structure.
Previous Topic Next topic Print topic