diff --git a/.conan/profiles/linux-aarch64 b/.conan/profiles/linux-aarch64
new file mode 100644
index 00000000..f6855902
--- /dev/null
+++ b/.conan/profiles/linux-aarch64
@@ -0,0 +1,12 @@
+[settings]
+os=Linux
+arch=armv8
+compiler=gcc
+compiler.version=11
+compiler.cppstd=17
+compiler.libcxx=libstdc++11
+
+[buildenv]
+CC=aarch64-linux-gnu-gcc-11
+CXX=aarch64-linux-gnu-g++-11
+LD=aarch64-linux-gnu-ld
diff --git a/.conan/profiles/linux-x86_64 b/.conan/profiles/linux-x86_64
new file mode 100644
index 00000000..3f68e6a6
--- /dev/null
+++ b/.conan/profiles/linux-x86_64
@@ -0,0 +1,12 @@
+[settings]
+os=Linux
+arch=x86_64
+compiler=gcc
+compiler.version=11
+compiler.cppstd=17
+compiler.libcxx=libstdc++11
+
+[buildenv]
+CC=x86_64-linux-gnu-gcc-11
+CXX=x86_64-linux-gnu-g++-11
+LD=x86_64-linux-gnu-ld
diff --git a/.conan/profiles/linux_aarch64_debug b/.conan/profiles/linux_aarch64_debug
deleted file mode 100644
index 0af01184..00000000
--- a/.conan/profiles/linux_aarch64_debug
+++ /dev/null
@@ -1,7 +0,0 @@
-[settings]
-os=Linux
-arch=armv8
-compiler=gcc
-compiler.version=11
-compiler.libcxx=libstdc++11
-build_type=Debug
diff --git a/.conan/profiles/linux_aarch64_release b/.conan/profiles/linux_aarch64_release
deleted file mode 100644
index 0cc37f38..00000000
--- a/.conan/profiles/linux_aarch64_release
+++ /dev/null
@@ -1,7 +0,0 @@
-[settings]
-os=Linux
-arch=armv8
-compiler=gcc
-compiler.version=11
-compiler.libcxx=libstdc++11
-build_type=Release
diff --git a/.conan/profiles/linux_x86_64_debug b/.conan/profiles/linux_x86_64_debug
deleted file mode 100644
index 50797d4c..00000000
--- a/.conan/profiles/linux_x86_64_debug
+++ /dev/null
@@ -1,7 +0,0 @@
-[settings]
-os=Linux
-arch=x86_64
-compiler=gcc
-compiler.version=11
-compiler.libcxx=libstdc++11
-build_type=Debug
diff --git a/.conan/profiles/linux_x86_64_release b/.conan/profiles/linux_x86_64_release
deleted file mode 100644
index c823b204..00000000
--- a/.conan/profiles/linux_x86_64_release
+++ /dev/null
@@ -1,7 +0,0 @@
-[settings]
-os=Linux
-arch=x86_64
-compiler=gcc
-compiler.version=11
-compiler.libcxx=libstdc++11
-build_type=Release
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index aa011a81..bdb71e33 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,5 +1,5 @@
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
@@ -13,7 +13,7 @@
#
# SPDX-License-Identifier: Apache-2.0
-FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.3
+FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.4
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE
ENV REINSTALL_CMAKE_VERSION_FROM_SOURCE="${REINSTALL_CMAKE_VERSION_FROM_SOURCE:-none}"
diff --git a/.devcontainer/scripts/configure-codespaces.sh b/.devcontainer/scripts/configure-codespaces.sh
index c87599af..0a659582 100755
--- a/.devcontainer/scripts/configure-codespaces.sh
+++ b/.devcontainer/scripts/configure-codespaces.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2023-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2023-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
diff --git a/.devcontainer/scripts/configure-proxies.sh b/.devcontainer/scripts/configure-proxies.sh
index a74bb7a6..14157619 100755
--- a/.devcontainer/scripts/configure-proxies.sh
+++ b/.devcontainer/scripts/configure-proxies.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
diff --git a/.devcontainer/scripts/container-set.sh b/.devcontainer/scripts/container-set.sh
index 2bdbf633..eb21ca7f 100755
--- a/.devcontainer/scripts/container-set.sh
+++ b/.devcontainer/scripts/container-set.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
diff --git a/.devcontainer/scripts/onCreateCommand.sh b/.devcontainer/scripts/onCreateCommand.sh
index d1681900..a86fb93c 100755
--- a/.devcontainer/scripts/onCreateCommand.sh
+++ b/.devcontainer/scripts/onCreateCommand.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
diff --git a/.devcontainer/scripts/postStartCommand.sh b/.devcontainer/scripts/postStartCommand.sh
index 7481d2a0..ee557dce 100755
--- a/.devcontainer/scripts/postStartCommand.sh
+++ b/.devcontainer/scripts/postStartCommand.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
@@ -14,7 +14,9 @@
#
# SPDX-License-Identifier: Apache-2.0
-.devcontainer/scripts/upgrade-cli.sh
+if [[ -z "${VELOCITAS_OFFLINE}" ]]; then
+ .devcontainer/scripts/upgrade-cli.sh
+fi
# Call user initialization hook if present
POST_START_USER_HOOK_PATH=.devcontainer/scripts/onPostStartUserHook.sh
diff --git a/.devcontainer/scripts/reinstall-cmake.sh b/.devcontainer/scripts/reinstall-cmake.sh
index 99d5d9a6..b727dad2 100755
--- a/.devcontainer/scripts/reinstall-cmake.sh
+++ b/.devcontainer/scripts/reinstall-cmake.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2023-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2023-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
diff --git a/.devcontainer/scripts/setup-dependencies.sh b/.devcontainer/scripts/setup-dependencies.sh
index 86de0e1b..9a5f4348 100755
--- a/.devcontainer/scripts/setup-dependencies.sh
+++ b/.devcontainer/scripts/setup-dependencies.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
diff --git a/.devcontainer/scripts/setup-git.sh b/.devcontainer/scripts/setup-git.sh
index 764a086d..0b7f22d5 100755
--- a/.devcontainer/scripts/setup-git.sh
+++ b/.devcontainer/scripts/setup-git.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
diff --git a/.devcontainer/scripts/upgrade-cli.sh b/.devcontainer/scripts/upgrade-cli.sh
index cb861418..9354deab 100755
--- a/.devcontainer/scripts/upgrade-cli.sh
+++ b/.devcontainer/scripts/upgrade-cli.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2023-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2023-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml
index e2cffa66..94c1bbd0 100644
--- a/.github/workflows/check-licenses.yml
+++ b/.github/workflows/check-licenses.yml
@@ -1,5 +1,5 @@
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
@@ -42,7 +42,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: eclipse-velocitas/license-check
- ref: v1.2
+ ref: v1.3
path: .github/actions/license-check
- name: Run License Checker
diff --git a/.github/workflows/check-updates.yml b/.github/workflows/check-updates.yml
index 81fa6fb6..d6f2cac7 100644
--- a/.github/workflows/check-updates.yml
+++ b/.github/workflows/check-updates.yml
@@ -1,5 +1,5 @@
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 30e6a089..82ff7cf3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,5 +1,5 @@
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
@@ -29,16 +29,15 @@ on:
branches:
- main
jobs:
- conan-package:
+ cpp-package:
runs-on: ubuntu-22.04
- container: ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.3
- name: Check Conan package
+ container: ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.4
+ name: Check C++ package
strategy:
matrix:
- host: ["linux_x86_64"]
+ host: ["linux-x86_64"]
fail-fast: false
-
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -52,14 +51,14 @@ jobs:
sudo apt-get update && sudo apt-get install -y ninja-build clang-format-14 clang-tidy-14 cppcheck
pip3 install -r requirements.txt
- - name: Create conan package
+ - name: Test creating the C++ package
run: |
- conan create --build=missing -pr:b ./.conan/profiles/linux_x86_64_release -pr:h ./.conan/profiles/${{ matrix.host }}_release . ci/testing
+ .scripts/test_package.sh ${{ matrix.host }}
build-and-publish:
runs-on: ubuntu-22.04
name: "Build, Test and Lint"
- container: ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.3
+ container: ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.4
steps:
- name: Checkout repository
@@ -84,7 +83,9 @@ jobs:
run: build/bin/sdk_utests
- name: Generate coverage report
- run: cd build && gcovr -r ..
+ # If 'build' folder is a symlink, assigning pwd to ROOT_DIR makes this independent
+ # of the number of dirs covered by the symlink
+ run: ROOT_DIR=$(pwd) && cd build && gcovr -r $ROOT_DIR
- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1.3.0
diff --git a/.github/workflows/ensure-lifecycle.yml b/.github/workflows/ensure-lifecycle.yml
index c6a88b9c..6271c987 100644
--- a/.github/workflows/ensure-lifecycle.yml
+++ b/.github/workflows/ensure-lifecycle.yml
@@ -1,5 +1,5 @@
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
-# Copyright (c) 2023-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2023-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
@@ -29,7 +29,7 @@ on:
jobs:
check-sync:
runs-on: ubuntu-22.04
- container: ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.3
+ container: ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.4
name: Are files in sync?
steps:
diff --git a/.gitignore b/.gitignore
index d1afa674..51894bc1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
@@ -49,16 +49,12 @@
*.pyc
# CMake
-build
+build*
+CMakeUserPresets.json
# Mac files
.DS_Store
-# Downloaded assets
-Assets
-.vscode/scripts/assets/
-get_helm.sh
-
# conan licenses
licenses
conan_imports_manifest.txt
diff --git a/.licensechecker.yml b/.licensechecker.yml
index e446e187..743830c1 100644
--- a/.licensechecker.yml
+++ b/.licensechecker.yml
@@ -16,4 +16,4 @@ whitelist-file-path: ./whitelisted-licenses.txt
scan-dirs:
- path: .
cpp-conan-included-profile-files:
- - "./.conan/profiles/linux_x86_64_release"
+ - "./.conan/profiles/linux-x86_64"
diff --git a/.ort.yml b/.ort.yml
deleted file mode 100644
index 4ef40b8e..00000000
--- a/.ort.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
-#
-# This program and the accompanying materials are made available under the
-# terms of the Apache License, Version 2.0 which is available at
-# https://www.apache.org/licenses/LICENSE-2.0.
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-
-curations:
- packages:
- - id: "PyPI::identify:2.5.24"
- curations:
- comment: "Proper license is defined in package repository https://pypi.org/project/identify/"
- concluded_license: "MIT"
- - id: "Conan::c-ares:1.18.1"
- curations:
- comment: "Proper license is defined in package repository https://conan.io/center/c-ares"
- concluded_license: "MIT"
- - id: "Conan::cpr:1.9.3"
- curations:
- comment: "Proper license is defined in package repository https://conan.io/center/cpr"
- concluded_license: "MIT"
- - id: "Conan::googleapis:cci.20221108"
- curations:
- comment: "Proper license is defined in package repository https://conan.io/center/googleapis?version=cci.20221108"
- concluded_license: "Apache-2.0"
- - id: "Conan::libcurl:7.87.0"
- curations:
- comment: "Proper license is defined in package repository https://conan.io/center/libcurl?version=7.87.0"
- concluded_license: "curl"
- - id: "Conan::openssl:1.1.1t"
- curations:
- comment: "Proper license is defined in package repository https://conan.io/center/openssl?version=1.1.1t"
- concluded_license: "OpenSSL"
- - id: "Conan::paho-mqtt-c:1.3.9"
- curations:
- comment: "Proper license is defined in package repository https://conan.io/center/paho-mqtt-c?version=1.3.9"
- concluded_license: "EPL-2.0"
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index ecf345bd..b9dd261c 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -43,7 +43,7 @@ repos:
"--suppress=uninitMemberVar",
"--suppress=unmatchedSuppression",
# suppress all warnings for generated code
- "--suppress=*:build/*",
+ "--suppress=*:build*/*",
"--suppress=*:app/vehicle_model/*",
"--suppress=*:examples/vehicle_model/*",
]
diff --git a/.scripts/common.sh b/.scripts/common.sh
index 7e5becf6..acd9904d 100644
--- a/.scripts/common.sh
+++ b/.scripts/common.sh
@@ -13,8 +13,8 @@
#
# SPDX-License-Identifier: Apache-2.0
-function get_valid_cross_compile_architecute() {
- if [[ "$1" == "aarch64" || "$1" == "arm64" ]]; then
+function get_valid_cross_compile_architecture() {
+ if [[ "$1" == "aarch64" || "$1" == "arm64" || "$1" == "armv8" ]]; then
HOST_ARCH="aarch64"
elif [[ "$1" == "x86_64" || "$1" == "amd64" ]]; then
HOST_ARCH="x86_64"
@@ -24,4 +24,4 @@ function get_valid_cross_compile_architecute() {
echo $HOST_ARCH
return 0
-}
\ No newline at end of file
+}
diff --git a/.scripts/conanfile-merger.py b/.scripts/conanfile-merger.py
deleted file mode 100644
index 32bf2d83..00000000
--- a/.scripts/conanfile-merger.py
+++ /dev/null
@@ -1,126 +0,0 @@
-# Copyright (c) 2023-2025 Contributors to the Eclipse Foundation
-#
-# This program and the accompanying materials are made available under the
-# terms of the Apache License, Version 2.0 which is available at
-# https://www.apache.org/licenses/LICENSE-2.0.
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-
-import importlib.util
-import sys
-import re
-import argparse
-import inspect
-
-def read_conanfile_txt(path: str) -> dict:
- file_dict = dict()
- current_key = None
-
- prog = re.compile(r"\[(\w+)\]")
-
- with open(path, "r") as conanfile:
- for line in conanfile:
- line = line.strip()
-
- match = prog.match(line)
-
- if match:
- current_key = match.group(1)
- file_dict[current_key] = list()
- elif len(line) > 0:
- file_dict[current_key].append(line)
-
- return file_dict
-
-
-def load_module_at(path: str, custom_module_name: str):
- spec = importlib.util.spec_from_file_location(custom_module_name, path)
- module = importlib.util.module_from_spec(spec)
- sys.modules[custom_module_name] = module
- spec.loader.exec_module(module)
- return module
-
-
-def read_conanfile_py(path: str) -> dict:
- dependencies = dict()
-
- prog = re.compile(r"self.options\[\"(\w+)\"\].(\w+)\s*=\s*(\w+)")
- custom_module_name = "conanfile"
- for name, obj in inspect.getmembers(load_module_at(path, custom_module_name), inspect.isclass):
- if obj.__module__ == custom_module_name:
- for name2, obj2 in inspect.getmembers(obj):
- if name2 == "requires":
- dependencies["requires"] = list(obj2)
- if name2 == "configure":
- dependencies["options"] = list()
- for line in inspect.getsourcelines(obj2)[0]:
- line = line.strip()
-
- m = prog.match(line)
-
- if m:
- dependency = m.group(1)
- key = m.group(2)
- value = m.group(3)
- dependencies["options"].append(f"{dependency}:{key}={value}")
-
- return dependencies
-
-
-def read_conanfile(path: str) -> dict:
- conanfile = None
- if path.endswith(".txt"):
- conanfile = read_conanfile_txt(path)
- elif path.endswith(".py"):
- conanfile = read_conanfile_py(path)
- else:
- raise "Invalid file extension for conanfile!"
-
- return conanfile
-
-
-def merge_dicts(a: dict, b: dict) -> dict:
- joined_keys = list(set(list(a.keys()) + list(b.keys())))
-
- joined_dict = dict()
-
- for key in joined_keys:
- joined_dict[key] = set()
-
- if key in a:
- for item in a[key]:
- joined_dict[key].add(item)
-
- if key in b:
- for item in b[key]:
- joined_dict[key].add(item)
-
- return joined_dict
-
-
-def write_conan_dict(path: str, dict: dict[str, list[str]]):
- with open(path, "w") as file:
- for key, items in dict.items():
- file.write(f"[{key}]\n")
- for item in items:
- file.write(f"{item}\n")
- file.write("\n")
-
-
-if __name__ == "__main__":
- parser = argparse.ArgumentParser(description='Merge 2 conan files into one.')
- parser.add_argument('file1', type=str, help='The first file.')
- parser.add_argument('file2', type=str, help='The second file.')
- parser.add_argument('--output', type=str, required=True, help='Path to the output file')
- args = parser.parse_args()
-
- conanfile1 = read_conanfile(args.file1)
- conanfile2 = read_conanfile(args.file2)
- conanfile_joined = merge_dicts(conanfile1, conanfile2)
- write_conan_dict(args.output, conanfile_joined)
diff --git a/.scripts/test_package.sh b/.scripts/test_package.sh
new file mode 100755
index 00000000..bdbe3bb5
--- /dev/null
+++ b/.scripts/test_package.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
+#
+# This program and the accompanying materials are made available under the
+# terms of the Apache License, Version 2.0 which is available at
+# https://www.apache.org/licenses/LICENSE-2.0.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+HOST_PROFILE=$1
+if [ "${HOST_PROFILE}" == "" ]; then
+ HOST_PROFILE="linux-$(arch)"
+ echo "Missing host profile argument - using default: ${HOST_PROFILE}"
+fi
+
+conan create --build=missing -pr:b ./.conan/profiles/linux-$(arch) -pr:h ./.conan/profiles/${HOST_PROFILE} -s:a="build_type=Release" . --user ci --channel testing
\ No newline at end of file
diff --git a/.velocitas-lock.json b/.velocitas-lock.json
index 82147a6d..8c762e86 100644
--- a/.velocitas-lock.json
+++ b/.velocitas-lock.json
@@ -1,8 +1,8 @@
{
"packages": {
"devenv-runtimes": "v4.1.0",
- "devenv-devcontainer-setup": "v2.5.4",
+ "devenv-devcontainer-setup": "v3.0.0",
"devenv-github-templates": "v1.0.5",
- "devenv-github-workflows": "v6.1.3"
+ "devenv-github-workflows": "v7.0.0"
}
}
diff --git a/.velocitas.json b/.velocitas.json
index 4b68cc8e..54259869 100644
--- a/.velocitas.json
+++ b/.velocitas.json
@@ -1,9 +1,9 @@
{
"packages": {
"devenv-runtimes": "v4.1.0",
- "devenv-devcontainer-setup": "v2.5.4",
+ "devenv-devcontainer-setup": "v3.0.0",
"devenv-github-templates": "v1.0.5",
- "devenv-github-workflows": "v6.1.3"
+ "devenv-github-workflows": "v7.0.0"
},
"components": [
"devcontainer-setup",
@@ -18,5 +18,5 @@
"githubRepoId": "eclipse-velocitas/vehicle-app-cpp-sdk",
"appManifestPath": "examples/seat-adjuster/AppManifest.json"
},
- "cliVersion": "v0.13.1"
+ "cliVersion": "v0.13.2"
}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 4acf3eb1..955c2dab 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -56,7 +56,9 @@
"label": "CPP - Calculate code coverage",
"detail": "Calculates code coverage of the c++ SDK",
"type": "shell",
- "command": "cd build && gcovr -r ..",
+ // 'build' folder is a symlink. Assigning pwd to ROOT_DIR makes this independent
+ // of the number of dirs covered by the symlink
+ "command": "ROOT_DIR=$(pwd) && cd build && gcovr -r $ROOT_DIR",
"group": "none",
"dependsOn": [
"CMake: Run Tests"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f2f64d07..b8127758 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,48 +14,35 @@
cmake_minimum_required(VERSION 3.16)
-set(SDK_STANDALONE ON CACHE BOOL "Build the SDK in standalone mode.")
set(SDK_BUILD_TESTS ON CACHE BOOL "Build the SDK tests.")
set(SDK_BUILD_EXAMPLES ON CACHE BOOL "Build the SDK examples.")
-
set(STATIC_BUILD OFF CACHE BOOL "Build all targets with external dependencies linked in statically.")
set(CMAKE_CXX_STANDARD 17)
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}/sdk/include
-)
-
-if(SDK_STANDALONE)
- # set the project name
- project(VehicleAppCppSdk CXX)
-
- if(STATIC_BUILD)
- set(BUILD_SHARED_LIBS OFF)
- set(CMAKE_EXE_LINKER_FLAGS "-static")
- endif()
+project(VehicleAppCppSdk CXX)
- set(BUILD_EXAMPLES CACHE BOOL true)
- set(BUILD_TESTS CACHE BOOL true)
+find_package(fmt REQUIRED CONFIG)
+find_package(gRPC REQUIRED CONFIG)
+find_package(nlohmann_json REQUIRED CONFIG)
+find_package(PahoMqttCpp REQUIRED CONFIG)
+find_package(eclipse-paho-mqtt-c REQUIRED CONFIG)
+find_package(protobuf REQUIRED CONFIG)
+find_package(absl REQUIRED CONFIG)
- find_program(CCACHE_FOUND ccache)
+# Induce to put executables into the bin folder of the current build folder
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
- if(CCACHE_FOUND)
- message("Found ccache installation")
- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
- endif()
-
- # use conan for dependency management
- set(CONAN_BUILD_INFO_FILE ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
+if(STATIC_BUILD)
+ set(BUILD_SHARED_LIBS OFF)
+ set(CMAKE_EXE_LINKER_FLAGS "-static")
+endif()
- if(NOT EXISTS ${CONAN_BUILD_INFO_FILE})
- message(FATAL_ERROR "Conan build info file missing. Did you run install_dependencies.sh first?")
- return()
- else()
- include(${CONAN_BUILD_INFO_FILE})
- conan_basic_setup(TARGETS)
- endif()
-endif(SDK_STANDALONE)
+find_program(CCACHE_FOUND ccache)
+if(CCACHE_FOUND)
+ message("Found ccache installation")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+endif()
if(SDK_BUILD_TESTS)
enable_testing()
diff --git a/NOTICE-3RD-PARTY-CONTENT.md b/NOTICE-3RD-PARTY-CONTENT.md
index 8f517f78..da85cd30 100644
--- a/NOTICE-3RD-PARTY-CONTENT.md
+++ b/NOTICE-3RD-PARTY-CONTENT.md
@@ -3,38 +3,33 @@
## Python
| Dependency | Version | License |
|:-----------|:-------:|--------:|
-|bottle|0.12.25|MIT|
-|certifi|2025.1.31|Mozilla Public License 2.0|
+|certifi|2025.4.26|Mozilla Public License 2.0|
|cfgv|3.4.0|MIT|
-|charset-normalizer|3.4.1|MIT|
+|charset-normalizer|3.4.2|MIT|
|colorama|0.4.6|BSD|
-|conan|1.66.0|MIT|
+|conan|2.15.1|MIT|
|cpplint|1.6.1|New BSD|
|distlib|0.3.9|Python Software Foundation License|
|distro|1.8.0|Apache 2.0|
|fasteners|0.19|Apache 2.0|
|filelock|3.18.0|The Unlicense (Unlicense)|
|gcovr|5.2|BSD|
-|identify|2.6.9|MIT|
+|identify|2.6.10|MIT|
|idna|3.10|BSD|
|jinja2|3.1.6|BSD|
-|lxml|5.3.1|New BSD|
+|lxml|5.4.0|New BSD|
|MarkupSafe|3.0.2|BSD|
-|node-semver|0.6.1|MIT|
|nodeenv|1.9.1|BSD|
-|patch-ng|1.17.4|MIT|
-|platformdirs|4.3.7|MIT|
-|pluginbase|1.0.1|BSD|
+|patch-ng|1.18.1|MIT|
+|platformdirs|4.3.8|MIT|
|pre-commit|3.5.0|MIT|
|pygments|2.19.1|Simplified BSD|
-|PyJWT|2.10.1|MIT|
|python-dateutil|2.9.0.post0|Apache 2.0
BSD|
|PyYAML|6.0.2|MIT|
|requests|2.32.3|Apache 2.0|
-|six|1.16.0|MIT|
-|tqdm|4.67.1|MIT
Mozilla Public License 2.0 (MPL 2.0)|
-|urllib3|1.26.20|MIT|
-|virtualenv|20.30.0|MIT|
+|six|1.17.0|MIT|
+|urllib3|2.0.7|MIT|
+|virtualenv|20.31.2|MIT|
## Workflows
| Dependency | Version | License |
|:-----------|:-------:|--------:|
diff --git a/NOTICE.md b/NOTICE.md
index 8140fa35..94c002af 100644
--- a/NOTICE.md
+++ b/NOTICE.md
@@ -51,26 +51,14 @@ they are given here (manually added) for time being:
| Dependency | Version | License |
|:-----------|:-------:|--------:|
-|abseil|20240116.2|Apache 2.0|
-|bzip2|1.0.8|bzip2-1.0.8|
-|c-ares|1.34.1|c-ares (MIT-style)|
-|cpr|1.11.0|MIT|
-|fmt|11.0.2|MIT|
-|grpc|1.67.1|Apache 2.0|
-|libcap|2.69|BSD-3-Clause, GPL-2.0-only|
-|libcurl|8.10.1|CURL|
-|libmount|2.39.2|LGPL-2.1-or-later|
-|libselinux|3.6|libselinux-1.0, LGPL-2.1-or-later|
-|libsystemd|255.10|LGPL-2.1-or-later|
-|libxcrypt|4.4.36|LGPL-2.1-or-later|
-|lz4|1.9.4|BSD-3-Clause, BSD-2-Clause|
+|abseil|20230802.1|Apache 2.0|
+|c-ares|1.34.3|c-ares (MIT-style)|
+|fmt|11.1.1|MIT|
+|grpc|1.50.1|Apache 2.0|
|nlohmann_json|3.11.3|MIT|
-|openssl|3.3.2|OpenSSL License AND SSLeay License|
+|openssl|3.4.1|Apache 2.0|
|paho-mqtt-c|1.3.13|EPL 2.0 AND EDL 1.0|
-|paho-mqtt-cpp|1.4.0|EPL 1.0 AND EDL 1.0|
-|pcre2|10.42|BSD-3-Clause|
-|protobuf|5.27.0|Google License|
+|paho-mqtt-cpp|1.4.0|EPL 2.0 AND EDL 1.0|
+|protobuf|3.21.12|Google License|
|re2|20230301|BSD-3-Clause|
-|xz_utils|5.4.5|LGPL-2.1-or-later, GPL-3.0-or-later, GPL-2.0-or-later, Unlicense|
-|zlib|1.3.1|zlib/libpng license|
-|zstd|1.5.5|BSD-3-Clause|
+|zlib|1.3.1|zlib license|
diff --git a/README.md b/README.md
index a5457bbf..184e97ac 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,16 @@

[](http://www.apache.org/licenses/LICENSE-2.0)
+> [!IMPORTANT]
+> We sucessfully migrated our C++ repositories to use version 2 of the [Conan package manager](https://conan.io/).
+> Unfortunately, those changes are not backwards compatible. So, please be aware that newer versions of the C++ SDK (>= v0.7) require usage
+> of Velocitas packages [devcontainer-setup](https://github.com/eclipse-velocitas/devenv-devcontainer-setup) >= v3 plus
+> [github-workflows](https://github.com/eclipse-velocitas/devenv-github-workflows) >= v7, and
+> [base images](https://github.com/eclipse-velocitas/devcontainer-base-images) >= v0.4. Also, those SDK versions are compatible with
+> recent versions of the [C++ App Template](https://github.com/eclipse-velocitas/vehicle-app-cpp-template), only.
+>
+> This is not relevant for the Python related app template and SDK repositories.
+
The Vehicle App SDK for C++ allows to create `Vehicle Apps` from the [Velocitas Development Model](https://eclipse.dev/velocitas/docs/concepts/development_model/) in the C++ programming language.
## Folder structure
@@ -74,7 +84,6 @@ You can configure the middleware to be used (currently only `native` is supporte
| Middleware | Environment Variable | Default | Meaning
|------------|---------------------------------|---------------------|------------------------------------
| | `SDV_MIDDLEWARE_TYPE` | `native` | Defines the middleware to be used by the app (currently only `native` is supported)
-|
| native | `SDV_MQTT_ADDRESS` | `localhost:1883` | Address of the MQTT broker
| | `SDV_VEHICLEDATABROKER_ADDRESS` | `localhost:55555` | Address of the Kuksa (Vehicle) Data Broker
diff --git a/build.sh b/build.sh
index 674b7197..6bb5e0b5 100755
--- a/build.sh
+++ b/build.sh
@@ -18,6 +18,7 @@
#
set -e
+source ./.scripts/common.sh
function print_help() {
echo "Build targets of the project
@@ -37,8 +38,9 @@ Arguments:
"
}
-BUILD_VARIANT=debug
+BUILD_TYPE=Debug
BUILD_ARCH=$(arch)
+HOST_OS=linux
HOST_ARCH=${BUILD_ARCH}
BUILD_TARGET=all
STATIC_BUILD=OFF
@@ -51,11 +53,11 @@ POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
case $1 in
-d|--debug)
- BUILD_VARIANT="debug"
+ BUILD_TYPE="Debug"
shift
;;
-r|--release)
- BUILD_VARIANT="release"
+ BUILD_TYPE="Release"
shift
;;
-t|--target)
@@ -76,7 +78,7 @@ while [[ $# -gt 0 ]]; do
shift
;;
-x|--cross)
- HOST_ARCH="$2"
+ HOST_ARCH=$( get_valid_cross_compile_architecture "$2" )
shift
shift
;;
@@ -102,7 +104,7 @@ done
echo "CMake version "`cmake --version`
echo "Conan version "`conan --version`
-echo "Build variant ${BUILD_VARIANT}"
+echo "Build type ${BUILD_TYPE}"
echo "Build arch ${BUILD_ARCH}"
echo "Host arch ${HOST_ARCH}"
echo "Build target ${BUILD_TARGET}"
@@ -113,7 +115,7 @@ echo "Coverage ${GEN_COVERAGE}"
CMAKE_CXX_FLAGS="-g -O0"
-if [ "${BUILD_VARIANT}" == "release" ]; then
+if [ "${BUILD_TYPE}" == "Release" ]; then
CMAKE_CXX_FLAGS="-s -g -O3"
fi
@@ -121,38 +123,32 @@ if [ "${GEN_COVERAGE}" == "ON" ]; then
CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} --coverage"
fi
-mkdir -p build && cd build
-
-# Expose the PATH of the build-time requirements from Conan to CMake - this is NOT handled by
-# any of Conan's CMake generators at the moment, hence we parse the conanbuildinfo.txt which
-# is generated and holds these paths. This allows us to always use the protoc and grpc cpp plugin
-# of the build system.
-BUILD_TOOLS_PATH=""
-CONAN_BUILD_TOOLS_PATHS=$(sed '/^PATH=/!d;s/PATH=//g;s/,/\n/g' ./conanbuildinfo.txt | tr -d '[]'\" )
-while read -r p; do
- if [[ ! -z "${p// }" ]]; then
- BUILD_TOOLS_PATH="$BUILD_TOOLS_PATH;$p"
- fi
-done < <(echo "$CONAN_BUILD_TOOLS_PATHS")
-
-XCOMPILE_TOOLCHAIN_FILE=""
-if [[ "${BUILD_ARCH}" != "${HOST_ARCH}" ]]; then
- echo "Setting up cross compilation toolchain..."
- XCOMPILE_TOOLCHAIN_FILE="-DCMAKE_TOOLCHAIN_FILE=../cmake/${BUILD_ARCH}_to_${HOST_ARCH}.cmake"
+BUILD_FOLDER=build-${HOST_OS}-${HOST_ARCH}/${BUILD_TYPE}
+echo "Using build foler ${BUILD_FOLDER}"
+# Set a symlink called 'build' to the last used build-type (release/debug) for
+# a local build (i.e. host arch == build arch). This is required for easy
+# access via vscod's task and launch config and for other build and test tools
+if [[ "${BUILD_ARCH}" == "${HOST_ARCH}" ]]; then
+ echo "Setting/updating symlink 'build' to ${BUILD_FOLDER}"
+ ln -snf ${BUILD_FOLDER} build
fi
+SRC_FOLDER=$(pwd)
+mkdir -p ${BUILD_FOLDER} && pushd ${BUILD_FOLDER}
+source generators/conanbuild.sh
+
# Configure CMake and build the project.
cmake --no-warn-unused-cli \
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \
- -DCMAKE_BUILD_TYPE:STRING=${BUILD_VARIANT} \
+ -DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE} \
-DSTATIC_BUILD:BOOL=${STATIC_BUILD} \
-DSDK_BUILD_EXAMPLES=${SDK_BUILD_EXAMPLES} \
-DSDK_BUILD_TESTS=${SDK_BUILD_TESTS} \
- -S.. \
- -B../build \
- -G Ninja \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \
- -DBUILD_TOOLS_PATH:STRING="${BUILD_TOOLS_PATH}" \
- ${XCOMPILE_TOOLCHAIN_FILE} ..
-cmake --build . --config ${BUILD_VARIANT} --target ${BUILD_TARGET} --
-cd ..
+ -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake \
+ -G Ninja \
+ -S ${SRC_FOLDER} \
+ -B .
+cmake --build . --target ${BUILD_TARGET}
+
+popd >> /dev/null
diff --git a/cmake/x86_64_to_aarch64.cmake b/cmake/x86_64_to_aarch64.cmake
deleted file mode 100644
index deb262a9..00000000
--- a/cmake/x86_64_to_aarch64.cmake
+++ /dev/null
@@ -1,20 +0,0 @@
-# the name of the target operating system
-set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_SYSTEM_PROCESSOR aarch64)
-
-set(TARGET_HOST aarch64-linux-gnu)
-
-# which compilers to use for C and C++
-set(CMAKE_C_COMPILER ${TARGET_HOST}-gcc)
-set(CMAKE_CXX_COMPILER ${TARGET_HOST}-g++)
-
-# where is the target environment located
-set(CMAKE_FIND_ROOT_PATH /usr/bin/aarch64-linux-gnu)
-
-# adjust the default behavior of the FIND_XXX() commands:
-# search programs in the host environment
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-
-# search headers and libraries in the target environment
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
\ No newline at end of file
diff --git a/conanfile.py b/conanfile.py
index d2d8a257..193e4fc8 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -16,9 +16,9 @@
import re
import subprocess
+from conan import ConanFile
from conan.tools.cmake import cmake_layout
-from conans import ConanFile, tools
-
+from conan.tools.files import copy
class VehicleAppCppSdkConan(ConanFile):
@@ -26,25 +26,8 @@ class VehicleAppCppSdkConan(ConanFile):
license = "Apache-2.0"
url = "https://github.com/eclipse-velocitas/vehicle-app-cpp-sdk"
description = "The Vehicle App SDK for c++ allows to create Vehicle Apps from the Velocitas development model in the c++ programming language."
- # In general: Pin recipe revisions of dependencies having further dependencies to avoid build issues due to updated recipes
- # Workaround1: Pin recipe revision for transient dependency googleapis for enabling the container build
- # Workaround2: Pin recipe revision for transient dependency paho-mqtt-c cause latest is pulling libanl which cannot be found
- requires = [
- ("c-ares/1.19.1@#420a0b77e370f4b96bee88ef91837ccc"),
- ("cpr/1.10.5"),
- ("fmt/9.1.0"),
- ("googleapis/cci.20221108@#e4bebdfa02f3b6f93bae1d5001b8d439"),
- ("grpc/1.50.1@#df352027120f88bccf24cbc40a2297ce"),
- ("grpc-proto/cci.20220627@#3ad14e3ffdae516b4da2407d5f23c71d"),
- ("libcurl/8.1.2@#c0f40219a032539a06b5b1fdb7a5745e"),
- ("nlohmann_json/3.11.2"),
- ("openssl/1.1.1u@#de76bbea24d8b46f8def8daa18b31fd9"),
- ("paho-mqtt-c/1.3.13"),
- ("paho-mqtt-cpp/1.4.0"),
- ("zlib/1.3")
- ]
- generators = "cmake"
- author = "Robert Bosch GmbH"
+ generators = "CMakeDeps", "CMakeToolchain"
+ author = "Contributors to the Eclipse Foundation, SDV Working Group"
# Binary configuration
settings = "os", "compiler", "build_type", "arch"
@@ -54,66 +37,102 @@ class VehicleAppCppSdkConan(ConanFile):
exports = "version.txt"
# Sources are located in the same place as this recipe, copy them to the recipe
- exports_sources = ".scripts/common.sh", "build.sh", "install_dependencies.sh", "CMakeLists.txt", "sdk/*", "examples/*", "conanfile.py", ".conan/profiles/*", "version.txt"
+ exports_sources = ".scripts/common.sh", "build.sh", "install_dependencies.sh", "CMakeLists.txt", "sdk/*", "conanfile.py", ".conan/profiles/*", "version.txt", "LICENSE"
+
+ def __run_cmd(self, args):
+ return subprocess.run(args, capture_output=True).stdout.strip().decode("utf-8")
def set_version(self):
try:
- git = tools.Git(folder=".")
- tag = git.get_tag()
- if tag is not None:
+ tag = self.__run_cmd(["git", "tag", "--points-at", "HEAD"])
+ version = ""
+ if tag:
version_tag_pattern = re.compile(r"^v[0-9]+(\.[0-9]+){0,2}")
if version_tag_pattern.match(tag):
tag = tag[1:] # cut off initial v if a semver tag
-
- version = tag if tag is not None else git.get_branch()
- if version == "HEAD (no branch)":
- version = git.get_commit()
- self.version = version.replace("/", "_")
+ version = tag
+
+ # if no tag, use branch name or commit hash
+ if not version:
+ version = self.__run_cmd(["git", "symbolic-ref", "-q", "--short", "HEAD"])
+ if not version:
+ version = self.__run_cmd(["git", "rev-parse", "HEAD"])
+
+ # / is not allowed in conan version
+ self.version = version.replace("/", ".")
open("./version.txt", mode="w", encoding="utf-8").write(self.version)
- except:
- print("Not a git repository, reading version from static file...")
+ except Exception as exc:
+ print(f"Exception catched: {exc}")
+ print("--> Maybe not a git repository, reading version from static file...")
if os.path.isfile("./version.txt"):
self.version = open("./version.txt", encoding="utf-8").read().strip()
else:
raise FileNotFoundError("Missing version.txt!")
-
+ print(f"Determined SDK version: {self.version}")
def config_options(self):
- if self.settings.os == "Linux":
- del self.options.fPIC
+ if self.settings.get_safe("os") == "Windows":
+ self.options.rm_safe("fPIC")
- def layout(self):
- cmake_layout(self, src_folder="sdk")
+ def configure(self):
+ if self.options.shared:
+ self.options.rm_safe("fPIC")
+
+ def requirements(self):
+ self.requires("fmt/11.1.1", transitive_headers=True)
+ self.requires("grpc/1.50.1", transitive_headers=True)
+ self.requires("nlohmann_json/3.11.3")
+ self.requires("paho-mqtt-c/1.3.13")
+ self.requires("paho-mqtt-cpp/1.4.0")
- def generate(self):
- #tc = CMakeToolchain(self)
- # tc.generate()
- # commented out since we rely on our build script to set up cmake
- pass
+ def build_requirements(self):
+ # Declare both, grpc and protobuf, here to enable proper x-build (w/o using qemu)
+ self.tool_requires("grpc/")
+ self.tool_requires("protobuf/")
+
+ def layout(self):
+ os = str(self.settings.os).lower()
+ arch = str(self.settings.arch).lower()
+ if arch == "armv8":
+ arch = "aarch64"
+ cmake_layout(
+ self,
+ src_folder=".",
+ build_folder=f"build-{os}-{arch}",
+ )
def build(self):
build_type = self.settings.get_safe(
"build_type", default="Release").lower()
option = "-r" if build_type == "release" else "-d"
+ arch = str(self.settings.arch).lower()
+ if arch == "armv8":
+ arch = "aarch64"
subprocess.call(
- f"cd ../.. && ./install_dependencies.sh && ./build.sh {option} --no-examples --no-tests", shell=True)
+ f"cd ../.. && ./build.sh -x {self.settings.arch} {option} --no-examples --no-tests", shell=True)
def package(self):
- self.copy("*.h", src="../sdk/include", dst="include", keep_path=True)
- self.copy("*.h", src="../build/gens", dst="include", keep_path=True)
- self.copy("*.a", src="../build/lib", dst="lib", keep_path=False)
+ copy(
+ self,
+ "license*",
+ src=self.source_folder,
+ dst=os.path.join(self.package_folder, "licenses"),
+ keep_path=True,
+ )
+ copy(
+ self,
+ "*.h",
+ src=os.path.join(self.source_folder, "sdk", "include"),
+ dst=os.path.join(self.package_folder, "include"),
+ keep_path=True,
+ )
+ copy(
+ self,
+ "*.a",
+ src=self.build_folder,
+ dst=os.path.join(self.package_folder, "lib"),
+ keep_path=False,
+ )
def package_info(self):
- self.cpp_info.includedirs = ["include"]
- self.cpp_info.libdirs = ["lib"]
- self.cpp_info.bindirs = ["bin"]
- self.cpp_info.libs = ["vehicle-app-sdk",
- "vehicle-app-sdk-generated-grpc"]
-
- def imports(self):
- self.copy("license*", src=".", dst="./licenses",
- folder=True, ignore_case=True)
-
- def build_requirements(self):
- # 'build' context (protoc.exe will be available)
- self.tool_requires("grpc/1.50.1")
+ self.cpp_info.libs = ["vehicle-app-sdk", "vehicle-app-sdk-generated-grpc"]
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index caf9a96d..2adbdd12 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -12,7 +12,7 @@
#
# SPDX-License-Identifier: Apache-2.0
-include_directories(example_model)
+add_subdirectory(example_model)
# Currently only adding examples that can be tested without additional velocitas code generation
diff --git a/examples/example_model/CMakeLists.txt b/examples/example_model/CMakeLists.txt
new file mode 100644
index 00000000..653c3105
--- /dev/null
+++ b/examples/example_model/CMakeLists.txt
@@ -0,0 +1,19 @@
+# Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
+#
+# This program and the accompanying materials are made available under the
+# terms of the Apache License, Version 2.0 which is available at
+# https://www.apache.org/licenses/LICENSE-2.0.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+set(TARGET_NAME "example_model")
+
+add_library(${TARGET_NAME} INTERFACE)
+
+target_include_directories(${TARGET_NAME} INTERFACE .)
diff --git a/examples/performance-subscribe/CMakeLists.txt b/examples/performance-subscribe/CMakeLists.txt
index 7d8e26b6..e712b76a 100644
--- a/examples/performance-subscribe/CMakeLists.txt
+++ b/examples/performance-subscribe/CMakeLists.txt
@@ -19,15 +19,13 @@ add_executable(${TARGET_NAME}
src/PerformanceTestApp.cpp
)
-include_directories(
- ${CMAKE_BINARY_DIR}/gens
+target_include_directories(${TARGET_NAME}
+ PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-add_dependencies(${TARGET_NAME}
- vehicle-app-sdk
-)
-
target_link_libraries(${TARGET_NAME}
vehicle-app-sdk
+ example_model
+ nlohmann_json::nlohmann_json
)
diff --git a/examples/seat-adjuster/CMakeLists.txt b/examples/seat-adjuster/CMakeLists.txt
index 9737327d..beb73427 100644
--- a/examples/seat-adjuster/CMakeLists.txt
+++ b/examples/seat-adjuster/CMakeLists.txt
@@ -18,10 +18,13 @@ add_executable(${TARGET_NAME}
src/SeatAdjusterApp.cpp
)
-include_directories(
+target_include_directories(${TARGET_NAME}
+ PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_link_libraries(${TARGET_NAME}
vehicle-app-sdk
+ example_model
+ nlohmann_json::nlohmann_json
)
diff --git a/examples/set-data-points/CMakeLists.txt b/examples/set-data-points/CMakeLists.txt
index bde62feb..b59edead 100644
--- a/examples/set-data-points/CMakeLists.txt
+++ b/examples/set-data-points/CMakeLists.txt
@@ -18,10 +18,13 @@ add_executable(${TARGET_NAME}
src/SetDataPointsApp.cpp
)
-include_directories(
+target_include_directories(${TARGET_NAME}
+ PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_link_libraries(${TARGET_NAME}
vehicle-app-sdk
+ example_model
+ nlohmann_json::nlohmann_json
)
diff --git a/install_dependencies.sh b/install_dependencies.sh
index e2aa945f..b501ec8d 100755
--- a/install_dependencies.sh
+++ b/install_dependencies.sh
@@ -27,18 +27,19 @@ function print_help() {
Installs the Conan dependencies of the Vehicle App AND the Vehicle App SDK
into the local Conan cache. Has to be re-executed whenever any conanfile.txt
or conanfile.py is updated. By default, dependencies are installed in release
-mode.
+mode and the app is expected to be built in debug mode (i.e. "mixed" mode).
Arguments:
-d, --debug Installs all dependencies in debug mode.
--r, --release Installs all dependencies in release mode. (default)
+-r, --release Installs all dependencies in release mode.
-x, --cross Cross compiles for the specified architecture.
--build-all-deps Forces all dependencies to be rebuild from source.
-h, --help Shows this help.
"
}
-BUILD_VARIANT="release"
+BUILD_TYPE="Release"
+PREPARE_MIXED_BUILD="true"
BUILD_ARCH=$(arch)
HOST_ARCH=${BUILD_ARCH}
WHICH_DEPS_TO_BUILD="missing"
@@ -46,11 +47,13 @@ WHICH_DEPS_TO_BUILD="missing"
while [[ $# -gt 0 ]]; do
case $1 in
-d|--debug)
- BUILD_VARIANT="debug"
+ PREPARE_MIXED_BUILD="false"
+ BUILD_TYPE="Debug"
shift
;;
-r|--release)
- BUILD_VARIANT="release"
+ PREPARE_MIXED_BUILD="false"
+ BUILD_TYPE="Release"
shift
;;
--build-all-deps)
@@ -58,7 +61,8 @@ while [[ $# -gt 0 ]]; do
shift
;;
-x|--cross)
- HOST_ARCH=$( get_valid_cross_compile_architecute "$2" )
+ PREPARE_MIXED_BUILD="false"
+ HOST_ARCH=$( get_valid_cross_compile_architecture "$2" )
if [ "$?" -eq 1 ]; then
echo "Invalid cross-compile architecture '$2'!"
@@ -85,37 +89,30 @@ while [[ $# -gt 0 ]]; do
done
echo "Conan version "`conan --version`
-echo "Build variant ${BUILD_VARIANT}"
+echo "Build type ${BUILD_TYPE}"
+echo " prepare mixed ${PREPARE_MIXED_BUILD}"
echo "Build arch ${BUILD_ARCH}"
echo "Host arch ${HOST_ARCH}"
echo "Building deps ${WHICH_DEPS_TO_BUILD}"
-mkdir -p build
-
-XCOMPILE_PROFILE=""
-
-if [[ "${BUILD_ARCH}" != "${HOST_ARCH}" ]]; then
- echo "Setting up cross compilation toolchain..."
-
- toolchain=/usr/bin/${HOST_ARCH}-linux-gnu
- target_host=${HOST_ARCH}-linux-gnu
- cc_compiler=gcc
- cxx_compiler=g++
-
- export CONAN_CMAKE_FIND_ROOT_PATH=$toolchain
- export CONAN_CMAKE_SYSROOT=$toolchain
- export CC=$target_host-$cc_compiler
- export CXX=$target_host-$cxx_compiler
-
- XCOMPILE_PROFILE="-pr:b .conan/profiles/linux_${BUILD_ARCH}_${BUILD_VARIANT}"
+HOST_PROFILE=".conan/profiles/linux-${HOST_ARCH}"
+BUILD_PROFILE=".conan/profiles/linux-${BUILD_ARCH}"
+
+if [ "${PREPARE_MIXED_BUILD}" == "true" ]; then
+ echo "Installing dependencies for \"mixed\" build: Dependencies in Release mode, SDK/examples/tests in Debug mode ..."
+ conan install \
+ -pr:h ${HOST_PROFILE} \
+ -pr:b ${BUILD_PROFILE} \
+ -s:a="build_type=Release" \
+ -s:h="&:build_type=Debug" \
+ --build "${WHICH_DEPS_TO_BUILD}" \
+ .
fi
-# Enable Conan revision handling to enable pinning googleapis recipe revision (see conanfile.py)
-export CONAN_REVISIONS_ENABLED=1
-
+echo "Installing dependencies for uniform build in ${BUILD_TYPE} mode ..."
conan install \
- -pr:h .conan/profiles/linux_${HOST_ARCH}_${BUILD_VARIANT} \
- ${XCOMPILE_PROFILE} \
+ -pr:h ${HOST_PROFILE} \
+ -pr:b ${BUILD_PROFILE} \
+ -s:a="build_type=${BUILD_TYPE}" \
--build "${WHICH_DEPS_TO_BUILD}" \
- -of ./build \
- -if ./build .
+ .
diff --git a/license_header.txt b/license_header.txt
index ffd6fc73..9ef062a7 100644
--- a/license_header.txt
+++ b/license_header.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2024 Contributors to the Eclipse Foundation
+Copyright (c) 2025 Contributors to the Eclipse Foundation
This program and the accompanying materials are made available under the
terms of the Apache License, Version 2.0 which is available at
diff --git a/requirements.txt b/requirements.txt
index 49b3841e..9ce53bd2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
gcovr==5.2
-conan==1.66.0
+conan==2.15.1
pre-commit==3.5.0
cpplint==1.6.1
diff --git a/sdk/CMakeLists.txt b/sdk/CMakeLists.txt
index 9e1a4a40..8e1ce18c 100644
--- a/sdk/CMakeLists.txt
+++ b/sdk/CMakeLists.txt
@@ -17,4 +17,4 @@ add_subdirectory(src)
if(SDK_BUILD_TESTS)
add_subdirectory(tests)
-endif(SDK_BUILD_TESTS)
\ No newline at end of file
+endif(SDK_BUILD_TESTS)
diff --git a/sdk/include/sdk/IPubSubClient.h b/sdk/include/sdk/IPubSubClient.h
index bba4872e..030936dc 100644
--- a/sdk/include/sdk/IPubSubClient.h
+++ b/sdk/include/sdk/IPubSubClient.h
@@ -56,8 +56,8 @@ class IPubSubClient {
*
* @param brokerUri address of the MQTT broker to connect to
* @param clientId used to identify the client at the MQTT broker
- * @param username to get access to the MQTT broker
- * @param password to get access to the MQTT broker
+ * @param username username to get access to the MQTT broker
+ * @param password password to get access to the MQTT broker
* @return std::shared_ptr reference to the created MQTT client
*/
static std::shared_ptr createInstance(const std::string& brokerUri,
diff --git a/sdk/proto/CMakeLists.txt b/sdk/proto/CMakeLists.txt
index 186dc65e..5536386d 100644
--- a/sdk/proto/CMakeLists.txt
+++ b/sdk/proto/CMakeLists.txt
@@ -12,82 +12,32 @@
#
# SPDX-License-Identifier: Apache-2.0
-file(GLOB_RECURSE PROTO_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.proto)
-
-find_program(_gRPC_PROTOBUF_PROTOC_EXECUTABLE protoc REQUIRED
- PATHS ${BUILD_TOOLS_PATH}
- NO_DEFAULT_PATH)
-find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin REQUIRED
- PATHS ${BUILD_TOOLS_PATH}
- NO_DEFAULT_PATH)
-
-set(_gRPC_PROTO_GENS_DIR ${CMAKE_BINARY_DIR}/gens)
-set(_gRPC_PROTO_SRCS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR})
-
-set(PROTO_SRCS "" CACHE INTERNAL "")
-set(PROTO_HDRS "" CACHE INTERNAL "")
-
-foreach(FILE ${PROTO_FILES})
- get_filename_component(ABS_FIL ${FILE} ABSOLUTE)
- get_filename_component(FIL_WE ${FILE} NAME_WE)
- get_filename_component(REL_DIR ${FILE} DIRECTORY)
- set(RELFIL_WE ${REL_DIR}/${FIL_WE})
-
- set(OUTPUT_FILE_PATH_GRPC_SRC "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc")
- set(OUTPUT_FILE_PATH_GRPC_HDR "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h")
- set(OUTPUT_FILE_PATH_PB_SRC "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc")
- set(OUTPUT_FILE_PATH_PB_HDR "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h")
- set(OUTPUT_FILE_PATH_GRPC_MOCK_HDR "${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h")
- set(OUTPUT_FILES
- ${OUTPUT_FILE_PATH_GRPC_SRC}
- ${OUTPUT_FILE_PATH_GRPC_HDR}
- ${OUTPUT_FILE_PATH_PB_SRC}
- ${OUTPUT_FILE_PATH_PB_HDR}
- ${OUTPUT_FILE_PATH_GRPC_MOCK_HDR}
- )
-
- set(GENERATE_GRPC_SOURCES FALSE)
-
- foreach(OUTPUT_FILE ${OUTPUT_FILES})
- if(NOT EXISTS ${OUTPUT_FILE})
- set(GENERATE_GRPC_SOURCES TRUE)
- message("File does not exist: " ${OUTPUT_FILE} " - generating ...")
- else()
- # message("File already exists: " ${OUTPUT_FILE})
- endif()
- endforeach()
-
- if(${GENERATE_GRPC_SOURCES})
- add_custom_command(
- OUTPUT ${OUTPUT_FILES}
- COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}
- ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}
- --cpp_out ${_gRPC_PROTO_GENS_DIR}
- -I "./"
- --plugin=protoc-gen-grpc=${_GRPC_CPP_PLUGIN_EXECUTABLE}
- "${FILE}"
- WORKING_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}
- COMMENT "Running gRPC C++ protocol buffer compiler for ${FILE}"
- VERBATIM)
- else()
- message("Skipping generation of " ${FILE})
- endif()
-
- list(APPEND PROTO_SRCS ${OUTPUT_FILE_PATH_GRPC_SRC})
- list(APPEND PROTO_SRCS ${OUTPUT_FILE_PATH_PB_SRC})
- list(APPEND PROTO_HDRS ${OUTPUT_FILE_PATH_GRPC_HDR})
- list(APPEND PROTO_HDRS ${OUTPUT_FILE_PATH_PB_HDR})
-endforeach()
-
-include_directories(${CMAKE_BINARY_DIR}/gens)
-
set(TARGET_NAME "vehicle-app-sdk-generated-grpc")
add_library(${TARGET_NAME} STATIC
- ${PROTO_SRCS}
+ kuksa/val/v2/types.proto
+ kuksa/val/v2/val.proto
+ sdv/databroker/v1/types.proto
+ sdv/databroker/v1/collector.proto
+ sdv/databroker/v1/broker.proto
+)
+
+target_include_directories(${TARGET_NAME}
+ PUBLIC
+ ${absl_INCLUDE_DIRS}
+ ${protobuf_INCLUDE_DIRS}
+ ${gRPC_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(${TARGET_NAME}
- CONAN_PKG::grpc
+ gRPC::grpc++
)
+
+protobuf_generate(TARGET ${TARGET_NAME})
+protobuf_generate(
+ TARGET ${TARGET_NAME}
+ LANGUAGE grpc
+ PLUGIN protoc-gen-grpc=$
+ PLUGIN_OPTIONS generate_mock_code=true
+ GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc)
diff --git a/sdk/src/CMakeLists.txt b/sdk/src/CMakeLists.txt
index 4993e158..23b0e28c 100644
--- a/sdk/src/CMakeLists.txt
+++ b/sdk/src/CMakeLists.txt
@@ -46,21 +46,20 @@ add_library(${TARGET_NAME}
sdk/vdb/grpc/sdv_databroker_v1/GrpcDataPointValueProvider.cpp
)
-include_directories(
- ${CMAKE_BINARY_DIR}/gens
+target_include_directories(${TARGET_NAME}
+ PUBLIC
+ ${fmt_INCLUDE_DIRS}
+ ${absl_INCLUDE_DIRS}
+ ${gRPC_INCLUDE_DIRS}
../include
+ PRIVATE
.
)
-add_dependencies(${TARGET_NAME}
- vehicle-app-sdk-generated-grpc
-)
-
target_link_libraries(${TARGET_NAME}
- CONAN_PKG::grpc
- CONAN_PKG::cpr
- CONAN_PKG::fmt
- CONAN_PKG::paho-mqtt-cpp
- CONAN_PKG::nlohmann_json
+ gRPC::grpc++
+ fmt::fmt
+ PahoMqttCpp::paho-mqttpp3-static
+ nlohmann_json::nlohmann_json
vehicle-app-sdk-generated-grpc
)
diff --git a/sdk/src/sdk/vdb/grpc/kuksa_val_v2/BrokerClient.cpp b/sdk/src/sdk/vdb/grpc/kuksa_val_v2/BrokerClient.cpp
index 304dd328..e170b229 100644
--- a/sdk/src/sdk/vdb/grpc/kuksa_val_v2/BrokerClient.cpp
+++ b/sdk/src/sdk/vdb/grpc/kuksa_val_v2/BrokerClient.cpp
@@ -211,8 +211,8 @@ BrokerClient::setDatapoints(const std::vector>&
namespace {
void clearUpdateStatus(DataPointMap_t& datapointMap) {
- for (const auto& [key, value] : datapointMap) {
- value->clearUpdateStatus();
+ for (auto& entry : datapointMap) {
+ entry.second->clearUpdateStatus();
}
}
diff --git a/sdk/tests/unit/CMakeLists.txt b/sdk/tests/unit/CMakeLists.txt
index d0649a55..59167f64 100644
--- a/sdk/tests/unit/CMakeLists.txt
+++ b/sdk/tests/unit/CMakeLists.txt
@@ -37,10 +37,6 @@ add_executable(${TARGET_NAME}
vdb/grpc/sdv_databroker_v1/BrokerClient_tests.cpp
)
-add_dependencies(${TARGET_NAME}
- vehicle-app-sdk
-)
-
target_link_libraries(${TARGET_NAME}
vehicle-app-sdk
gmock
@@ -48,10 +44,10 @@ target_link_libraries(${TARGET_NAME}
include(GoogleTest)
-include_directories(
+target_include_directories(${TARGET_NAME}
+ PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../mocks
${CMAKE_CURRENT_SOURCE_DIR}/../model
- ${CMAKE_BINARY_DIR}/gens
${CMAKE_CURRENT_SOURCE_DIR}/../../src
)
diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt
index 9ac057ef..82740686 100644
--- a/test_package/CMakeLists.txt
+++ b/test_package/CMakeLists.txt
@@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.16)
project(test_package)
-find_package(vehicle-app-sdk QUIET)
+find_package(vehicle-app-sdk CONFIG REQUIRED)
if(NOT vehicle-app-sdk_FOUND)
message(FATAL_ERROR "This project can only be built with a 'conan create' command in the parent directory!")
diff --git a/test_package/conanfile.py b/test_package/conanfile.py
index 221c1229..0f19d2f0 100644
--- a/test_package/conanfile.py
+++ b/test_package/conanfile.py
@@ -13,19 +13,21 @@
# SPDX-License-Identifier: Apache-2.0
import os
-from conan.tools.cmake import CMake
+
+from conan import ConanFile
from conan.tools.build import can_run
-from conans import ConanFile
+from conan.tools.cmake import CMake, cmake_layout
class VehicleAppSdkTest(ConanFile):
+ test_type = "explicit"
name = "vehicle_app_sdk_test"
license = "Apache-2.0"
url = "https://github.com/eclipse-velocitas/vehicle-app-cpp-sdk"
settings = "os", "compiler", "build_type", "arch"
- generators = "CMakeToolchain", "CMakeDeps"
+ generators = "CMakeDeps", "CMakeToolchain"
def requirements(self):
self.requires(self.tested_reference_str)
@@ -35,7 +37,10 @@ def build(self):
cmake.configure()
cmake.build()
+ def layout(self):
+ cmake_layout(self)
+
def test(self):
- cmd = os.path.join(self.build_folder, "test_package")
if can_run(self):
+ cmd = os.path.join(self.cpp.build.bindir, "test_package")
self.run(f"SDV_MIDDLEWARE_TYPE=native {cmd}", env="conanrun")