Configure environment for a specific template

When you need a specific setup to build a project at the command line, there are environment variables that must be set.

About this task

An environment set defines the GST setup directory that includes Studio settings and the BAM setup templates and files.

To quickly identify the setup directory for your current Genero Studio configuration, select Tools > Specific setup > Locate setup directory. The directory defined by GSTSETUPDIR is highlighted in the File Browser (the Files view).

If you require a specific setup to build a project, such as a template version prior to the current setup directory, you will need to set an environment for it.

In this task you create a script to set the environment, which you can run whenever you need to use this procedure. You run the script in the command line of a Genero Workplace Window. The environment setup can be for a template included in your GST installation or your own custom template.

  1. Determine which configuration you want to use to build your applications. Select the configuration. Then, select Tools > Genero Configurations.

    The Genero Configuration Management dialog opens.

  2. Find and select the Template Environment Set.

    The BAM templates use the naming convention "Template dbapp*", where * represents the template version number.

    Make a note of the following environment variables and examine their values as these are the ones you will need to work with.
    • GSTSETUPDIR : path to the selected setup directory, ($GSTUSERDIR/tpl/dbapp<version>.<number>)
    • FGLLDPATH : path to the template binary files, ($GSTSETUPDIR/bin)
    • FGLRESOURCEPATH : path to resource files, such as style files, etc., ($GSTSETUPDIR/styles)
    • FGLSOURCEPATH : path to the source files needed for debugging, ($GSTSETUPDIR/src)

    Refer to Genero Business Development Language User Guide for additional information regarding the FGL environment variables.

  3. Click Cancel to discard any accidental changes and close the dialog.
  4. Go to File > New and then Other Files > With no Extension and click OK.
    A new file opens in Code Editor.
  5. Using the elements identified in step 2, create a script to set the environment appropriate for your system from the examples shown.
    Replace <template_name> with the name of the template. If it is a template included in your GST installation, the name is in the form "dbapp<version>"; for example, "dbapp3.2". If your are using a custom template, see Custom Template example.
    • UNIX┬« like OS:
      # Run script to configure environment to use specific template 
      export GSTSETUPDIR=$GSTUSERDIR/tpl/<template_name>
    • Windows┬«:

      If a path contains spaces, it must be in quotes.

      REM Run script to configure environment to use specific template 
      set GSTSETUPDIR=%GSTUSERDIR%/tpl/<template_name>
    Custom Template

    If you are using a template you have created, ensure you have compiled your custom template library. Set absolute paths for the environment variables, and if a path contains spaces in Windows, it must be in quotes.

    For example:

    • UNIX like OS:
      # Run script to configure environment to use custom template 
      export GSTSETUPDIR=<path_to_your_custom_template>
      export FGLLDPATH=<path_to_your_custom_template_lib>:$FGLLDPATH
      export FGLRESOURCEPATH=<path_to_your_custom_template_resource>:$FGLRESOURCEPATH
      export FGLSOURCEPATH=<path_to_your_custom_template_source>:$FGLSOURCEPATH
    • Windows:
      REM Run script to configure environment to use custom template
      set GSTSETUPDIR=<path_to_your_custom_template>
      set FGLLDPATH=<path_to_your_custom_template_lib>;%FGLLDPATH%
      set FGLRESOURCEPATH=<path_to_your_custom_template_resource>;%FGLRESOURCEPATH%
      set FGLSOURCEPATH=<path_to_your_custom_template_source>;%FGLSOURCEPATH%
  6. Save the file, adding the script file extension appropriate for your system.
    It does not matter what name you give the file. Save this new file to a location on disk where you have permissions to execute it. There is no need to insert it in a project.
    • UNIX like OS:
    • Windows:
  7. Click Tools > Genero tools > Genero Workplace Window to open a terminal.
  8. Run the script file by entering the absolute path to it.
    The environment is set up to build your project.

When you have completed the above procedure, from the same Genero Workplace Window terminal run the gsmake command to build your project.

gsmake <path_to_your_project>