Creating a package

To create a package from Genero Studio, you must define a package node with one or more child directory nodes.

The package node defines the target platform (such as the Genero Application Server (GAS) or a mobile device) for the package. A package node will contain at least one directory node. The directory nodes identify where the application files can be found and how they should be organized when written to the package.

A package node creates a single package. You must have a package node for each package you need to create.

To create a package from Genero Studio:

  1. Identify the target platform.
  2. Identify the files required by the application.
  3. Add a package node.
  4. Add directory nodes.
  5. Build the package.

Identify the target platform

Each package is designed for a specific platform. A package will eventually be deployed to the GAS, installed on an Androidâ„¢ or iOS device, or shared as a compressed (zip) file.

Each target platform has its own rules and requirements around how to organize the files in a package. Some target platforms require additional configuration; for example, a GAS package may require environment variables to be set in the application configuration file.

Identify the files required

All applications have binaries that must be included in the package. An application may require other files, such as:

  • fglprofile
  • database files
  • images
  • libraries
  • resource files (such as topmenu, toolbar, or presentation styles files)
  • webcomponent files
  • application configuration files (GAS package only)

Identify which files are needed for the application, and where the files are located.

Tip: To find the location of a file in your project, select the file in the Projects view and look at its File path property. External files and libraries may not be listed in the Projects view; to find their location, examine the values of environment variables such as GSTSETUPDIR, GREDIR, PATH, FGLLDPATH, FGLRESOURCEPATH, and FGLIMAGEPATH.

Add a package node

A package node defines the package basics. It specifies the target platform and some package base directories.

The package node is the parent node in the package definition. It specifies the target platform; each target platform must have its own package node. A package node contains one or more directory nodes, as shown in Figure 1.

Figure: Example package node

This figure shows a ZIP package for a Hello World project.
Note: If you created the project using pre-configured project types, you may already have default package and directory nodes.

To add a package node, right-click a group node in the Projects view. Select New package and then the target platform:

  • Empty Package
  • Genero Application Server
  • Android
  • iOS
  • iOS Simulator
  • Java
  • ZIP

The target platform determines the default values of the package node properties. Certain target platforms also create a default directory structure; see Package and directory nodes (GAS) and Package and directory nodes (mobile).

Within the package node properties, define these properties:
Root directory
Base directory containing the files to be included in the package. The target platform has rules on what structure is allowed and expected. The top-level directory in this structure is known as the Root directory (RootDir). All files to be included in the package must sit under the Root directory.
You can organize different types of files in sub-directories under the RootDir. For example, you can have a bin directory for your binaries, and a resources directory for your resource files. Using sub-directories is not required; you can place all of the files into a single folder.
The default root directory is $(ProjectDir)/bin.
Distribution directory
Directory where the package is written. The default distribution directory is $(ProjectDir)/distbin.
ID
ID for the package.
Label
Label displayed to the user.
Important: Ensure that all dependencies to other libraries or applications are included. To see dependencies, right-click on the package node and select Advanced Properties. All dependencies are compiled before the build; if they are not included in the package, this can cause unexpected results. See Using external projects for further information about external files and dependencies.

Add directory nodes

A directory node specifies the directory where application files sit (the source of one or more application files) and where they will be written to within the package. You create a directory node for each directory that houses needed application files.

Directory nodes are children of the package node. A package must have at least one directory node.

To add a directory node, right-click on the Package node and select New Directory.

To configure a directory node, define these properties:

Source directory
Directory containing the files to be included in the package, such as binary files or compiled form files.
Destination directory
Directory where the application resources will be written to, within the package. The destination directory must be within the root directory (defined in the package node). The default destination directory is the root directory ($(RootDir)).
Included files
Files to include in the package. For example, specify *.42f *.42m to include only files that match these types. By default, all files are included.
Excluded files
Files to exclude from the package. By default, no files are excluded.
Recursive
If selected, the files are searched recursively in the sub directories.
Figure 2 shows an example where images such as .png files are moved from $(ProjectDir)/images into the root directory.
Figure: Moving images into RootDir

This figure shows the default Root directory structure for a GAR package.

To include an external file or a library binary file:

  • Add a directory node.
  • Set the Source directory property to the path where the file sits. The path can be defined using environment variables.
  • Set the Included files to the name of the file.

For example, if the application uses the library libgre.42x located in the lib subdirectory of GREDIR, create a directory node with Source directory set to $(GREDIR)/lib/ and Included files set to libgre.42x.

To exclude the directory from the package build without deleting it, select Exclude from package.

Build the package

Right-click on the package node and select Build. The package is saved in the distribution directory. The file name is the name of the package node. The file type depends on the platform, as described in Table 1.

Table 1. Packages built for target platforms
Target platform Packaged file What to do next?
Genero Application Server Genero archive file (.gar) Deploy the package to the GAS
Android AAB (Android App Bundle) package (.aab)
Important: Google Play requires an AAB package.

APK (Android Package Kit) package (.apk)

Distribute the Android app
iOS or iOS Simulator iOS App Store Package (.ipa) Distribute the iOS app
Java Java Archive (.jar) Deploy using Java
ZIP .zip file Share zipped file