The major part of the development of Uli SDK is to use Code Generators to generate C++ codes for data records, messages, services, and comp apps. This process significantly reduces development time and cost. Here are the brief descriptions of the process:
- Generate Data Records, the data structures of the messages.
- Generate Messages, messages used in communications between clients and services.
- Generate Services, services include a state machine, a set of input and output messages, internal event, and configurable parameters.
- Generate comp apps, applications includes one or more comps that host services to perform related functionalities.
The code generators are written in Java classes located in the uli_sdk/codegen directory. Before using the code generators, you need to run make to build the Java classes. Three make targets:
- make: make the code generator java classes.
- make clean: clean up the java classes.
- make clean_clean: clean up the java and output directories of the generated codes: records, messages, services, and apps.
For ease of use, there are shell scripts created for each of the generator process:
- gen_record.sh generate data records, output codes are placed in codegen/records.
- gen_message.sh generate messages, output codes are placed in codegen/messages.
- gen_service.sh generate services, output codes are placed in codegen/services.
- gen_app.sh generate comp apps, output codes are places in codegen/apps.
Here are the commands for generating codes:
% ./gen_record.sh <path-to-record-gen-json-file>
% ./gen_message.sh <path-to-message-gen-json-file>
% ./gen_servivce.sh <path-to-service-gen-json-file>
% ./gen_app.sh <path-to-app-gen-json-file>
The JSON file is used to specify how to generate codes. Sections below describe in details of the JSON file. You can find them in the json directories of the apps, services, and messages.