The aim of this task is to provide a solution(schema + validation) for SDK data annotation and validation. It is an integral part of SDK generator solution.
We expect that with this all developers should be able to
After some research and experiment, we will use json schema. Here is https://json-schema.org/.
The json schema draft 07 version is used to do the work.
The SDK yml data schemas(70% completed) are here.
The validation codes are enabled in feature/SDKGEN-1390-sdk-yml-data-schema-and-validation-implementation-integratoin
Now the data validation will be the first and mandatory steps for any generator cmds run. Data record which violates the schemas will be reported as “errors”.
Generator also supports direct “data_validate” cmd that just validating the data.
For example, if you run ruby sdk_frdmk64.rb -c data_validation(Please comment the -c project in that rb), you will get error logs like
- The property '#/component_info/common' did not contain a required property of 'full_name' in schema D:/git_sdk2.x_featuretry/mcu-sdk-2.0/bin/generator/sdk_generator/data/sdk_data_schema/definitions_schema.yml#
- The property '#/component_info/common' did not contain a required property of 'description' in schema D:/git_sdk2.x_featuretry/mcu-sdk-2.0/bin/generator/sdk_generator/data/sdk_data_schema/definitions_schema.yml#
The left work about the schemas:
When the schemas are 100 percent,detailed training and introduction to all SDK developers.
Generator has supported project generation for CodeWarrior Development Studio. This feature is mainly for Nevis3 SDK development and integration.
The yml prototype has been prepared in release/2.7.0_nevis3_ear branch, the generator branch is develop/mcu_sdk_generator.
Here is an validation demo hello_world. You can run batch command after putting source code into repo.
Here is an example:
After project generated, you can import the project into your workspace, just a kinder reminder, do not select "Copy projects into workspace" option.
After building successfully please select correct debug configuration to debug your project.
When import a project into mcux, there are two kinds of preojects depends on whether "Copy Sources" checkbox being cheked:
Preinclude files worked only with copied project in the past. Now both types can be supported at the same time.
The default setting is copy sources type. You can add an additional attribute "linked_support: true" for the file to enable the feature.
Sometimes you just want to remove single flag, "__remove__" tag can be used.
Further more, if single flag needs to be replaced, you can firstly use "__remove__" to remove them and then add a new one. Thus other flags will not be affected comparing with "__replace__".
Note: You must add flag node as "__remove__" 's sub-node first, then add the flag to be removed under the flag node. Don't try to remove an item as this way:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.