Command Line Tool
Tools
The command line version provides all the functions available from the Eclipse IDE but without user interface. It is distributed as an executable JAR file with name CommaSuite-X.X.X.jar where X.X.X encodes the version.
Usage from Command Line
To run the executable jar file it is required to have Java version 11 or higher to be installed. Jar files in general can be run with the following command (args are arguments):
java -jar $jar_filename$ $args$
Arguments
The CommaSuite jar accepts the following arguments:
-l, --location; (required) Location of the .prj file or directory that contains the .prj file
-v, --validation; Turns off validation
-o, --output; Sets output location of the generated files
-r, --run; A list of semicolon (';') separated generator task names that will be executed. If a task in this list depends on other tasks that are not explicitly in the list they will be executed as well. If this argument is not used, all tasks in a project file will be executed.
-s, --skip; A list of semicolon (';') separated generator task names that will not be executed. If a task in this list is required by another task that is not skipped, an error is reported.
Note: Arguments -r and -s cannot be used at the same time.
-mp, --modelpath; A list of directories separated by ';' that contain all the models used in the code generation
-c, --clean; Turns on the cleaning of the output directory before generation. The cleaning is not performed by default.
-h, --help; Shows options
Argument modelpath (mp)
This argument is relevant only if the used models make use of namespace imports. If the models use only explicit file imports this argument is not relevant.
The argument value is a list of semi-colon separated directory paths. These directories have to contain all the models used in the code generators.
When a namespace import is encountered in a model, the collection of the models from the provided directories in the -mp argument will be used to determine the content of the used namespaces.
Example:
java -jar CommaSuite-0.3.0.jar -l Camera.prj -mp C:\workspace\Camera;C:\workspace\Types
Examples
Location
The jar requires you to provide at least a location that can either be the .prj file or a directory in which it can find the .prj file. The location argument can be an absolute or relative path.
java -jar CommaSuite-3.4.0.jar -l C:\IBoss_example\iboss.prj
uses the iboss.prj file for the generation.
java -jar CommaSuite-3.4.0.jar -l C:\IBoss_example\
runs the generation for all .prj files in the directory. In case of multiple .prj files, a separate folder in the output location will be created for each file with name the name of the .prj file. The generated artefacts will be placed in these folders.
Output location
By default the output location is the folder of the provided location argument. The CommaSuite framework will create two folders in the output location: "src-gen" that contains the generated code for the tasks in the .prj file, and "comma-gen" that contains the results of the execution of the monitoring tasks (if any). In order to change the default output location, an output argument can be provided as an absolute or relative path.
java -jar CommaSuite-3.4.0.jar -l C:\IBoss_example\iboss.prj
will use C:\IBoss_example\src-gen\ for generated code and C:\IBoss_example\comma-gen\ for monitoring results.
java -jar CommaSuite-3.4.0.jar -l C:\IBoss_example\iboss.prj -o generated
will use C:\IBoss_example\generated\ as output location
java -jar CommaSuite-3.4.0.jar -l C:\IBoss_example\iboss.prj -o C:\generated\
will use C:\generated\ as output location
Skipping and Selecting Tasks to Run
Consider a project file Example.prj with three generation tasks named t1, t2, and t3. t1 depends on t2 (i.e. uses content provided by t2) and t2 depends on t3.
java -jar CommaSuite-0.4.0.jar -l C:\Example.prj -r t2
will execute both t2 and t3.
java -jar CommaSuite-0.4.0.jar -l C:\Example.prj -s t1
will skip t1 (thus executing t2 and t3).
java -jar CommaSuite-0.4.0.jar -l C:\Example.prj -s t2
results in an error message because t2 is required by t1 which is not skipped. No tasks are executed.
java -jar CommaSuite-0.4.0.jar -l C:\Example.prj -s t1;t2
will skip t1 and t2.
java -jar CommaSuite-0.4.0.jar -l C:\Example.prj -r t1 -s t1;t2
results in an error message because -r and -s cannot be used together. No tasks are executed.
Validation
By default the validation is turned ON. Warnings and errors will be printed to the console. Generation will continue when it encounters warnings but stops when one or more errors are found. Validation can be turned off by using the validation argument.
java -jar CommaSuite-3.4.0.jar -l C:\IBoss_example\iboss.prj -v
turns off validation