Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iox-#2057 Create deprecation macros #2059

Merged
merged 6 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/aspice_swe3_4/example/iceoryx_component/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ iox_add_library(
NAMESPACE iceoryx_component
PRIVATE_INCLUDES source/example_module
BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/generated/iceoryx/include
${CMAKE_BINARY_DIR}/generated/iceoryx_component/include
INSTALL_INTERFACE include/${PREFIX}
PRIVATE_LIBS ${CMAKE_THREAD_LIBS_INIT}
FILES
Expand Down
2 changes: 2 additions & 0 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
- Implement custom error reporting API [\#1032](https://github.com/eclipse-iceoryx/iceoryx/issues/1032)
- Implement iceoryx platform for FreeRTOS [#1982](https://github.com/eclipse-iceoryx/iceoryx/issues/1982)
- Extend 'iceperf' with 'WaitSet' [#2003](https://github.com/eclipse-iceoryx/iceoryx/issues/2003)
- Create iceoryx version header for the C-binding [#1014](https://github.com/eclipse-iceoryx/iceoryx/issues/1014)
- Create macros to deprecate header and code constructs [#2057](https://github.com/eclipse-iceoryx/iceoryx/issues/2057)

**Bugfixes:**

Expand Down
2 changes: 1 addition & 1 deletion iceoryx_binding_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ iox_add_library(
NAMESPACE ${PROJECT_NAME}
PROJECT_PREFIX ${PREFIX}
BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/generated/iceoryx/include
${CMAKE_BINARY_DIR}/generated/iceoryx_binding_c/include
INSTALL_INTERFACE include/${PREFIX}
EXPORT_INCLUDE_DIRS include/
PUBLIC_LIBS_LINUX stdc++ pthread
Expand Down
6 changes: 3 additions & 3 deletions iceoryx_dust/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ iox_add_library(
PUBLIC_LIBS iceoryx_hoofs::iceoryx_hoofs
BUILD_INTERFACE ${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/vocabulary/include
${CMAKE_BINARY_DIR}/generated/iceoryx/include
${CMAKE_BINARY_DIR}/generated/iceoryx_dust/include
INSTALL_INTERFACE include/${PREFIX}
EXPORT_INCLUDE_DIRS include/
vocabulary/include/
Expand All @@ -65,10 +65,10 @@ iox_add_library(
)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_dust_deployment.hpp.in"
"${CMAKE_BINARY_DIR}/generated/iceoryx/include/iceoryx_dust/iceoryx_dust_deployment.hpp" @ONLY)
"${CMAKE_BINARY_DIR}/generated/iceoryx_dust/include/iceoryx_dust/iceoryx_dust_deployment.hpp" @ONLY)

install(
FILES ${CMAKE_BINARY_DIR}/generated/iceoryx/include/${PROJECT_NAME}/iceoryx_dust_deployment.hpp
FILES ${CMAKE_BINARY_DIR}/generated/iceoryx_dust/include/${PROJECT_NAME}/iceoryx_dust_deployment.hpp
DESTINATION include/${PREFIX}/${PROJECT_NAME}/
COMPONENT dev
)
Expand Down
9 changes: 9 additions & 0 deletions iceoryx_hoofs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

load("@rules_cc//cc:defs.bzl", "cc_library")
load("//bazel:configure_file.bzl", "configure_file")
load("//bazel:configure_version.bzl", "configure_version")

configure_file(
name = "iceoryx_hoofs_deployment_hpp",
Expand All @@ -27,6 +28,13 @@ configure_file(
},
)

configure_version(
name = "iceoryx_versions_h",
src = "cmake/iceoryx_versions.h.in",
out = "include/iceoryx_versions.h",
version_from = "//:VERSION",
)

cc_library(
name = "iceoryx_hoofs",
srcs = glob([
Expand All @@ -46,6 +54,7 @@ cc_library(
]),
hdrs = glob(["include/**"]) + glob(["legacy/**"]) + glob(["memory/**"]) + glob(["container/**"]) + glob(["vocabulary/**"]) + glob(["time/**"]) + glob(["utility/**"]) + glob(["primitives/**"]) + glob(["posix/**"]) + glob(["design/**"]) + glob(["buffer/**"]) + glob(["filesystem/**"]) + glob(["functional/**"]) + glob(["reporting/**"]) + [
":iceoryx_hoofs_deployment_hpp",
":iceoryx_versions_h",
],
includes = [
"buffer/include/",
Expand Down
1 change: 1 addition & 0 deletions iceoryx_hoofs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ if(CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin)
endif()

set(PREFIX iceoryx/v${CMAKE_PROJECT_VERSION})
include(cmake/iceoryxversions.cmake)

#
########## build iceoryx hoofs lib ##########
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/cmake/iceoryx_hoofs_deployment.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef IOX_HOOFS_ICEORYX_HOOFS_DEPLOYMENT_HPP
#define IOX_HOOFS_ICEORYX_HOOFS_DEPLOYMENT_HPP

#include "iceoryx_hoofs/iceoryx_hoofs_types.hpp"
#include "iox/iceoryx_hoofs_types.hpp"

namespace iox
{
Expand Down
29 changes: 29 additions & 0 deletions iceoryx_hoofs/cmake/iceoryx_versions.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://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

#ifndef IOX_ICEORYX_VERSIONS_H
#define IOX_ICEORYX_VERSIONS_H

#define ICEORYX_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define ICEORYX_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define ICEORYX_VERSION_PATCH @PROJECT_VERSION_PATCH@
#define ICEORYX_VERSION_TWEAK @IOX_VERSION_TWEAK@

#define ICEORYX_LATEST_RELEASE_VERSION "@PROJECT_VERSION@@IOX_VERSION_SUFFIX@"
#define ICEORYX_BUILDDATE "@ICEORYX_BUILDDATE@"
#define ICEORYX_SHA1 "@ICEORYX_SHA1@"

#endif // IOX_ICEORYX_VERSIONS_H
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ if(DEFINED ${PROJECT_VERSION_TWEAK})
set(IOX_VERSION_TWEAK ${PROJECT_VERSION_TWEAK})
endif()

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_versions.hpp.in"
"${CMAKE_BINARY_DIR}/generated/iceoryx/include/iceoryx_versions.hpp" @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/generated/iceoryx/include/iceoryx_versions.hpp
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_versions.h.in"
"${CMAKE_BINARY_DIR}/generated/iceoryx_hoofs/include/iceoryx_versions.h" @ONLY)
mossmaurice marked this conversation as resolved.
Show resolved Hide resolved
install(FILES ${CMAKE_BINARY_DIR}/generated/iceoryx_hoofs/include/iceoryx_versions.h
DESTINATION include/${PREFIX}
COMPONENT dev)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#ifndef IOX_HOOFS_POSIX_WRAPPER_UNIX_DOMAIN_SOCKET_HPP
#define IOX_HOOFS_POSIX_WRAPPER_UNIX_DOMAIN_SOCKET_HPP

#include "iceoryx_hoofs/cxx/filesystem.hpp"
#include "iceoryx_hoofs/internal/posix_wrapper/ipc_channel.hpp"
#include "iceoryx_platform/fcntl.hpp"
#include "iceoryx_platform/platform_settings.hpp"
Expand All @@ -27,6 +26,7 @@
#include "iceoryx_platform/un.hpp"
#include "iox/builder.hpp"
#include "iox/duration.hpp"
#include "iox/filesystem.hpp"
#include "iox/optional.hpp"

namespace iox
Expand Down
22 changes: 22 additions & 0 deletions iceoryx_hoofs/include/iceoryx_versions.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://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

#ifndef IOX_ICEORYX_VERSIONS_HPP
#define IOX_ICEORYX_VERSIONS_HPP

#include "iceoryx_versions.h"

#endif // IOX_ICEORYX_VERSIONS_HPP
5 changes: 3 additions & 2 deletions iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#define IOX_HOOFS_CXX_ALGORITHM_HPP

#include "iox/algorithm.hpp"
#pragma message( \
"Deprecated in 3.0, removed in 4.0, please include 'iox/algorithm.hpp' instead of 'iceoryx_hoofs/cxx/algorithm.hpp'")
#include "iox/detail/deprecation_marker.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/algorithm.hpp' instead.")

#endif // IOX_HOOFS_CXX_ALGORITHM_HPP
5 changes: 3 additions & 2 deletions iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/attributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
#define IOX_HOOFS_CXX_ATTRIBUTES_HPP

#include "iox/attributes.hpp"
#include "iox/detail/deprecation_marker.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/attributes.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/attributes.hpp' instead")]]
mossmaurice marked this conversation as resolved.
Show resolved Hide resolved
namespace cxx
{
namespace internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
#define IOX_HOOFS_CXX_DEADLINE_TIMER_HPP

#include "iox/deadline_timer.hpp"
#include "iox/detail/deprecation_marker.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/deadline_timer.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/deadline_timer.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::deadline_timer' instead of 'iox::cxx::DeadlineTimer'
Expand Down
5 changes: 3 additions & 2 deletions iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
#ifndef IOX_HOOFS_CXX_EXPECTED_HPP
#define IOX_HOOFS_CXX_EXPECTED_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/expected.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/expected.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/expected.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::error' instead of 'iox::cxx::error'
Expand Down
7 changes: 4 additions & 3 deletions iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
#ifndef IOX_HOOFS_CXX_FILESYSTEM_HPP
#define IOX_HOOFS_CXX_FILESYSTEM_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/filesystem.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/filesystem.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/filesystem.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::access_rights' instead of 'iox::cxx::perms'
using perms = iox::access_rights;
using perms IOX_DEPRECATED_SINCE(3, "Please use 'iox::access_rights' instead.") = iox::access_rights;
} // namespace cxx
} // namespace iox

Expand Down
5 changes: 3 additions & 2 deletions iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
#ifndef IOX_HOOFS_FUNCTION_HPP
#define IOX_HOOFS_FUNCTION_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/function.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/function.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/function.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::function' instead of 'iox::cxx::function'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
#ifndef IOX_HOOFS_CXX_FUNCTION_REF_HPP
#define IOX_HOOFS_CXX_FUNCTION_REF_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/function_ref.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/function_ref.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/function_ref.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::function_ref' instead of 'iox::cxx::function_ref'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
#ifndef IOX_HOOFS_CXX_FUNCTIONAL_INTERFACE_HPP
#define IOX_HOOFS_CXX_FUNCTIONAL_INTERFACE_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/functional_interface.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/functional_interface.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/functional_interface.hpp' instead")]]
namespace cxx
{
namespace internal
Expand Down
5 changes: 3 additions & 2 deletions iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/newtype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
#ifndef IOX_HOOFS_CXX_NEWTYPE_HPP
#define IOX_HOOFS_CXX_NEWTYPE_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/newtype.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/newtype.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/newtype.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::NewType' instead of 'iox::cxx::NewType'
Expand Down
5 changes: 3 additions & 2 deletions iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
#ifndef IOX_HOOFS_CXX_OPTIONAL_HPP
#define IOX_HOOFS_CXX_OPTIONAL_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/optional.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/optional.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/optional.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::in_place' instead of 'iox::cxx::in_place'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
#ifndef IOX_HOOFS_CXX_SCOPE_GUARD_HPP
#define IOX_HOOFS_CXX_SCOPE_GUARD_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/scope_guard.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/scope_guard.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/scope_guard.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::ScopeGuard' instead of 'iox::cxx::ScopeGuard'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
#ifndef IOX_HOOFS_CXX_SCOPED_STATIC_HPP
#define IOX_HOOFS_CXX_SCOPED_STATIC_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/scoped_static.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/scoped_static.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/scoped_static.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::makeScopedStatic' instead of 'iox::cxx::makeScopedStatic'
Expand Down
5 changes: 3 additions & 2 deletions iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
#ifndef IOX_HOOFS_CXX_STACK_HPP
#define IOX_HOOFS_CXX_STACK_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/stack.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/stack.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/stack.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::stack' instead of 'iox::cxx::stack'
Expand Down
5 changes: 3 additions & 2 deletions iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
#ifndef IOX_HOOFS_CXX_STRING_HPP
#define IOX_HOOFS_CXX_STRING_HPP

#include "iox/detail/deprecation_marker.hpp"
#include "iox/string.hpp"

IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/string.hpp' instead.")

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/string.hpp' instead")]]
namespace cxx
{
/// @deprecated use 'iox::concatenate' instead of 'iox::cxx::concatenate'
Expand Down
Loading