Skip to content

Commit 8ecff15

Browse files
authored
Setup repo (#1)
1 parent c60c4ea commit 8ecff15

57 files changed

Lines changed: 7466 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Configure Bazel to trust any self-signed SSL certificates.
2+
# startup --host_jvm_args=-Djavax.net.ssl.trustStore='<truststore>'
3+
4+
build --java_runtime_version=remotejdk_21
5+
6+
build --action_env=LOCALAPPDATA
7+
build --action_env=APPDATA
8+
build --action_env=TEMP
9+
build --action_env=TMP
10+
build --action_env=USERPROFILE
11+
12+
# Configure bazel to use Vector's and Bazel Central Registry for fetching external dependencies.
13+
common --registry=https://raw.githubusercontent.com/vectorgrp/bazel-registry/main
14+
common --registry=https://bcr.bazel.build

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
ij_continuation_indent_size = 8
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[*.bat]
16+
end_of_line = crlf
17+
18+
[*.cmd]
19+
end_of_line = crlf
20+
21+
[*.{arxml,json}]
22+
indent_size = 2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bazel-*
2+
!bazel-starter/

MODULE.bazel

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
###############################################################################
2+
# MODULE.bazel
3+
# Purpose: Bazel build rules for configuring ECUs using DaVinci Configurator Classic Version 6.
4+
# Author: Vector Informatik GmbH
5+
###############################################################################
6+
bazel_dep(name = "rules_ecu_config", version = "1.0.2")
7+
bazel_dep(name = "rules_cfg6", version = "1.0.1")
8+
9+
# Import the BSW package as a local repository.
10+
bsw_pkg = use_repo_rule("//bazel-starter:helpers.bzl", "bsw_pkg")
11+
bsw_pkg(
12+
name = "bsw_package",
13+
# Provide the path to the BSW package folder.
14+
path = "<BswPackage>",
15+
)
16+
17+
ecu_config = use_extension("@rules_ecu_config//:ecu_config.bzl", "ecu_config")
18+
19+
# DaVinci Configurator Classic Version 6 is used for ECU configuration.
20+
# DaVinci-AUTOSAR-JSON is used for diagnostic data and variants.
21+
# Other versions of these tools are supported as well.
22+
# To use a different version, update <cfg6_url>, <dvarjson_url>, <dvarjson_sh256> and <cfg6_sh256>.
23+
ecu_config.tools(
24+
cfg6_sha256 = "1D676D52E4A649AFA78D8C9482730E66A94472241D54D3ADBC0F82BB25E77E82",
25+
cfg6_url = "https://packages.vehub.vector.com/apt/pool/generic/vector-davinci-configurator-classic/6.2.1/vector-davinci-configurator-classic-6.2.1.deb",
26+
dvarjson_sha256 = "38D3E30EF6092C31D2F0E37747130684DFC77C4E8E94850D0FEA326BF8B7706F",
27+
dvarjson_url = "https://packages.vehub.vector.com/apt/pool/generic/vector-davinci-autosar-json/1.1.0/vector-dvarjson-1.1.0-amd64.deb",
28+
# For Windows use:
29+
# cfg6_sha256 = "ED98F236D5D2622DFA6ED300AB9DAB6D584649B4746CCADCAAF463E0FFECE460",
30+
# cfg6_url = "https://packages.vehub.vector.com/nuget/flatcontainer/vector-davinci-configurator-classic/6.2.1/vector-davinci-configurator-classic.6.2.1.nupkg",
31+
# dvarjson_sha256 = "E0F86CDA336BAF3C8BCBF39BD458E429153EFCD384D388915FCEE2A10605C076",
32+
# dvarjson_url = "https://packages.vehub.vector.com/nuget/flatcontainer/vector-dvarjson/1.1.0/vector-dvarjson.1.1.0.nupkg",
33+
)
34+
35+
# Import tool repos and register toolchains.
36+
use_repo(ecu_config, "cfg6", "dvarjson")
37+
register_toolchains("@cfg6//:toolchain")
38+
register_toolchains("@dvarjson//:toolchain")
39+
40+
# Include bazel-starter projects.
41+
include("//bazel-starter/com-diag:com-diag.MODULE.bazel")
42+
include("//bazel-starter/eac:eac.MODULE.bazel")
43+
include("//bazel-starter/project-creation:project-creation.MODULE.bazel")

MODULE.bazel.lock

Lines changed: 930 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,68 @@
1-
# davnci-samples
1+
# DaVinci Samples
2+
3+
Welcome to **DaVinci Samples**, an open-source repository designed to help developers understand and adopt **DaVinci Configurator Classic Version 6** workflows more easily.
4+
5+
## 📌 What is This Repository For?
6+
7+
This repository provides sample resources to help you integrate DaVinci Configurator Classic Version 6 workflows:
8+
9+
- **Ready-Set-Go-Scripts** demonstrating how DaVinci Configurator Classic Version 6 integrates into typical MICROSAR projects.
10+
- Create a new DaVinci project and link additional workspaces.
11+
- Project Import and Update
12+
- **Bazel Starter** shows how to build and automate configurations using Bazel and modern build systems. You can leverage various Bazel rules depending on your build needs:
13+
- Create a new DaVinci Project or reuse an existing one
14+
- Execute EcuC-as-Code
15+
- Validate and generate the DaVinci Project
16+
- Project Import and update
17+
18+
## 🛠 Requirements
19+
20+
Always required:
21+
22+
- Activated DaVinci Configurator Classic Version 6 License
23+
- A valid MICROSAR BSW package
24+
25+
If using scripts:
26+
27+
- DaVinci Developer Classic (Release 4.17 SP2 or newer)
28+
- DaVinci Team (Release 6.2 or newer)
29+
30+
If using pipelines (if using Bazel):
31+
32+
- Bazel by Google
33+
34+
If using EcuC as Code:
35+
36+
- EcuC-As-Code Development Kit
37+
38+
## 🚀 Getting Started
39+
40+
1. Clone the repository:
41+
```bash
42+
git clone https://github.com/vectorgrp/davinci-samples.git
43+
```
44+
2. Explore the samples:
45+
- Navigate to the folder that matches your use case.
46+
3. Follow the instructions in each folder’s README to get started.
47+
48+
## 📂 Repository Structure
49+
50+
```text
51+
davinci-samples/
52+
├─ bazel-starter/ # Bazel-based project setup example
53+
├─ ready-set-go-scripts/ # Ready-to-use scripts for quick workflow setup
54+
├─ .bazelrc # Bazel configuration file defining build options and settings
55+
├─ .editorconfig # Editor configuration for consistent coding styles across IDEs
56+
├─ .gitignore # Specifies files and directories to be ignored by Git
57+
├─ LICENSE # License information
58+
├─ MODULE.bazel # Bazel module definition for dependency management
59+
├─ MODULE.bazel.lock # Lock file for Bazel module dependencies to ensure reproducible builds
60+
├─ README.md # Main documentation for the repository
61+
└─ SECURITY.md # Security policy
62+
```
63+
64+
## 📖 Documentation
65+
66+
Check the repository folders for step-by-step guides and explanations.
67+
68+
[Learn more about DaVinci Configurator Classic Version 6.](https://help.vector.com/davinci-configurator-classic/en/current/index.html)

bazel-starter/BUILD.bazel

Whitespace-only changes.

bazel-starter/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Bazel Starter
2+
3+
## 📦 What Does This Folder Contain?
4+
5+
- **Bazel Starter** shows how to build and automate configurations using Bazel and modern build systems. You can leverage various Bazel rules depending on your build needs:
6+
- Create a new DaVinci Project or reuse an existing one
7+
- Execute EcuC-as-Code
8+
- Project Import and Update
9+
- Validate and generate the DaVinci Project
10+
11+
## 🧩 Bazel Starter Options
12+
13+
- **com-diag** Bazel starter showing the steps required to import and update communication, diagnostic, and other description files for an existing DaVinci Project.
14+
- **eac** Bazel starter showing how to implement the EcuC-as-Code workflow for ECU configuration in DaVinci Projects.
15+
- **project-creation** Bazel starter showing how to create a new DaVinci Project using a configuration file.
16+
17+
## 🚀 Getting Started
18+
19+
1. Configure the path to your `<BswPackage>` in [MODULE.bazel](../MODULE.bazel).
20+
2. Select a Bazel starter that matches your use case and adjust it to your specific requirements
21+
(see "Usage" section in [com-diag](com-diag/README.md), [eac](eac/README.md) or [project-creation](project-creation/README.md) READMEs).

bazel-starter/com-diag/BUILD.bazel

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
###############################################################################
2+
# BUILD.bazel
3+
# Purpose: Bazel build defines the build targets.
4+
# Author: Vector Informatik GmbH
5+
###############################################################################
6+
7+
# Rules for preparing project input files.
8+
load("@rules_cfg6//:defs.bzl", "merged_extract", "replace_modules", "system_extract")
9+
10+
# Project specific rules.
11+
load("@ComDiag//:defs.bzl", "generate")
12+
13+
exports_files(["dvcfg6-project/ComDiag.dvjson"])
14+
15+
# Extract an ECU from a system description.
16+
# system_extract(
17+
# name = "<MyExtract>",
18+
# ecu = "<EcuName>",
19+
# sysd = "<MySystemDescription.arxml>",
20+
# )
21+
22+
# Merge multiple .arxml files into an ECU extract.
23+
# merged_extract(
24+
# name = "<MyMergedExtract>",
25+
# srcs = [
26+
# "<MyExtract>",
27+
# "<File.arxml>",
28+
# ],
29+
# )
30+
31+
# Import modules in 'replace mode'.
32+
# replace_modules(
33+
# name = "<MyReplacedModule>",
34+
# arxmls = ["<Module.arxml>"],
35+
# )
36+
37+
# Generate the code.
38+
generate(
39+
name = "code",
40+
# Restrict the modules to generate code for using the optional modules and/or excluded attributes.
41+
modules = [],
42+
excluded = [],
43+
# Specify the external generation steps to execute using the optional ext_steps attribute.
44+
ext_steps = [],
45+
type = "REAL", # "REAL" or "VTT"
46+
# Additional optional attributes defaulting to the values shown below.
47+
keep_tmp_files = False,
48+
skip_up_to_date_checks = False,
49+
)

bazel-starter/com-diag/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Bazel Starter for ECU Communication & Diagnostics
2+
3+
Bazel starter showing the steps required to import and update communication, diagnostic, and other description files for an existing DaVinci Project.
4+
5+
## Usage
6+
7+
- `dvcfg6-project` contains an empty ECU project for demonstration purposes. To use it:
8+
- Set the `<SipId>` in [General.json](dvcfg6-project/Settings/General.json) to match the BSW package configured in [Module.bazel](../../MODULE.bazel).
9+
- Run `bazel run @ComDiag//:open_configurator` to open the project in DaVinci Configurator Classic 6.
10+
- Alternatively you may use your own ([migrated](https://help.vector.com/davinci-configurator-classic/en/current/dvcfg-classic/6.2-SP0/migration.html)) DaVinci project.
11+
- See `<MigratedProject>` in [com-diag.MODULE.bazel](com-diag.MODULE.bazel).
12+
- Run `bazel run @<MigratedProject>//:open_configurator` to open the project in DaVinci Configurator Classic 6.
13+
- See the comments in [com-diag.MODULE.bazel](com-diag.MODULE.bazel) and [BUILD.bazel](BUILD.bazel) for hints on how to customize the Bazel rules to fit your specific use case.

0 commit comments

Comments
 (0)