Modifying the site<lang>.prp files

About this task

The search path in for site properties is as follows:

site<lang>.prp -> site.prp -> 

As you move from left to right in this search path, properties defined in the files on the left override the same properties defined in files on the right.

Note: Do not modify any of the original factory.prp or language-specific factory<lang>.prp files. Otherwise, you are not able to return to the factory defaults. See Implementing the abstract factory.

To add the new environment as a possible selection for a configuration:

Procedure

  1. Open the site<lang>.prp properties file for each language that the new environment supports.
  2. From the existing site.prp file, create language-specific site<lang>.prp files for each language that the new environment supports. For example, if the environment supports Java, save the file as siteJava.prp.
  3. In the new site<lang>.prp file, insert the following line above the line that contains the end keyword:

    Subject <lang>_CG

    Replace <lang> with CPP for C++, C for C, or JAVA for Java (case sensitive). Repeat for each language.

  4. In the new site<lang>.prp file, add a Metaclass Configuration line and another end line indented between the Subject <lang>_CG and end lines.
  5. From the existing .prp file, copy the Property Environment line from the Metaclass Configuration and paste it into the corresponding location in the new site<lang>.prp file.
  6. Add the new environment to the end of the enumerated values in the Environment property. For example, change the line Property Environment Enum "Microsoft,Vxworks,..." to the following content:

    Property Environment Enum "Microsoft,Vxworks,...,<env>OS"
  7. If the new operating system is the default environment for the respective language, replace the last string in the Environment line with the name of the new environment. For example, change the line Property Environment Enum "Microsoft,VxWorks,...,envOS" "Microsoft" to the following content:

    Property Environment Enum "Microsoft,VxWorks,...,
    <env>OS" "<env>OS"
    For example, if you are creating C++ code generation properties, your siteC++.prp file would now resemble this list:
    Subject CPP_CG
    	Metaclass Configuration
    		Property Environment Enum "Microsoft,VxWorks,Solaris2, Borland, MSStandardLibrary, PsosPPC, MicrosoftWinCE,OseSfk,<env>OS" "<env>OS"
    	end
    end
  8. In the factory<lang>.prp file, find the metaclass for the environment that most closely resembles the new target environment.
  9. Copy the entire metaclass, including its closing end line, into the new site<lang>.prp file, between the closing end statement for the Configuration metaclass and that for the <lang>_CG subject.
  10. Save the new site<lang>.prp file.
  11. Repeat the process for each language.
  12. In the new site<lang>.prp file, rename the copied metaclass to the name of the new operating system:

    Metaclass <env>OS
    Property InvokeExecutable String ...
    end
  13. Modify the InvokeMake property (under <lang>_CG::<Environment>) to use the correct <env>make.bat batch file for the new environment.
  14. Modify each of the code generation properties, especially MakeFileContent and its related properties (described in Defining makefiles) as appropriate for the new environment, replacing any occurrences of the operating system-specific prefix with the corresponding prefix for the new operating system.
    Note: The most important properties for a new environment are the properties that interact with the makefile.
  15. Save the site<lang>.prp file. Repeat for each language.
  16. Restart IBM® Rational® Rhapsody® to load the new site<lang>.prp files.

Feedback