Build Genero archive

Build a Genero Archive for deployment of applications and services.

Once you have created your application and service, the goal of this quick start is to create a Genero Archive (gar) file to deploy your application with the following steps.

Steps

  1. Start the command line interface and set the environment for your Genero BDL using envcomp.
    • On Linux®/macOS™, change to your Genero BDL installation directory and run the script, for example:
      cd /opt/fourjs/fgl
      ./envcomp 
    • On Windows®, change to your Genero BDL installation directory and run the bat file, for example:
      cd "c:\program files\fourjs\fgl"
      envcomp.bat 
  2. Create a new directory for the archive (you can name it "myArchive").
    mkdir myArchive
  3. Navigate to myArchive and create two subdirectories, one called app and one called service.
    Important:

    All your files must be included under one directory. This example shows a valid organization of files. There is no requirement for this other than that all your application files, along with your application configuration (xcf), and MANIFEST file, must sit under one directory.

    mkdir app

    mkdir service

  4. Copy or move your compiled application files (42m and 42f) to these subdirectories.
    1. Copy helloapp.42m and helloapp.42f to the app directory.
    2. Copy helloservice.42m to the service directory.
  5. With a text editor, create the application and service configuration files (xcf).
    1. Copy the configuration shown in the example and save it to helloapp.xcf in the app directory.
      <?xml version="1.0"?>
      <APPLICATION Parent="defaultgwc">
          <RESOURCE Id="log.console.categories">ERROR WARNING INFO</RESOURCE>
          <EXECUTION>
            <PATH>$(res.deployment.path)/app</PATH>
            <MODULE>helloapp.42m</MODULE>
            <ACCESS_CONTROL>
              <ALLOW_FROM>$(res.access.control)</ALLOW_FROM>
            </ACCESS_CONTROL>
          </EXECUTION>
      </APPLICATION>
      
    2. Copy the configuration shown in the example and save it to helloservice.xcf in the service directory.
      <?xml version="1.0"?>
      <APPLICATION Parent="ws.default">
        <EXECUTION>
          <PATH>$(res.deployment.path)/service</PATH>
          <MODULE>helloservice.42m</MODULE>
        </EXECUTION>
      </APPLICATION>
      
  6. With a text editor, create the MANIFEST file, and save it with the name "MANIFEST" (without extension) in the root of your archive directory.
    In the MANIFEST, list the application and service xcf file located in the archive directory, as shown in the example:
    <MANIFEST>
      <APPLICATION xcf='app/helloapp.xcf'/>
      <SERVICE xcf='service/helloservice.xcf'/>
    </MANIFEST>
    
    Figure 1 shows a valid organization of the archive directory.
    Figure: Contents of archive directory

    Screen shot shows contents of the archive directory
  7. Build the Genero Archive file (gar) using the fglgar tool.
    Change to your archive directory and type the command:
    cd myArchive
    fglgar gar --output ../hello.gar
    The hello.gar is created in the parent directory of the archive directory. The gar file is ready to be deployed in a war file.