gwabuildtool
The gwabuildtool is a utility to build a GWA application with all the necessary files to run on a browser.
Syntax
gwabuildtool [ options ]
- option can be an option described in Options.
Options
| Option | Short option | Description |
|---|---|---|
--program-dir
directory |
-p |
Directory of program assets such as compiled modules (.42m), compiled form files (.42f) icons, images, web components, and so on. |
--output-dir
directory |
-o |
Directory where the application is created. Default is "gwa_dist" |
--main-module
module_name |
No short option | Name of the main module. The default is "main" |
--extra-asset
directory |
-x |
Add asset outside of program-dir |
--gbc
directory
|
No short option | Directory of the Genero Browser Client. |
--version |
-V |
Displays version information. |
--help |
-h |
Display options for the tool. |
--app-version
version_number |
-a |
Application version number in the format:
?prefix?major.minor.build.suffix? |
--webcomponent
directory
|
-w |
Adds web component from outside the program-dir/webcomponents directory. |
--title
name |
-t |
Title for the web app |
--include
files
|
-i |
Include custom extensions/files in the bundle. Multiple files may be specified separated by
commas. For example, |
--exclude
files
|
-e |
Exclude custom extensions/files in the bundle. Multiple files may be specified separated by
commas. For example, |
--verbose |
-v
|
Display verbose information. |
--W-excluded |
No short option |
Warns about files in the program-dir not copied into the application bundle. |
--app-dir-is-pwd |
No short option | Sets the initial working directory of your GWA application to app in memory instead of the default (home/build_directory_basename). For a usage example and to see how it affects persistence, go to Set initial working directory to app (--app-dir-is-pwd) |
--qa-version |
No short option | Prints a simple version number. |
Usage
To run gwabuildtool, you need to have it in your PATH (see Install Genero Web Application).
The gwabuildtool does not compile .4gl and .per assets, it is assumed that the compilation process has been done already.
For instance, if you have compiled your Genero application in a directory called
myapp with a module main.42m containing MAIN, run
the following command to create a GWA application:
gwabuildtool -p /usr/myapp
A directory called gwa_dist with all the necessary files is created in your
current path. This gwa_dist can be packaged using fglgar gwa (see
Packaging gwa files) and uploaded to a web space and a web server can serve
the application at the URL
https:servername/gwa_dist/index.html.
-o.gwabuildtool -p /usr/myapp -o mydistThis mydist directory can be uploaded to a web space and a web server can
serve the application at the URL
https:servername/mydist/index.html.
Set initial working directory to app (--app-dir-is-pwd)
/app in the browser, so relative paths like
ch.openFile("foo.txt","r") only work if the working directory is set to
/app. Use --app-dir-is-pwd when your program assumes assets are in
the current working directory — for example, the FGL demo launcher, which runs several other
programs and expects each one to access resources relative to the launcher’s working directory.
gwabuildtool --program-dir . --app-dir-is-pwdIf you use the --app-dir-is-pwd option, any files you save in
app will be lost when the application or browser closes. To keep data
persistent, copy files into your home directory
home/build_directory_basename using operations such as os.Path.copy. For details, go to Manage persistence in the file system.