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 a JAR or ZIP file) 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 shared as a JAR or compressed (zip) file.

Identify the files required

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

  • images
  • libraries
  • resource files

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.

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.

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

  • Empty Package
  • Java
  • ZIP
Note: Genero Application Server, Android, iOS, and iOS Simulator are not applicable to Genero Report Writer for Java, C#, PHP, and Swift.
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.
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 *.class *.4rp 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 class files (*.class) are moved from $(ProjectDir)/class into the root directory.
Figure: Moving class files into RootDir

This figure shows the a Java package with directory nodes for 4rp, Class, and Manifest

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.

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?
Java Java Archive (.jar) Deploy using Java
ZIP .zip file Share zipped file