bazep_dep(name = "rules_ecu_config", version = "1.0.3")Bazel ruleset for configuring ECU projects.
ecu_config = use_extension("@//:doc/rules_ecu_config_doc.bzl", "ecu_config")
ecu_config.tools(cfg6_path, cfg6_sha256, cfg6_url, dvarjson_path, dvarjson_sha256, dvarjson_url)
ecu_config.project(as_code, bsw_pkg, creation_file, diag_modules, dvjson, evs, extract, modules,
update_switches)
Module extension for using a DaVinci project in the Bazel pipeline.
TAG CLASSES
DaVinci tools used for ECU configuration.
Attributes
Creates a DaVinci project for configuring an ECU and generating the BSW code.
To Bazel the project is made available as repo named like the used dvjson file or the project name given in the creation_file.
E.g., for a file named MyProject.dvjson a repo named MyProject is created.
Import the repo with use_repo(ecu_config, "MyProject").
Attributes
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| as_code | List of as-code .jar files. Each .jar must be tagged with as_code_eac. The .jar files are applied in the order given here. |
List of labels | optional | [] |
| bsw_pkg | The BSW package folder. | Label | required | |
| creation_file | Project creation file containing general settings. The project name given in this file is taken as repo name. Mutually exclusive with dvjson. |
Label | optional | None |
| diag_modules | Diagnostic module .arxml or .json files to import. | List of labels | optional | [] |
| dvjson | The existing .dvjson file. This file's name is taken as repo name. Mutually exclusive with creation_file. |
Label | optional | None |
| evs | EvaluatedVariantSet (either one .json file or .arxml files). | List of labels | optional | [] |
| extract | ECU extract .arxml files. | List of labels | optional | [] |
| modules | Module .arxml files to import. | List of labels | optional | [] |
| update_switches | String consisting of all switches to apply when running the "project update" command (defaults to "" meaning perform all updates). E.g.: "asr" will only run "automatic reference correction", "solve all" and "RTE config update". The following switches are available:a: Perform automatic correction of unresolved or inconsistent references.s: Perform 'solve all' by executing all recommended solving actions of the project.c: Apply changes from project input files.r: Apply changes to the RTE configuration.e: Apply changes from evaluated variant set. |
String | optional | "" |
The following targets and rules are available from a DaVinci project repo:
- Use
bazel run @MyProject//:open_configuratorto open the project in DaVinci Configurator Classic Version 6. - Use
bazel build @MyProject//:validateto validate the project.
load("@MyProject", "eac_jar")
eac_jar(*, name, deps, srcs, data, resources, add_exports, add_opens, allow_beta_api, bootclasspath,
javacopts, licenses, neverlink, plugins, runtime_deps, tags, visibility)
Macro for setting up an EaC project resulting in 3 targets (<name> = name provided to the macro):
<name>for use in as_code.<name>_jarfor building the actual .jar file containing the EaC logic (required for IDE support).<name>_dbgfor debugging the EaC logic.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this macro instance. Normally, this is also the name for the macro's main or only target. The names of any other targets that this macro might create will be this name with a string suffix. | Name | required | |
| deps | See Java Rules. | List of labels; nonconfigurable | optional | [] |
| srcs | The list of source files that are processed to create the target. This attribute is almost always required; see exceptions below. Source files of type Source files of type Rules: if the rule (typically Source files of type All other files are ignored, as long as there is at least one file of a file type described above. Otherwise an error is raised. This argument is almost always required, except if you specify the |
List of labels | optional | None |
| data | The list of files needed by this library at runtime. See general comments about data at Typical attributes defined by most build rules. When building a |
List of labels | optional | None |
| resources | A list of data files to include in a Java jar. Resources may be source files or generated files. If resources are specified, they will be bundled in the jar along with the usual |
List of labels | optional | None |
| add_exports | Allow this library to access the given module or package. This corresponds to the javac and JVM --add-exports= flags. |
List of strings | optional | None |
| add_opens | Allow this library to reflectively access the given module or package. This corresponds to the javac and JVM --add-opens= flags. |
List of strings | optional | None |
| allow_beta_api | Set to "true" to use beta API. | Boolean; nonconfigurable | optional | None |
| bootclasspath | Restricted API, do not use! | Label | optional | None |
| javacopts | Extra compiler options for this library. Subject to "Make variable" substitution and Bourne shell tokenization. These compiler options are passed to javac after the global compiler options. |
List of strings | optional | None |
| licenses | - | List of strings | optional | None |
| neverlink | Whether this library should only be used for compilation and not at runtime. Useful if the library will be provided by the runtime environment during execution. Examples of such libraries are the IDE APIs for IDE plug-ins or tools.jar for anything running on a standard JDK. Note that If the runtime library differs from the compilation library then you must ensure that it differs only in places that the JLS forbids compilers to inline (and that must hold for all future versions of the JLS). |
Boolean | optional | None |
| plugins | See Java Rules. | List of labels; nonconfigurable | optional | [] |
| runtime_deps | Libraries to make available to the final binary or test at runtime only. Like ordinary deps, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. Dependencies needed only at runtime should be listed here. Dependency-analysis tools should ignore targets that appear in both runtime_deps and deps. |
List of labels | optional | None |
| tags | See common attributes. | List of strings; nonconfigurable | optional | [] |
| visibility | The visibility to be passed to this macro's exported targets. It always implicitly includes the location where this macro is instantiated, so this attribute only needs to be explicitly set if you want the macro's targets to be additionally visible somewhere else. | List of labels; nonconfigurable | optional |
load("@MyProject", "export")
export(*, name, args, binding_time, exporter, split_post_build_variants, split_pre_build_variants,
visibility)
Rule for exporting data from the DaVinci project.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this macro instance. Normally, this is also the name for the macro's main or only target. The names of any other targets that this macro might create will be this name with a string suffix. | Name | required | |
| args | Exporter-specific arguments. | List of strings | optional | [] |
| binding_time | Binding time to use for the export. | String | optional | "" |
| exporter | Exporter ID. A list of all IDs is available via the export list command of the DaVinci Configurator Classic CLI. |
String | required | |
| split_post_build_variants | Generate separate output for each post-build variant. | Boolean | optional | False |
| split_pre_build_variants | Generate separate output for each pre-build variant. | Boolean | optional | False |
| visibility | The visibility to be passed to this macro's exported targets. It always implicitly includes the location where this macro is instantiated, so this attribute only needs to be explicitly set if you want the macro's targets to be additionally visible somewhere else. | List of labels; nonconfigurable | optional |
load("@MyProject", "flat_extract")
flat_extract(*, name, args, binding_time, exporters, split_post_build_variants,
split_pre_build_variants, visibility)
Rule for exporting a flat ECU extract from the DaVinci project.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this macro instance. Normally, this is also the name for the macro's main or only target. The names of any other targets that this macro might create will be this name with a string suffix. | Name | required | |
| args | Exporter-specific arguments. | List of strings | optional | [] |
| binding_time | Binding time to use for the export. | String | optional | "" |
| exporters | Exporter IDs. A list of all IDs is available via the export list command of the DaVinci Configurator Classic CLI. |
List of strings | required | |
| split_post_build_variants | Generate separate output for each post-build variant. | Boolean | optional | False |
| split_pre_build_variants | Generate separate output for each pre-build variant. | Boolean | optional | False |
| visibility | The visibility to be passed to this macro's exported targets. It always implicitly includes the location where this macro is instantiated, so this attribute only needs to be explicitly set if you want the macro's targets to be additionally visible somewhere else. | List of labels; nonconfigurable | optional |
load("@MyProject", "generate")
generate(*, name, excluded, ext_steps, keep_tmp_files, modules, no_save, skip_up_to_date_checks,
type, visibility)
Rule for generating the BSW code.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this macro instance. Normally, this is also the name for the macro's main or only target. The names of any other targets that this macro might create will be this name with a string suffix. | Name | required | |
| excluded | Modules to exclude from generation, given either by definition (e.g. "/MICROSAR/Rte") or short name (e.g. "Rte"). | List of strings | optional | [] |
| ext_steps | External generation steps to execute, given by name. Defaults to executing all steps. | List of strings | optional | [] |
| keep_tmp_files | Keep temporary files created during generation. | Boolean | optional | False |
| modules | Modules to generate, given either by definition (e.g. "/MICROSAR/Rte") or short name (e.g. "Rte"). Defaults to generating all modules. | List of strings | optional | [] |
| no_save | Prevent saving the project to disk. | Boolean | optional | False |
| skip_up_to_date_checks | Run validation and generation without performing up-to-date checks. | Boolean | optional | False |
| type | Generation target ("REAL" or "VTT"). | String | optional | "" |
| visibility | The visibility to be passed to this macro's exported targets. It always implicitly includes the location where this macro is instantiated, so this attribute only needs to be explicitly set if you want the macro's targets to be additionally visible somewhere else. | List of labels; nonconfigurable | optional |
load("@MyProject", "swct")
swct(*, name, args, components, keep_tmp_files, no_save, visibility)
Rule for generating SWC templates and contract phase headers.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this macro instance. Normally, this is also the name for the macro's main or only target. The names of any other targets that this macro might create will be this name with a string suffix. | Name | required | |
| args | Arguments for certain generators given in the form ":" where is a module definition (e.g. "/MICROSAR/Rte") or short name (e.g. "Rte"). | List of strings | optional | [] |
| components | Software components for which a template and/or contract phase header will be generated, given by name specified in the project settings. | List of strings | optional | [] |
| keep_tmp_files | Keep temporary files created during generation. | Boolean | optional | False |
| no_save | Prevent saving the project to disk. | Boolean | optional | False |
| visibility | The visibility to be passed to this macro's exported targets. It always implicitly includes the location where this macro is instantiated, so this attribute only needs to be explicitly set if you want the macro's targets to be additionally visible somewhere else. | List of labels; nonconfigurable | optional |