-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
New: - Add `cloe-meta` package to replace previous role of `cloe`. - Add `cloe-plugins-core` package recipe (but do not build). - Add editable builds to GitHub workflow `build-cloe` matrix. Changed: - Package `cloe` provides all Cloe packages compiled in one go. This is a boon to development, as we make `cloe` editable and only have to work with a single package. It also massively speeds up compilation: - Conan and CMake configuration is only performed once. - All cores can now be utilized much more effectively during the build process. - Do not aggressively lint everything The developer can do this themselves by setting a cmake define: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_CLANG_TIDY.html - Move all individual tests into single project tests Still support multiple profiles, but this makes it easier to support the cloe super-build and should also make it easier to develop and maintain tests. - Renamed top-level Make targets: - `status` is now `status-all` - `export` is now `export-all` - `deploy` is now `deploy-all` - `clean` is now `clean-all` - `purge` is now `purge-all` - The following top-level Make targets just refer to `cloe` super-build package: - `package` - `smoketest` - `smoketest-deps` - `status` - `export` Fixed: - Plugin Conan configurations do not export correct library path. Removed: - Work-In-Progress Lua files.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This CMakeLists.txt configures a super-build containing everything | ||
# from this repo. | ||
# | ||
# It is currently experimental. | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.15 FATAL_ERROR) | ||
|
||
project(cloe LANGUAGES CXX) | ||
|
||
set(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/runtime/cmake") | ||
|
||
# Since a super-build does not export packages individually via Conan, | ||
# we cannot depend on Conan-generated CMake config files, instead we | ||
# use the CMake targets directly as if they were already found. | ||
set(CLOE_FIND_PACKAGES OFF CACHE BOOL "Call find_package() for cloe packages" FORCE) | ||
|
||
# Ensure output goes to one place so cloe-launch can find the plugins | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) | ||
|
||
# Ensure we can test from this level. | ||
include(CTest) | ||
|
||
add_subdirectory(fable) | ||
add_subdirectory(runtime) | ||
add_subdirectory(models) | ||
add_subdirectory(oak) | ||
add_subdirectory(engine) | ||
add_subdirectory(plugins) |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
override BUILD_IN_SOURCE := false | ||
|
||
include ../Makefile.package |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# mypy: ignore-errors | ||
# pylint: skip-file | ||
|
||
from pathlib import Path | ||
|
||
from conan import ConanFile | ||
from conan.tools import files, scm | ||
|
||
required_conan_version = ">=1.52.0" | ||
|
||
|
||
class CloeMeta(ConanFile): | ||
name = "cloe-meta" | ||
license = "Apache-2.0" | ||
url = "https://github.com/eclipse/cloe" | ||
description = "Closed-loop automated driving simulation environment" | ||
topics = ["simulation"] | ||
settings = "os", "compiler", "build_type", "arch" | ||
options = { | ||
"with_vtd": [True, False], | ||
"with_engine": [True, False], | ||
} | ||
default_options = { | ||
"with_vtd": False, | ||
"with_engine": True, | ||
|
||
"fable:allow_comments": True, | ||
"engine:server": True, | ||
"engine:lrdb": True, | ||
} | ||
|
||
def set_version(self): | ||
version_file = Path(self.recipe_folder) / "../VERSION" | ||
if version_file.exists(): | ||
self.version = files.load(self, version_file).strip() | ||
else: | ||
git = scm.Git(self, self.recipe_folder) | ||
self.version = git.run("describe --dirty=-dirty")[1:] | ||
|
||
def requirements(self): | ||
def cloe_requires(dep): | ||
self.requires(f"{dep}/{self.version}@cloe/develop") | ||
|
||
cloe_requires("cloe-runtime") | ||
cloe_requires("cloe-models") | ||
cloe_requires("cloe-plugin-basic") | ||
cloe_requires("cloe-plugin-gndtruth-extractor") | ||
cloe_requires("cloe-plugin-minimator") | ||
cloe_requires("cloe-plugin-mocks") | ||
cloe_requires("cloe-plugin-noisy-sensor") | ||
cloe_requires("cloe-plugin-speedometer") | ||
cloe_requires("cloe-plugin-virtue") | ||
if self.options.with_vtd: | ||
cloe_requires("cloe-plugin-vtd") | ||
|
||
if self.options.with_engine: | ||
cloe_requires("cloe-engine") | ||
|
||
# Overrides: | ||
self.requires("fmt/9.1.0", override=True) | ||
self.requires("inja/3.4.0", override=True) | ||
self.requires("nlohmann_json/3.11.2", override=True) | ||
self.requires("incbin/cci.20211107", override=True), | ||
self.requires(f"boost/[>=1.65.0]", override=True) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This CMakeLists.txt configures a super-build of all plugins. | ||
# | ||
# It is currently experimental. | ||
# | ||
# This supports two use-cases: | ||
# | ||
# 1. Creating a cloe-plugins-core package containing all plugins. | ||
# 2. Creating a cloe package containing everything from this repo. | ||
# | ||
# Other use-cases are currently not supported. | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.15 FATAL_ERROR) | ||
|
||
if(NOT DEFINED PROJECT_NAME) | ||
project(cloe_plugins_core LANGUAGES CXX) | ||
|
||
# Speed up configuration by only finding Cloe packages once | ||
set(CLOE_FIND_PACKAGES ON CACHE BOOL "Call find_package() for cloe packages") | ||
if(CLOE_FIND_PACKAGES) | ||
find_package(cloe-runtime REQUIRED) | ||
find_package(cloe-models REQUIRED) | ||
set(CLOE_FIND_PACKAGES OFF FORCE) | ||
endif() | ||
|
||
# Ensure output goes to one place so cloe-launch can find the plugins | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) | ||
elseif(NOT ${PROJECT_NAME} STREQUAL "cloe") | ||
message(FATAL_ERROR "Building super-project unequal to cloe not suppoorted.") | ||
endif() | ||
|
||
# Ensure we can test from this level. | ||
include(CTest) | ||
|
||
add_subdirectory(basic) | ||
add_subdirectory(gndtruth_extractor) | ||
add_subdirectory(minimator) | ||
add_subdirectory(mocks) | ||
add_subdirectory(noisy_sensor) | ||
add_subdirectory(speedometer) | ||
add_subdirectory(virtue) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../Makefile.package |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# mypy: ignore-errors | ||
# pylint: skip-file | ||
|
||
import os | ||
from pathlib import Path | ||
|
||
from conan import ConanFile | ||
from conan.errors import ConanInvalidConfiguration | ||
from conan.tools import cmake, files, scm, env | ||
|
||
required_conan_version = ">=1.52.0" | ||
|
||
|
||
class CloeControllerBasic(ConanFile): | ||
name = "cloe-plugins-core" | ||
url = "https://github.com/eclipse/cloe" | ||
description = "Cloe core plugins" | ||
license = "Apache-2.0" | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "CMakeDeps", "VirtualRunEnv" | ||
no_copy_source = True | ||
provides = [ | ||
"cloe-plugin-basic", | ||
"cloe-plugin-gndtruth-extractor", | ||
"cloe-plugin-minimator", | ||
"cloe-plugin-mocks", | ||
"cloe-plugin-noisy-sensor", | ||
"cloe-plugin-speedometer", | ||
"cloe-plugin-virtue", | ||
] | ||
exports_sources = [ | ||
"*/src/*", | ||
"*/include/*", | ||
"*/ui/*", | ||
"*/CMakeLists.txt", | ||
] | ||
|
||
def set_version(self): | ||
version_file = Path(self.recipe_folder) / "../VERSION" | ||
if version_file.exists(): | ||
self.version = files.load(self, version_file).strip() | ||
else: | ||
git = scm.Git(self, self.recipe_folder) | ||
self.version = git.run("describe --dirty=-dirty")[1:] | ||
|
||
def requirements(self): | ||
self.requires(f"cloe-runtime/{self.version}@cloe/develop") | ||
self.requires(f"cloe-models/{self.version}@cloe/develop") | ||
|
||
def build_requirements(self): | ||
self.test_requires("gtest/1.13.0") | ||
|
||
def layout(self): | ||
cmake.cmake_layout(self) | ||
|
||
def generate(self): | ||
tc = cmake.CMakeToolchain(self) | ||
tc.cache_variables["CMAKE_EXPORT_COMPILE_COMMANDS"] = True | ||
tc.cache_variables["CLOE_PROJECT_VERSION"] = self.version | ||
tc.cache_variables["TargetLintingExtended"] = True | ||
tc.generate() | ||
|
||
def build(self): | ||
cm = cmake.CMake(self) | ||
if self.should_configure: | ||
cm.configure() | ||
if self.should_build: | ||
cm.build() | ||
if self.should_test: | ||
cm.test() | ||
|
||
def package(self): | ||
cm = cmake.CMake(self) | ||
if self.should_install: | ||
cm.install() | ||
|
||
def package_id(self): | ||
self.info.requires["boost"].full_package_mode() | ||
del self.info.options.pedantic | ||
|
||
def package_info(self): | ||
self.cpp_info.set_property("cmake_find_mode", "both") | ||
self.cpp_info.set_property("cmake_file_name", self.name) | ||
self.cpp_info.set_property("pkg_config_name", self.name) | ||
|
||
if not self.in_local_cache: | ||
libdir = os.path.join(self.build_folder, "lib"); | ||
self.runenv_info.append_path("LD_LIBRARY_PATH", libdir) |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# mypy: ignore-errors | ||
# pylint: skip-file | ||
|
||
from pathlib import Path | ||
|
||
from conan import ConanFile | ||
|
||
|
||
class CloeTest(ConanFile): | ||
python_requires = "cloe-launch-profile/[>=0.20.0]@cloe/develop" | ||
python_requires_extend = "cloe-launch-profile.Base" | ||
|
||
options = { | ||
"with_vtd": [True, False] | ||
} | ||
default_options = { | ||
"with_vtd": False, | ||
|
||
"cloe-engine:server": False, | ||
} | ||
|
||
@property | ||
def cloe_launch_env(self): | ||
return { | ||
"CLOE_ENGINE_WITH_SERVER": "1", | ||
"CLOE_LOG_LEVEL": "debug", | ||
"CLOE_STRICT_MODE": "1", | ||
"CLOE_WRITE_OUTPUT": "0", | ||
"CLOE_ROOT": Path(self.recipe_folder) / "..", | ||
} | ||
|
||
def set_version(self): | ||
self.version = self.project_version("../VERSION") | ||
|
||
def requirements(self): | ||
self.requires(f"cloe-meta/{self.version}@cloe/develop") | ||
if self.options.with_vtd: | ||
self.requires(f"cloe-plugin-vtd/{self.version}@cloe/develop") | ||
# These dependencies aren't pulled in by the "cloe-plugin-vtd" package, | ||
# because they are not required to build the package. | ||
# We need them to run the tests though. | ||
self.requires("osi-sensor/1.0.0-vtd2.2@cloe/stable") | ||
self.requires("vtd/2.2.0@cloe-restricted/stable") |
This file was deleted.
This file was deleted.