# NAME `wapp` - a utility to manage Fossil Hybrid application packages (.wapp files) # SYNOPSIS ``` wapp create [-h] [-v] -m APPMETA_JSON -s DIR_OR_FILE [DIR_OR_FILE ...] [-l DIR_OR_FILE [DIR_OR_FILE ...]] [-i DIR_OR_FILE [DIR_OR_FILE ...]] [-c DIR_OR_FILE [DIR_OR_FILE ...]] -o OUTPUT_FILE wapp extract [-h] [-v] -o OUTPUT_DIR input_file wapp info [-h] input_file ``` # COMMON OPTIONS `-h, --help` display help information `-v, --verbose` verbose output # COMMANDS ## `create` Pack resources and creates application file. This command can be abbreviated as `c`. ``` wapp create [-h] [-v] -m APPMETA_JSON -s DIR_OR_FILE [DIR_OR_FILE ...] [-l DIR_OR_FILE [DIR_OR_FILE ...]] [-i DIR_OR_FILE [DIR_OR_FILE ...]] [-c DIR_OR_FILE [DIR_OR_FILE ...]] -o OUTPUT_FILE ``` ### Application metadata `-m APPMETA_JSON, --app_meta APPMETA_JSON` Non-optional. Application metadata in `JSON` format. Metadata consists of the type of the app, its version, and display_name. Example `app_meta.json` looks as follows: ```json { "version": "3.1.0", "type": "watchface", "display_name": { "display_name": "Nice Watchface", "theme_class": "static" } } ``` JSON Schema for this file can be found in [the repository](../blob/main/tools/appmeta_schema.py) ### Jerryscript files `-s DIR_OR_FILE [DIR_OR_FILE ...], --script DIR_OR_FILE [DIR_OR_FILE ...], --scripts DIR_OR_FILE [DIR_OR_FILE ...]` Non-optional. Compiled JerryScript file (via `jerry-snapshot`) or directory with such files. This option accepts a single file, multiple files and/or a directory. This option can also be given multiple times. Assuming `a`,`b` and `c` are JerryScript snapshots and the only files in `script` directory, these commands are equivalent: ``` wapp create --script script/a script/b script/c wapp create --script script/a --script script/b --script script/c wapp create --script script/a script/b --script script/c wapp create --script script/* wapp create --script script/ ``` However, there is no check for providing the same file multiple times, so `--script script/a --script script/` will pack file `a` twice, which is undesirable. ### Layout files `-l DIR_OR_FILE [DIR_OR_FILE ...], --layout DIR_OR_FILE [DIR_OR_FILE ...], --layouts DIR_OR_FILE [DIR_OR_FILE ...]` Optional. Layout files used for rendering the app. Layout files are JSON which will be minified before adding to a `.wapp ` file. Similar to `-s` this option can accept multiple files in various forms. ### Image files `-i DIR_OR_FILE [DIR_OR_FILE ...], --image DIR_OR_FILE [DIR_OR_FILE ...], --images DIR_OR_FILE [DIR_OR_FILE ...]` Optional. Image files in supported formats. Image files can be created with [wapp_image](wapp_image). Similar to `-s` this option can accept multiple files in various forms. ### Config files `-c DIR_OR_FILE [DIR_OR_FILE ...], --config DIR_OR_FILE [DIR_OR_FILE ...], --configs DIR_OR_FILE [DIR_OR_FILE ...]` Optional. Application config files. Config files are JSON which will be minified before adding to a `.wapp ` file. Similar to `-s` this option can accept multiple files in various forms. ### Output file `-o OUTPUT_FILE, --output OUTPUT_FILE` Non-optional. Output file (.wapp) This option can also be `-` for STDOUT ## `extract` Extracts resources from `.wapp` file. This command can be abbreviated as `x`. ``` wapp extract [-h] [-v] -o OUTPUT_DIR input_file ``` ### Output directory `-o OUTPUT_DIR, --output OUTPUT_DIR` Output directory. If the directory exists, the tool will warn and extract resources into it; existing files won't be deleted but can be overwritten (if name matches) without a further warning. ### Input file `input_file` Input `.wapp` file ## `info` Prints information about `.wapp` file, including version, type, display_name, and all contents. This command can be abbreviated as `i`. ``` wapp info [-h] input_file ``` # USAGE Example usage: To print information about WAPP file: ``` wapp i myHRApp.wapp ``` To extract a WAPP file: ``` wapp x -o myHRApp myHRApp.wapp ``` To create a WAPP file: ``` cd myHRApp wapp c --app_meta app_meta.json --scripts ./script/ --layouts ./layout/ --images ./image/ -v -o ../myHRApp_repacked.wapp cd .. ``` To get help: ``` wapp -h wapp create -h wapp extract -h wapp info -h ```