From 48e36b019208d4480b1937afc59f534b594e08ec Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Mon, 12 Jun 2023 17:20:40 +0200 Subject: [PATCH 01/20] Refactored everything to be structured more correctly --- CMakeLists.txt | 499 ++---------------- aws/CMakeLists.txt | 35 ++ aws/cmake/dependencies.cmake | 28 + .../core}/log_uploader/AwsLogUploader.cpp | 2 +- .../core}/log_uploader/AwsLogUploader.h | 2 +- cmake/cxx-settings.cmake | 22 + cmake/dependencies.cmake | 11 + cmake/paths.cmake | 16 + cmake/poco-options.cmake | 90 ++++ configure.sh | 2 +- connectivity/CMakeLists.txt | 192 +++++++ connectivity/cmake/dependencies.cmake | 62 +++ {core => connectivity/core}/MessageListener.h | 2 +- {core => connectivity/core}/Types.cpp | 2 +- {core => connectivity/core}/Types.h | 2 +- .../connectivity/ConnectivityService.cpp | 2 +- .../core}/connectivity/ConnectivityService.h | 2 +- .../connectivity/InboundMessageHandler.h | 2 +- .../InboundPlatformMessageHandler.cpp | 6 +- .../InboundPlatformMessageHandler.h | 4 +- .../connectivity/OutboundMessageHandler.h | 2 +- .../OutboundRetryMessageHandler.cpp | 6 +- .../OutboundRetryMessageHandler.h | 4 +- .../core}/connectivity/mqtt/MqttCallback.cpp | 2 +- .../core}/connectivity/mqtt/MqttCallback.h | 2 +- .../core}/connectivity/mqtt/MqttClient.cpp | 2 +- .../core}/connectivity/mqtt/MqttClient.h | 2 +- .../mqtt/MqttConnectivityService.cpp | 2 +- .../mqtt/MqttConnectivityService.h | 4 +- .../connectivity/mqtt/PahoMqttClient.cpp | 4 +- .../core}/connectivity/mqtt/PahoMqttClient.h | 2 +- .../core}/model/Attribute.cpp | 2 +- {core => connectivity/core}/model/Attribute.h | 2 +- {core => connectivity/core}/model/Device.cpp | 2 +- {core => connectivity/core}/model/Device.h | 2 +- {core => connectivity/core}/model/Feed.cpp | 2 +- {core => connectivity/core}/model/Feed.h | 2 +- {core => connectivity/core}/model/Message.cpp | 2 +- {core => connectivity/core}/model/Message.h | 2 +- {core => connectivity/core}/model/Reading.cpp | 2 +- {core => connectivity/core}/model/Reading.h | 2 +- .../messages/AttributeRegistrationMessage.cpp | 2 +- .../messages/AttributeRegistrationMessage.h | 2 +- .../ChildrenSynchronizationRequestMessage.cpp | 2 +- .../ChildrenSynchronizationRequestMessage.h | 2 +- ...ChildrenSynchronizationResponseMessage.cpp | 2 +- .../ChildrenSynchronizationResponseMessage.h | 2 +- .../DetailsSynchronizationRequestMessage.cpp | 2 +- .../DetailsSynchronizationRequestMessage.h | 2 +- .../DetailsSynchronizationResponseMessage.cpp | 2 +- .../DetailsSynchronizationResponseMessage.h | 2 +- .../messages/DeviceRegistrationMessage.cpp | 2 +- .../messages/DeviceRegistrationMessage.h | 2 +- .../DeviceRegistrationResponseMessage.cpp | 2 +- .../DeviceRegistrationResponseMessage.h | 2 +- .../model/messages/DeviceRemovalMessage.cpp | 2 +- .../model/messages/DeviceRemovalMessage.h | 2 +- .../core}/model/messages/ErrorMessage.cpp | 2 +- .../core}/model/messages/ErrorMessage.h | 2 +- .../messages/FeedRegistrationMessage.cpp | 2 +- .../model/messages/FeedRegistrationMessage.h | 2 +- .../model/messages/FeedRemovalMessage.cpp | 2 +- .../core}/model/messages/FeedRemovalMessage.h | 2 +- .../model/messages/FeedValuesMessage.cpp | 2 +- .../core}/model/messages/FeedValuesMessage.h | 2 +- .../messages/FileBinaryRequestMessage.cpp | 2 +- .../model/messages/FileBinaryRequestMessage.h | 2 +- .../messages/FileBinaryResponseMessage.cpp | 4 +- .../messages/FileBinaryResponseMessage.h | 2 +- .../model/messages/FileDeleteMessage.cpp | 2 +- .../core}/model/messages/FileDeleteMessage.h | 2 +- .../model/messages/FileListRequestMessage.cpp | 2 +- .../model/messages/FileListRequestMessage.h | 2 +- .../messages/FileListResponseMessage.cpp | 2 +- .../model/messages/FileListResponseMessage.h | 2 +- .../core}/model/messages/FilePurgeMessage.cpp | 2 +- .../core}/model/messages/FilePurgeMessage.h | 2 +- .../model/messages/FileUploadAbortMessage.cpp | 2 +- .../model/messages/FileUploadAbortMessage.h | 2 +- .../messages/FileUploadInitiateMessage.cpp | 2 +- .../messages/FileUploadInitiateMessage.h | 2 +- .../messages/FileUploadStatusMessage.cpp | 2 +- .../model/messages/FileUploadStatusMessage.h | 2 +- .../messages/FileUrlDownloadAbortMessage.cpp | 2 +- .../messages/FileUrlDownloadAbortMessage.h | 2 +- .../messages/FileUrlDownloadInitMessage.cpp | 2 +- .../messages/FileUrlDownloadInitMessage.h | 2 +- .../messages/FileUrlDownloadStatusMessage.cpp | 2 +- .../messages/FileUrlDownloadStatusMessage.h | 2 +- .../messages/FirmwareUpdateAbortMessage.cpp | 2 +- .../messages/FirmwareUpdateAbortMessage.h | 2 +- .../messages/FirmwareUpdateInstallMessage.cpp | 2 +- .../messages/FirmwareUpdateInstallMessage.h | 2 +- .../messages/FirmwareUpdateStatusMessage.cpp | 2 +- .../messages/FirmwareUpdateStatusMessage.h | 2 +- .../messages/GatewaySubdeviceMessage.cpp | 2 +- .../model/messages/GatewaySubdeviceMessage.h | 0 .../core}/model/messages/MessageModel.h | 2 +- .../model/messages/ParametersPullMessage.cpp | 2 +- .../model/messages/ParametersPullMessage.h | 2 +- .../messages/ParametersUpdateMessage.cpp | 2 +- .../model/messages/ParametersUpdateMessage.h | 2 +- .../model/messages/PlatformStatusMessage.cpp | 4 +- .../model/messages/PlatformStatusMessage.h | 6 +- .../model/messages/PullFeedValuesMessage.cpp | 2 +- .../model/messages/PullFeedValuesMessage.h | 2 +- .../RegisteredDevicesRequestMessage.cpp | 2 +- .../RegisteredDevicesRequestMessage.h | 2 +- .../RegisteredDevicesResponseMessage.cpp | 2 +- .../RegisteredDevicesResponseMessage.h | 2 +- .../messages/SynchronizeParametersMessage.cpp | 2 +- .../messages/SynchronizeParametersMessage.h | 2 +- .../core}/persistence/MessagePersistence.h | 2 +- .../core}/persistence/Persistence.h | 2 +- .../CircularFileSystemMessagePersistence.cpp | 6 +- .../CircularFileSystemMessagePersistence.h | 2 +- .../FileSystemMessagePersistence.cpp | 6 +- .../filesystem/FileSystemMessagePersistence.h | 2 +- .../filesystem/MessagePersister.cpp | 2 +- .../persistence/filesystem/MessagePersister.h | 2 +- .../inmemory/InMemoryMessagePersistence.cpp | 2 +- .../inmemory/InMemoryMessagePersistence.h | 2 +- .../inmemory/InMemoryPersistence.cpp | 2 +- .../inmemory/InMemoryPersistence.h | 2 +- .../core}/protocol/DataProtocol.h | 2 +- .../core}/protocol/ErrorProtocol.h | 2 +- .../core}/protocol/FileManagementProtocol.h | 2 +- .../core}/protocol/FirmwareUpdateProtocol.h | 2 +- .../protocol/GatewayPlatformStatusProtocol.h | 2 +- .../protocol/GatewayRegistrationProtocol.h | 2 +- .../core}/protocol/GatewaySubdeviceProtocol.h | 2 +- .../core}/protocol/PlatformStatusProtocol.h | 2 +- .../core}/protocol/Protocol.h | 2 +- .../core}/protocol/RegistrationProtocol.h | 2 +- .../wolkabout/WolkaboutDataProtocol.cpp | 4 +- .../wolkabout/WolkaboutDataProtocol.h | 2 +- .../wolkabout/WolkaboutErrorProtocol.cpp | 4 +- .../wolkabout/WolkaboutErrorProtocol.h | 2 +- .../WolkaboutFileManagementProtocol.cpp | 4 +- .../WolkaboutFileManagementProtocol.h | 2 +- .../WolkaboutFirmwareUpdateProtocol.cpp | 4 +- .../WolkaboutFirmwareUpdateProtocol.h | 2 +- ...WolkaboutGatewayPlatformStatusProtocol.cpp | 4 +- .../WolkaboutGatewayPlatformStatusProtocol.h | 2 +- .../WolkaboutGatewayRegistrationProtocol.cpp | 4 +- .../WolkaboutGatewayRegistrationProtocol.h | 2 +- .../WolkaboutGatewaySubdeviceProtocol.cpp | 6 +- .../WolkaboutGatewaySubdeviceProtocol.h | 2 +- .../WolkaboutPlatformStatusProtocol.cpp | 4 +- .../WolkaboutPlatformStatusProtocol.h | 2 +- .../protocol/wolkabout/WolkaboutProtocol.cpp | 2 +- .../protocol/wolkabout/WolkaboutProtocol.h | 2 +- .../WolkaboutRegistrationProtocol.cpp | 4 +- .../wolkabout/WolkaboutRegistrationProtocol.h | 2 +- {tests => connectivity/tests}/BufferTests.cpp | 2 +- .../tests}/ByteUtilsTests.cpp | 2 +- connectivity/tests/CMakeLists.txt | 57 ++ .../tests}/CommandBufferTests.cpp | 2 +- .../tests}/FileSystemUtils.cpp | 2 +- .../InboundPlatformMessageHandlerTests.cpp | 2 +- .../tests}/LogManagerTests.cpp | 2 +- {tests => connectivity/tests}/LoggerTests.cpp | 2 +- .../tests}/ModelMessagesTests.cpp | 2 +- {tests => connectivity/tests}/ModelsTests.cpp | 2 +- .../tests}/MqttConnectivityServiceTests.cpp | 2 +- .../OutboundRetryMessageHandlerTests.cpp | 2 +- .../tests}/PahoMqttClientTests.cpp | 2 +- .../tests}/StringUtilsTests.cpp | 2 +- {tests => connectivity/tests}/TimerTests.cpp | 2 +- {tests => connectivity/tests}/TypesTests.cpp | 4 +- .../tests}/WolkaboutDataProtocolTests.cpp | 2 +- .../tests}/WolkaboutErrorProtocolTests.cpp | 2 +- .../WolkaboutFileManagementProtocolTests.cpp | 0 .../WolkaboutFirmwareUpdateProtocolTests.cpp | 0 ...boutGatewayPlatformStatusProtocolTests.cpp | 2 +- ...kaboutGatewayRegistrationProtocolTests.cpp | 2 +- ...WolkaboutGatewaySubdeviceProtocolTests.cpp | 2 +- .../WolkaboutPlatformStatusProtocolTests.cpp | 2 +- .../WolkaboutRegistrationProtocolTests.cpp | 2 +- .../tests}/mocks/ConnectivityServiceMock.h | 2 +- .../tests}/mocks/DataProtocolMock.h | 2 +- .../tests}/mocks/ErrorProtocolMock.h | 2 +- .../tests}/mocks/FileManagementProtocolMock.h | 2 +- .../tests}/mocks/FirmwareUpdateProtocolMock.h | 0 .../mocks/GatewayPlatformStatusProtocolMock.h | 2 +- .../mocks/GatewayRegistrationProtocolMock.h | 2 +- .../mocks/GatewaySubdeviceProtocolMock.h | 2 +- .../tests}/mocks/InboundMessageHandlerMock.h | 2 +- .../tests}/mocks/MessageListenerMock.h | 2 +- .../tests}/mocks/MessagePersistenceMock.h | 2 +- .../tests}/mocks/OutboundMessageHandlerMock.h | 2 +- .../mocks/OutboundRetryMessageHandlerMock.h | 2 +- .../tests}/mocks/PahoMqttClientMock.h | 2 +- .../tests}/mocks/PersistenceMock.h | 2 +- .../tests}/mocks/PlatformStatusProtocolMock.h | 2 +- .../tests}/mocks/ProtocolMock.h | 2 +- .../tests}/mocks/RegistrationProtocolMock.h | 2 +- core/LICENSE | 201 ------- dependencies/CMakeLists.txt | 137 ----- out/coverage.sh | 9 - util/CMakeLists.txt | 50 ++ util/cmake/dependencies.cmake | 18 + .../utilities => util/core/utility}/Buffer.h | 4 +- .../core/utility}/ByteUtils.cpp | 4 +- .../core/utility}/ByteUtils.h | 2 +- .../core/utility}/CommandBuffer.cpp | 2 +- .../core/utility}/CommandBuffer.h | 2 +- .../core/utility}/FileSystemUtils.cpp | 2 +- .../core/utility}/FileSystemUtils.h | 4 +- .../core/utility}/LogManager.cpp | 0 .../core/utility}/LogManager.h | 4 +- .../core/utility}/LogUploader.h | 0 .../core/utility}/Logger.cpp | 16 +- .../utilities => util/core/utility}/Logger.h | 2 +- .../utilities => util/core/utility}/Service.h | 0 .../core/utility}/StringUtils.cpp | 2 +- .../core/utility}/StringUtils.h | 4 +- .../utilities => util/core/utility}/Timer.cpp | 2 +- {core/utilities => util/core/utility}/Timer.h | 2 +- 219 files changed, 871 insertions(+), 1028 deletions(-) create mode 100644 aws/CMakeLists.txt create mode 100644 aws/cmake/dependencies.cmake rename {core => aws/core}/log_uploader/AwsLogUploader.cpp (98%) rename {core => aws/core}/log_uploader/AwsLogUploader.h (97%) create mode 100644 cmake/cxx-settings.cmake create mode 100644 cmake/dependencies.cmake create mode 100644 cmake/paths.cmake create mode 100644 cmake/poco-options.cmake create mode 100644 connectivity/CMakeLists.txt create mode 100644 connectivity/cmake/dependencies.cmake rename {core => connectivity/core}/MessageListener.h (95%) rename {core => connectivity/core}/Types.cpp (99%) rename {core => connectivity/core}/Types.h (99%) rename {core => connectivity/core}/connectivity/ConnectivityService.cpp (95%) rename {core => connectivity/core}/connectivity/ConnectivityService.h (96%) rename {core => connectivity/core}/connectivity/InboundMessageHandler.h (96%) rename {core => connectivity/core}/connectivity/InboundPlatformMessageHandler.cpp (96%) rename {core => connectivity/core}/connectivity/InboundPlatformMessageHandler.h (95%) rename {core => connectivity/core}/connectivity/OutboundMessageHandler.h (95%) rename {core => connectivity/core}/connectivity/OutboundRetryMessageHandler.cpp (97%) rename {core => connectivity/core}/connectivity/OutboundRetryMessageHandler.h (95%) rename {core => connectivity/core}/connectivity/mqtt/MqttCallback.cpp (97%) rename {core => connectivity/core}/connectivity/mqtt/MqttCallback.h (97%) rename {core => connectivity/core}/connectivity/mqtt/MqttClient.cpp (97%) rename {core => connectivity/core}/connectivity/mqtt/MqttClient.h (97%) rename {core => connectivity/core}/connectivity/mqtt/MqttConnectivityService.cpp (99%) rename {core => connectivity/core}/connectivity/mqtt/MqttConnectivityService.h (97%) rename {core => connectivity/core}/connectivity/mqtt/PahoMqttClient.cpp (98%) rename {core => connectivity/core}/connectivity/mqtt/PahoMqttClient.h (97%) rename {core => connectivity/core}/model/Attribute.cpp (96%) rename {core => connectivity/core}/model/Attribute.h (97%) rename {core => connectivity/core}/model/Device.cpp (97%) rename {core => connectivity/core}/model/Device.h (98%) rename {core => connectivity/core}/model/Feed.cpp (96%) rename {core => connectivity/core}/model/Feed.h (98%) rename {core => connectivity/core}/model/Message.cpp (95%) rename {core => connectivity/core}/model/Message.h (97%) rename {core => connectivity/core}/model/Reading.cpp (99%) rename {core => connectivity/core}/model/Reading.h (99%) rename {core => connectivity/core}/model/messages/AttributeRegistrationMessage.cpp (95%) rename {core => connectivity/core}/model/messages/AttributeRegistrationMessage.h (96%) rename {core => connectivity/core}/model/messages/ChildrenSynchronizationRequestMessage.cpp (94%) rename {core => connectivity/core}/model/messages/ChildrenSynchronizationRequestMessage.h (95%) rename {core => connectivity/core}/model/messages/ChildrenSynchronizationResponseMessage.cpp (96%) rename {core => connectivity/core}/model/messages/ChildrenSynchronizationResponseMessage.h (96%) rename {core => connectivity/core}/model/messages/DetailsSynchronizationRequestMessage.cpp (94%) rename {core => connectivity/core}/model/messages/DetailsSynchronizationRequestMessage.h (95%) rename {core => connectivity/core}/model/messages/DetailsSynchronizationResponseMessage.cpp (96%) rename {core => connectivity/core}/model/messages/DetailsSynchronizationResponseMessage.h (96%) rename {core => connectivity/core}/model/messages/DeviceRegistrationMessage.cpp (95%) rename {core => connectivity/core}/model/messages/DeviceRegistrationMessage.h (97%) rename {core => connectivity/core}/model/messages/DeviceRegistrationResponseMessage.cpp (96%) rename {core => connectivity/core}/model/messages/DeviceRegistrationResponseMessage.h (96%) rename {core => connectivity/core}/model/messages/DeviceRemovalMessage.cpp (95%) rename {core => connectivity/core}/model/messages/DeviceRemovalMessage.h (95%) rename {core => connectivity/core}/model/messages/ErrorMessage.cpp (96%) rename {core => connectivity/core}/model/messages/ErrorMessage.h (96%) rename {core => connectivity/core}/model/messages/FeedRegistrationMessage.cpp (95%) rename {core => connectivity/core}/model/messages/FeedRegistrationMessage.h (96%) rename {core => connectivity/core}/model/messages/FeedRemovalMessage.cpp (95%) rename {core => connectivity/core}/model/messages/FeedRemovalMessage.h (96%) rename {core => connectivity/core}/model/messages/FeedValuesMessage.cpp (95%) rename {core => connectivity/core}/model/messages/FeedValuesMessage.h (96%) rename {core => connectivity/core}/model/messages/FileBinaryRequestMessage.cpp (96%) rename {core => connectivity/core}/model/messages/FileBinaryRequestMessage.h (96%) rename {core => connectivity/core}/model/messages/FileBinaryResponseMessage.cpp (94%) rename {core => connectivity/core}/model/messages/FileBinaryResponseMessage.h (96%) rename {core => connectivity/core}/model/messages/FileDeleteMessage.cpp (95%) rename {core => connectivity/core}/model/messages/FileDeleteMessage.h (95%) rename {core => connectivity/core}/model/messages/FileListRequestMessage.cpp (94%) rename {core => connectivity/core}/model/messages/FileListRequestMessage.h (95%) rename {core => connectivity/core}/model/messages/FileListResponseMessage.cpp (95%) rename {core => connectivity/core}/model/messages/FileListResponseMessage.h (96%) rename {core => connectivity/core}/model/messages/FilePurgeMessage.cpp (94%) rename {core => connectivity/core}/model/messages/FilePurgeMessage.h (95%) rename {core => connectivity/core}/model/messages/FileUploadAbortMessage.cpp (95%) rename {core => connectivity/core}/model/messages/FileUploadAbortMessage.h (95%) rename {core => connectivity/core}/model/messages/FileUploadInitiateMessage.cpp (96%) rename {core => connectivity/core}/model/messages/FileUploadInitiateMessage.h (96%) rename {core => connectivity/core}/model/messages/FileUploadStatusMessage.cpp (96%) rename {core => connectivity/core}/model/messages/FileUploadStatusMessage.h (96%) rename {core => connectivity/core}/model/messages/FileUrlDownloadAbortMessage.cpp (95%) rename {core => connectivity/core}/model/messages/FileUrlDownloadAbortMessage.h (95%) rename {core => connectivity/core}/model/messages/FileUrlDownloadInitMessage.cpp (95%) rename {core => connectivity/core}/model/messages/FileUrlDownloadInitMessage.h (95%) rename {core => connectivity/core}/model/messages/FileUrlDownloadStatusMessage.cpp (97%) rename {core => connectivity/core}/model/messages/FileUrlDownloadStatusMessage.h (97%) rename {core => connectivity/core}/model/messages/FirmwareUpdateAbortMessage.cpp (94%) rename {core => connectivity/core}/model/messages/FirmwareUpdateAbortMessage.h (95%) rename {core => connectivity/core}/model/messages/FirmwareUpdateInstallMessage.cpp (95%) rename {core => connectivity/core}/model/messages/FirmwareUpdateInstallMessage.h (95%) rename {core => connectivity/core}/model/messages/FirmwareUpdateStatusMessage.cpp (96%) rename {core => connectivity/core}/model/messages/FirmwareUpdateStatusMessage.h (96%) rename {core => connectivity/core}/model/messages/GatewaySubdeviceMessage.cpp (94%) rename {core => connectivity/core}/model/messages/GatewaySubdeviceMessage.h (100%) rename {core => connectivity/core}/model/messages/MessageModel.h (96%) rename {core => connectivity/core}/model/messages/ParametersPullMessage.cpp (94%) rename {core => connectivity/core}/model/messages/ParametersPullMessage.h (95%) rename {core => connectivity/core}/model/messages/ParametersUpdateMessage.cpp (95%) rename {core => connectivity/core}/model/messages/ParametersUpdateMessage.h (96%) rename {core => connectivity/core}/model/messages/PlatformStatusMessage.cpp (95%) rename {core => connectivity/core}/model/messages/PlatformStatusMessage.h (90%) rename {core => connectivity/core}/model/messages/PullFeedValuesMessage.cpp (94%) rename {core => connectivity/core}/model/messages/PullFeedValuesMessage.h (95%) rename {core => connectivity/core}/model/messages/RegisteredDevicesRequestMessage.cpp (96%) rename {core => connectivity/core}/model/messages/RegisteredDevicesRequestMessage.h (96%) rename {core => connectivity/core}/model/messages/RegisteredDevicesResponseMessage.cpp (97%) rename {core => connectivity/core}/model/messages/RegisteredDevicesResponseMessage.h (97%) rename {core => connectivity/core}/model/messages/SynchronizeParametersMessage.cpp (95%) rename {core => connectivity/core}/model/messages/SynchronizeParametersMessage.h (96%) rename {core => connectivity/core}/persistence/MessagePersistence.h (97%) rename {core => connectivity/core}/persistence/Persistence.h (99%) rename {core => connectivity/core}/persistence/filesystem/CircularFileSystemMessagePersistence.cpp (96%) rename {core => connectivity/core}/persistence/filesystem/CircularFileSystemMessagePersistence.h (97%) rename {core => connectivity/core}/persistence/filesystem/FileSystemMessagePersistence.cpp (98%) rename {core => connectivity/core}/persistence/filesystem/FileSystemMessagePersistence.h (97%) rename {core => connectivity/core}/persistence/filesystem/MessagePersister.cpp (96%) rename {core => connectivity/core}/persistence/filesystem/MessagePersister.h (95%) rename {core => connectivity/core}/persistence/inmemory/InMemoryMessagePersistence.cpp (96%) rename {core => connectivity/core}/persistence/inmemory/InMemoryMessagePersistence.h (96%) rename {core => connectivity/core}/persistence/inmemory/InMemoryPersistence.cpp (99%) rename {core => connectivity/core}/persistence/inmemory/InMemoryPersistence.h (98%) rename {core => connectivity/core}/protocol/DataProtocol.h (99%) rename {core => connectivity/core}/protocol/ErrorProtocol.h (96%) rename {core => connectivity/core}/protocol/FileManagementProtocol.h (99%) rename {core => connectivity/core}/protocol/FirmwareUpdateProtocol.h (98%) rename {core => connectivity/core}/protocol/GatewayPlatformStatusProtocol.h (97%) rename {core => connectivity/core}/protocol/GatewayRegistrationProtocol.h (98%) rename {core => connectivity/core}/protocol/GatewaySubdeviceProtocol.h (97%) rename {core => connectivity/core}/protocol/PlatformStatusProtocol.h (96%) rename {core => connectivity/core}/protocol/Protocol.h (98%) rename {core => connectivity/core}/protocol/RegistrationProtocol.h (99%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutDataProtocol.cpp (99%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutDataProtocol.h (98%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutErrorProtocol.cpp (97%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutErrorProtocol.h (97%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutFileManagementProtocol.cpp (99%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutFileManagementProtocol.h (98%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.cpp (98%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h (97%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.cpp (96%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.h (97%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.cpp (99%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.h (97%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.cpp (97%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.h (97%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutPlatformStatusProtocol.cpp (97%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h (97%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutProtocol.cpp (99%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutProtocol.h (98%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutRegistrationProtocol.cpp (99%) rename {core => connectivity/core}/protocol/wolkabout/WolkaboutRegistrationProtocol.h (98%) rename {tests => connectivity/tests}/BufferTests.cpp (95%) rename {tests => connectivity/tests}/ByteUtilsTests.cpp (98%) create mode 100644 connectivity/tests/CMakeLists.txt rename {tests => connectivity/tests}/CommandBufferTests.cpp (95%) rename {tests => connectivity/tests}/FileSystemUtils.cpp (99%) rename {tests => connectivity/tests}/InboundPlatformMessageHandlerTests.cpp (98%) rename {tests => connectivity/tests}/LogManagerTests.cpp (95%) rename {tests => connectivity/tests}/LoggerTests.cpp (97%) rename {tests => connectivity/tests}/ModelMessagesTests.cpp (99%) rename {tests => connectivity/tests}/ModelsTests.cpp (99%) rename {tests => connectivity/tests}/MqttConnectivityServiceTests.cpp (97%) rename {tests => connectivity/tests}/OutboundRetryMessageHandlerTests.cpp (98%) rename {tests => connectivity/tests}/PahoMqttClientTests.cpp (95%) rename {tests => connectivity/tests}/StringUtilsTests.cpp (98%) rename {tests => connectivity/tests}/TimerTests.cpp (98%) rename {tests => connectivity/tests}/TypesTests.cpp (99%) rename {tests => connectivity/tests}/WolkaboutDataProtocolTests.cpp (99%) rename {tests => connectivity/tests}/WolkaboutErrorProtocolTests.cpp (98%) rename {tests => connectivity/tests}/WolkaboutFileManagementProtocolTests.cpp (100%) rename {tests => connectivity/tests}/WolkaboutFirmwareUpdateProtocolTests.cpp (100%) rename {tests => connectivity/tests}/WolkaboutGatewayPlatformStatusProtocolTests.cpp (98%) rename {tests => connectivity/tests}/WolkaboutGatewayRegistrationProtocolTests.cpp (99%) rename {tests => connectivity/tests}/WolkaboutGatewaySubdeviceProtocolTests.cpp (99%) rename {tests => connectivity/tests}/WolkaboutPlatformStatusProtocolTests.cpp (98%) rename {tests => connectivity/tests}/WolkaboutRegistrationProtocolTests.cpp (99%) rename {tests => connectivity/tests}/mocks/ConnectivityServiceMock.h (96%) rename {tests => connectivity/tests}/mocks/DataProtocolMock.h (98%) rename {tests => connectivity/tests}/mocks/ErrorProtocolMock.h (97%) rename {tests => connectivity/tests}/mocks/FileManagementProtocolMock.h (98%) rename {tests => connectivity/tests}/mocks/FirmwareUpdateProtocolMock.h (100%) rename {tests => connectivity/tests}/mocks/GatewayPlatformStatusProtocolMock.h (97%) rename {tests => connectivity/tests}/mocks/GatewayRegistrationProtocolMock.h (97%) rename {tests => connectivity/tests}/mocks/GatewaySubdeviceProtocolMock.h (97%) rename {tests => connectivity/tests}/mocks/InboundMessageHandlerMock.h (96%) rename {tests => connectivity/tests}/mocks/MessageListenerMock.h (96%) rename {tests => connectivity/tests}/mocks/MessagePersistenceMock.h (96%) rename {tests => connectivity/tests}/mocks/OutboundMessageHandlerMock.h (95%) rename {tests => connectivity/tests}/mocks/OutboundRetryMessageHandlerMock.h (96%) rename {tests => connectivity/tests}/mocks/PahoMqttClientMock.h (96%) rename {tests => connectivity/tests}/mocks/PersistenceMock.h (97%) rename {tests => connectivity/tests}/mocks/PlatformStatusProtocolMock.h (97%) rename {tests => connectivity/tests}/mocks/ProtocolMock.h (96%) rename {tests => connectivity/tests}/mocks/RegistrationProtocolMock.h (98%) delete mode 100644 core/LICENSE delete mode 100644 dependencies/CMakeLists.txt delete mode 100755 out/coverage.sh create mode 100644 util/CMakeLists.txt create mode 100644 util/cmake/dependencies.cmake rename {core/utilities => util/core/utility}/Buffer.h (97%) rename {core/utilities => util/core/utility}/ByteUtils.cpp (97%) rename {core/utilities => util/core/utility}/ByteUtils.h (96%) rename {core/utilities => util/core/utility}/CommandBuffer.cpp (98%) rename {core/utilities => util/core/utility}/CommandBuffer.h (97%) rename {core/utilities => util/core/utility}/FileSystemUtils.cpp (99%) rename {core/utilities => util/core/utility}/FileSystemUtils.h (95%) rename {core/utilities => util/core/utility}/LogManager.cpp (100%) rename {core/utilities => util/core/utility}/LogManager.h (97%) rename {core/utilities => util/core/utility}/LogUploader.h (100%) rename {core/utilities => util/core/utility}/Logger.cpp (95%) rename {core/utilities => util/core/utility}/Logger.h (98%) rename {core/utilities => util/core/utility}/Service.h (100%) rename {core/utilities => util/core/utility}/StringUtils.cpp (99%) rename {core/utilities => util/core/utility}/StringUtils.h (97%) rename {core/utilities => util/core/utility}/Timer.cpp (97%) rename {core/utilities => util/core/utility}/Timer.h (96%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0097aeb3..83fc2ca2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2022 Wolkabout Technology s.r.o. +# Copyright 2023 Wolkabout Technology s.r.o. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,15 +12,33 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) -project(WolkAboutCore C CXX) +# Set the version policy +cmake_policy(SET CMP0048 NEW) + +# Define the project +cmake_minimum_required(VERSION 3.24) +project(SDKCore VERSION 3.4.0) +set(PROJECT_VERSION_SUFFIX) +set(NAMESPACE Wolkabout) +set(EMAIL elab@wolkabout.com) +set(REPO_LINK https://github.com/Wolkabout/WolkUtil-CXX) +set(SOURCE_PREFIX_FOLDER connectivity/core) +set(SOURCE_ROOT_FOLDER wolkabout) + +# Define the names for all modules +set(UTIL_TARGET_NAME ${PROJECT_NAME}Util) +set(AWS_LOG_UPLOADER_TARGET_NAME ${PROJECT_NAME}AwsLogUploader) +set(CONNECTIVITY_TARGET_NAME ${PROJECT_NAME}) + +# Define the installation components +set(REL_COMPONENT RELEASE) +set(DEV_COMPONENT DEV) # Options for our library -OPTION(BUILD_SHARED "Build this library as a shared library" ON) OPTION(BUILD_CONNECTIVITY "Build the library with Paho MQTT and allow MQTT connection to the platform." ON) OPTION(BUILD_POCO "Build the library with Poco." ON) OPTION(BUILD_GTEST "Build the library with GTest." ON) -OPTION(BUILD_AWS_LOG_UPLOADER "Build the library with AwsLogUploader." ON) +OPTION(BUILD_AWS_LOG_UPLOADER "Build the library with AwsLogUploader." OFF) OPTION(BUILD_TESTS "Build the unit tests" ON) # Check the GTEST and TESTS option @@ -28,452 +46,43 @@ if (NOT ${BUILD_GTEST} AND ${BUILD_TESTS}) message(FATAL_ERROR "The library can not build TESTS without GTEST.") endif () -# Options for Poco -if (${BUILD_POCO}) - - # The Utility bundle - OPTION(POCO_BUILD_UTIL "" ON) - if (${POCO_BUILD_UTIL}) - OPTION(POCO_ENABLE_UTIL "" ON) - endif () - - # The Network bundle - OPTION(POCO_BUILD_NET "" OFF) - if (${POCO_BUILD_NET}) - OPTION(POCO_ENABLE_NET "" ON) - OPTION(POCO_ENABLE_NETSSL "" ON) - OPTION(POCO_ENABLE_CRYPTO "" ON) - if (WIN32) - OPTION(POCO_ENABLE_NETSSL_WIN "" OFF) - else () - OPTION(POCO_ENABLE_NETSSL_WIN "" ON) - endif () - endif () - - # The Data bundle - OPTION(POCO_BUILD_DATA "" OFF) - if (${POCO_BUILD_DATA}) - OPTION(POCO_ENABLE_DATA "" ON) - OPTION(POCO_ENABLE_DATA_SQLITE "" ON) - OPTION(POCO_ENABLE_DATA_MYSQL "" OFF) - OPTION(POCO_ENABLE_DATA_ODBC "" ON) - endif () - - # The Encodings bundle - OPTION(POCO_BUILD_ENCODINGS "" OFF) - if (${POCO_BUILD_ENCODINGS}) - OPTION(POCO_ENABLE_ENCODINGS "" ON) - OPTION(POCO_ENABLE_ENCODINGS_COMPILER "" ON) - OPTION(POCO_ENABLE_XML "" ON) - OPTION(POCO_ENABLE_JSON "" ON) - endif () - - # The MongoDB bundle - OPTION(POCO_BUILD_MONGODB "" OFF) - if (${POCO_BUILD_MONGODB}) - OPTION(POCO_ENABLE_MONGODB "" ON) - endif () - - # The Redis bundle - OPTION(POCO_BUILD_REDIS "" OFF) - if (${POCO_BUILD_REDIS}) - OPTION(POCO_ENABLE_REDIS "" ON) - endif () - - # The ZIP bundle - OPTION(POCO_BUILD_ZIP "" OFF) - if (${POCO_BUILD_ZIP}) - OPTION(POCO_ENABLE_SEVENZIP "" ON) - OPTION(POCO_ENABLE_ZIP "" ON) - endif () - - # The PageCompiler bundle - OPTION(POCO_BUILD_PAGECOMPILER "" OFF) - if (${POCO_BUILD_PAGECOMPILER}) - OPTION(POCO_ENABLE_PAGECOMPILER "" ON) - OPTION(POCO_ENABLE_PAGECOMPILER_FILE2PAGE "" ON) - endif () - - # The PDF bundle - OPTION(POCO_BUILD_PDF "" OFF) - if (${POCO_BUILD_PDF}) - OPTION(POCO_ENABLE_PDF "" ON) - endif () - - # The Apache connection bundle - OPTION(POCO_BUILD_APACHECONNECTOR "" OFF) - if (${POCO_BUILD_APACHECONNECTOR}) - OPTION(POCO_ENABLE_APACHECONNECTOR "" ON) - endif () - - # The CppParser bundle - OPTION(POCO_BUILD_CPPPARSER "" OFF) - if (${POCO_BUILD_CPPPARSER}) - OPTION(POCO_ENABLE_CPPPARSER "" ON) - endif () - - # The PocoDoc bundle - OPTION(POCO_BUILD_POCODOC "" OFF) - if (${POCO_BUILD_POCODOC}) - OPTION(POCO_ENABLE_POCODOC "" ON) - endif () -endif () - -# Configure the paths for output -if (NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") -endif () +# Add the poco options +include(cmake/poco-options.cmake) -if (NOT DEFINED CMAKE_LIBRARY_INCLUDE_DIRECTORY) - set(CMAKE_LIBRARY_INCLUDE_DIRECTORY "${CMAKE_BINARY_DIR}/include") -endif () +# Set the paths +include(cmake/paths.cmake) -if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -endif () +# Set up the C++ settings +include(cmake/cxx-settings.cmake) -if (NOT DEFINED CMAKE_PREFIX_PATH) - set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}/build") -endif () +# Import dependencies +include(cmake/dependencies.cmake) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic \ - -pedantic-errors -Wcast-align \ - -Wcast-qual -Wconversion \ - -Wdisabled-optimization \ - -Wfloat-equal -Wformat=2 \ - -Werror=init-self \ - -Werror=missing-field-initializers -Wmissing-format-attribute \ - -Wmissing-include-dirs -Wmissing-noreturn \ - -Werror=pointer-arith \ - -Wno-packed -Wno-padded -Wredundant-decls \ - -Werror=shadow -Werror=stack-protector \ - -Wstrict-aliasing=2 -Wno-switch \ - -Werror=unreachable-code -Wunused \ - -Wvariadic-macros \ - -Wwrite-strings -Werror=non-virtual-dtor -Werror=return-type") +# Add the util library +add_subdirectory(util) -if (${BUILD_TESTS}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -g") +# If AWS LogUploader should be built +if (${BUILD_AWS_LOG_UPLOADER}) + add_subdirectory(aws) endif () -if (${BUILD_SHARED}) - set(LIB_TYPE SHARED) -else () - set(LIB_TYPE STATIC) +## If Connectivity should be built +if (${BUILD_CONNECTIVITY}) + add_subdirectory(connectivity) endif () -# Import the dependencies -add_subdirectory(dependencies) -link_directories(${CMAKE_PREFIX_PATH}/lib) -link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) - -find_package(Threads REQUIRED) - -# Wolkabout C++ SDK, in their separated packages -set(INSTALL_TARGETS) -set(TESTS_HEADER_FILES) -set(TESTS_SOURCE_FILES) - -# Define the version of the library -set(WOLKSDK_VERSION_MAJOR 3) -set(WOLKSDK_VERSION_MINOR 3) -set(WOLKSDK_VERSION_PATCH 0) -set(WOLKSDK_VERSION_SUFFIX) - -set(WOLKSDK_VERSION_STRING "${WOLKSDK_VERSION_MAJOR}.${WOLKSDK_VERSION_MINOR}.${WOLKSDK_VERSION_PATCH}") -if (NOT "${WOLKSDK_VERSION_SUFFIX}" STREQUAL "") - set(WOLKSDK_VERSION_STRING "${WOLKSDK_VERSION_STRING}-${WOLKSDK_VERSION_SUFFIX}") -endif () - -# Utilities -set(UTILITY_SOURCE_FILES core/utilities/ByteUtils.cpp - core/utilities/CommandBuffer.cpp - core/utilities/FileSystemUtils.cpp - core/utilities/Logger.cpp - core/utilities/LogManager.cpp - core/utilities/StringUtils.cpp - core/utilities/Timer.cpp) -set(UTILITY_HEADER_FILES core/utilities/Buffer.h - core/utilities/ByteUtils.h - core/utilities/CommandBuffer.h - core/utilities/FileSystemUtils.h - core/utilities/Logger.h - core/utilities/LogManager.h - core/utilities/LogUploader.h - core/utilities/Service.h - core/utilities/StringUtils.h - core/utilities/Timer.h) - -# path for interface files -file(COPY core/utilities/ DESTINATION ${CMAKE_LIBRARY_INCLUDE_DIRECTORY}/core/utilities PATTERN *.cpp EXCLUDE) - -add_library(${PROJECT_NAME}Utility ${LIB_TYPE} ${UTILITY_SOURCE_FILES} ${UTILITY_HEADER_FILES}) -target_link_libraries(${PROJECT_NAME}Utility crypto Threads::Threads) -target_include_directories(${PROJECT_NAME}Utility PRIVATE ${PROJECT_SOURCE_DIR}) -target_include_directories(${PROJECT_NAME}Utility SYSTEM PRIVATE ${CMAKE_PREFIX_PATH}/include) -target_include_directories(${PROJECT_NAME}Utility PUBLIC $ $) -set_target_properties(${PROJECT_NAME}Utility PROPERTIES INSTALL_RPATH "$ORIGIN") -set_target_properties(${PROJECT_NAME}Utility PROPERTIES VERSION ${WOLKSDK_VERSION_STRING} SOVERSION ${WOLKSDK_VERSION_MAJOR}.${WOLKSDK_VERSION_MINOR}.${WOLKSDK_VERSION_PATCH}) -add_dependencies(${PROJECT_NAME}Utility spdlog) - -list(APPEND INSTALL_TARGETS ${PROJECT_NAME}Utility) - -# Build the AwsLogUploader -if (BUILD_AWS_LOG_UPLOADER) - set(ALU_SOURCE_FILES core/log_uploader/AwsLogUploader.cpp) - set(ALU_HEADER_FILES core/log_uploader/AwsLogUploader.h) - - file(COPY core/log_uploader/ DESTINATION ${CMAKE_LIBRARY_INCLUDE_DIRECTORY}/core/log_uploader PATTERN *.cpp EXCLUDE) - - add_library(${PROJECT_NAME}Aws ${LIB_TYPE} ${ALU_SOURCE_FILES} ${ALU_HEADER_FILES}) - target_link_libraries(${PROJECT_NAME}Aws ${PROJECT_NAME}Utility aws-cpp-sdk-core aws-cpp-sdk-s3) - target_include_directories(${PROJECT_NAME}Aws PRIVATE ${PROJECT_SOURCE_DIR}) - target_include_directories(${PROJECT_NAME}Aws SYSTEM PRIVATE ${CMAKE_PREFIX_PATH}/include) - target_include_directories(${PROJECT_NAME}Aws PUBLIC $ $) - set_target_properties(${PROJECT_NAME}Aws PROPERTIES INSTALL_RPATH "$ORIGIN") - set_target_properties(${PROJECT_NAME}Aws PROPERTIES VERSION ${WOLKSDK_VERSION_STRING} SOVERSION ${WOLKSDK_VERSION_MAJOR}.${WOLKSDK_VERSION_MINOR}.${WOLKSDK_VERSION_PATCH}) - add_dependencies(${PROJECT_NAME}Aws ${PROJECT_NAME}Utility aws-sdk-cpp) - - list(APPEND INSTALL_TARGETS ${PROJECT_NAME}Aws) -endif () - -# Build the MQTT logic if Paho is enabled -if (BUILD_CONNECTIVITY) - set(LIB_SOURCE_FILES core/connectivity/ConnectivityService.cpp - core/connectivity/InboundPlatformMessageHandler.cpp - core/connectivity/OutboundRetryMessageHandler.cpp - core/connectivity/mqtt/MqttCallback.cpp - core/connectivity/mqtt/MqttClient.cpp - core/connectivity/mqtt/MqttConnectivityService.cpp - core/connectivity/mqtt/PahoMqttClient.cpp - core/model/Attribute.cpp - core/model/Device.cpp - core/model/Feed.cpp - core/model/Message.cpp - core/model/Reading.cpp - core/model/messages/AttributeRegistrationMessage.cpp - core/model/messages/ChildrenSynchronizationRequestMessage.cpp - core/model/messages/ChildrenSynchronizationResponseMessage.cpp - core/model/messages/DetailsSynchronizationRequestMessage.cpp - core/model/messages/DetailsSynchronizationResponseMessage.cpp - core/model/messages/DeviceRegistrationMessage.cpp - core/model/messages/DeviceRegistrationResponseMessage.cpp - core/model/messages/DeviceRemovalMessage.cpp - core/model/messages/ErrorMessage.cpp - core/model/messages/FeedRegistrationMessage.cpp - core/model/messages/FeedRemovalMessage.cpp - core/model/messages/FeedValuesMessage.cpp - core/model/messages/FileBinaryRequestMessage.cpp - core/model/messages/FileBinaryResponseMessage.cpp - core/model/messages/FileDeleteMessage.cpp - core/model/messages/FileListRequestMessage.cpp - core/model/messages/FileListResponseMessage.cpp - core/model/messages/FilePurgeMessage.cpp - core/model/messages/FileUploadAbortMessage.cpp - core/model/messages/FileUploadInitiateMessage.cpp - core/model/messages/FileUploadStatusMessage.cpp - core/model/messages/FileUrlDownloadAbortMessage.cpp - core/model/messages/FileUrlDownloadInitMessage.cpp - core/model/messages/FileUrlDownloadStatusMessage.cpp - core/model/messages/FirmwareUpdateAbortMessage.cpp - core/model/messages/FirmwareUpdateInstallMessage.cpp - core/model/messages/FirmwareUpdateStatusMessage.cpp - core/model/messages/GatewaySubdeviceMessage.cpp - core/model/messages/ParametersPullMessage.cpp - core/model/messages/ParametersUpdateMessage.cpp - core/model/messages/PlatformStatusMessage.cpp - core/model/messages/PullFeedValuesMessage.cpp - core/model/messages/RegisteredDevicesRequestMessage.cpp - core/model/messages/RegisteredDevicesResponseMessage.cpp - core/model/messages/PullFeedValuesMessage.cpp - core/model/messages/SynchronizeParametersMessage.cpp - core/persistence/filesystem/CircularFileSystemMessagePersistence.cpp - core/persistence/filesystem/FileSystemMessagePersistence.cpp - core/persistence/filesystem/MessagePersister.cpp - core/persistence/inmemory/InMemoryMessagePersistence.cpp - core/persistence/inmemory/InMemoryPersistence.cpp - core/protocol/wolkabout/WolkaboutDataProtocol.cpp - core/protocol/wolkabout/WolkaboutErrorProtocol.cpp - core/protocol/wolkabout/WolkaboutFileManagementProtocol.cpp - core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.cpp - core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.cpp - core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.cpp - core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.cpp - core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.cpp - core/protocol/wolkabout/WolkaboutProtocol.cpp - core/protocol/wolkabout/WolkaboutRegistrationProtocol.cpp - core/Types.cpp) - set(LIB_HEADER_FILES core/connectivity/ConnectivityService.h - core/connectivity/InboundMessageHandler.h - core/connectivity/InboundPlatformMessageHandler.h - core/connectivity/OutboundMessageHandler.h - core/connectivity/OutboundRetryMessageHandler.h - core/connectivity/mqtt/MqttCallback.h - core/connectivity/mqtt/MqttClient.h - core/connectivity/mqtt/MqttConnectivityService.h - core/connectivity/mqtt/PahoMqttClient.h - core/model/Attribute.h - core/model/Device.h - core/model/Feed.h - core/model/Message.h - core/model/Reading.h - core/model/messages/AttributeRegistrationMessage.h - core/model/messages/ChildrenSynchronizationRequestMessage.h - core/model/messages/ChildrenSynchronizationResponseMessage.h - core/model/messages/DetailsSynchronizationRequestMessage.h - core/model/messages/DetailsSynchronizationResponseMessage.h - core/model/messages/DeviceRegistrationMessage.h - core/model/messages/DeviceRegistrationResponseMessage.h - core/model/messages/DeviceRemovalMessage.h - core/model/messages/ErrorMessage.h - core/model/messages/FeedRegistrationMessage.h - core/model/messages/FeedRemovalMessage.h - core/model/messages/FeedValuesMessage.h - core/model/messages/FileBinaryRequestMessage.h - core/model/messages/FileBinaryResponseMessage.h - core/model/messages/FileDeleteMessage.h - core/model/messages/FileListRequestMessage.h - core/model/messages/FileListResponseMessage.h - core/model/messages/FilePurgeMessage.h - core/model/messages/FileUploadAbortMessage.h - core/model/messages/FileUploadInitiateMessage.h - core/model/messages/FileUploadStatusMessage.h - core/model/messages/FileUrlDownloadAbortMessage.h - core/model/messages/FileUrlDownloadInitMessage.h - core/model/messages/FileUrlDownloadStatusMessage.h - core/model/messages/FirmwareUpdateAbortMessage.h - core/model/messages/FirmwareUpdateInstallMessage.h - core/model/messages/FirmwareUpdateStatusMessage.h - core/model/messages/GatewaySubdeviceMessage.h - core/model/messages/MessageModel.h - core/model/messages/ParametersPullMessage.h - core/model/messages/ParametersUpdateMessage.h - core/model/messages/PlatformStatusMessage.h - core/model/messages/PullFeedValuesMessage.h - core/model/messages/RegisteredDevicesRequestMessage.h - core/model/messages/RegisteredDevicesResponseMessage.h - core/model/messages/SynchronizeParametersMessage.h - core/persistence/filesystem/CircularFileSystemMessagePersistence.h - core/persistence/filesystem/FileSystemMessagePersistence.h - core/persistence/filesystem/MessagePersister.h - core/persistence/inmemory/InMemoryMessagePersistence.h - core/persistence/inmemory/InMemoryPersistence.h - core/persistence/MessagePersistence.h - core/persistence/Persistence.h - core/protocol/wolkabout/WolkaboutDataProtocol.h - core/protocol/wolkabout/WolkaboutErrorProtocol.h - core/protocol/wolkabout/WolkaboutFileManagementProtocol.h - core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h - core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.h - core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.h - core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.h - core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h - core/protocol/wolkabout/WolkaboutProtocol.h - core/protocol/wolkabout/WolkaboutRegistrationProtocol.h - core/protocol/DataProtocol.h - core/protocol/ErrorProtocol.h - core/protocol/FileManagementProtocol.h - core/protocol/FirmwareUpdateProtocol.h - core/protocol/GatewayPlatformStatusProtocol.h - core/protocol/GatewayRegistrationProtocol.h - core/protocol/GatewaySubdeviceProtocol.h - core/protocol/PlatformStatusProtocol.h - core/protocol/Protocol.h - core/protocol/RegistrationProtocol.h - core/connectivity/InboundMessageHandler.h - core/MessageListener.h - core/Types.h) - - file(GLOB ROOT_HEADERS core/*.h) - file(COPY ${ROOT_HEADERS} DESTINATION ${CMAKE_LIBRARY_INCLUDE_DIRECTORY}/core) - file(COPY core/connectivity/ DESTINATION ${CMAKE_LIBRARY_INCLUDE_DIRECTORY}/core/connectivity PATTERN *.cpp EXCLUDE) - file(COPY core/model/ DESTINATION ${CMAKE_LIBRARY_INCLUDE_DIRECTORY}/core/model PATTERN *.cpp EXCLUDE) - file(COPY core/persistence/ DESTINATION ${CMAKE_LIBRARY_INCLUDE_DIRECTORY}/core/persistence PATTERN *.cpp EXCLUDE) - file(COPY core/protocol/ DESTINATION ${CMAKE_LIBRARY_INCLUDE_DIRECTORY}/core/protocol PATTERN *.cpp EXCLUDE) - - add_library(${PROJECT_NAME} ${LIB_TYPE} ${LIB_SOURCE_FILES} ${LIB_HEADER_FILES}) - target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}Utility paho-mqttpp3 paho-mqtt3as nlohmann_json_schema_validator) - target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}) - target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${CMAKE_PREFIX_PATH}/include) - target_include_directories(${PROJECT_NAME} PUBLIC $ $) - set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN") - set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${WOLKSDK_VERSION_STRING} SOVERSION ${WOLKSDK_VERSION_MAJOR}.${WOLKSDK_VERSION_MINOR}.${WOLKSDK_VERSION_PATCH}) - add_dependencies(${PROJECT_NAME} pahomqttcpp json-schema) - - set(TESTS_SOURCE_FILES ${TESTS_SOURCE_FILES} - tests/BufferTests.cpp - tests/ByteUtilsTests.cpp - tests/CommandBufferTests.cpp - tests/FileSystemUtils.cpp - tests/InboundPlatformMessageHandlerTests.cpp - tests/LoggerTests.cpp - tests/LogManagerTests.cpp - tests/ModelMessagesTests.cpp - tests/ModelsTests.cpp - tests/MqttConnectivityServiceTests.cpp - tests/OutboundRetryMessageHandlerTests.cpp - tests/PahoMqttClientTests.cpp - tests/StringUtilsTests.cpp - tests/TimerTests.cpp - tests/TypesTests.cpp - tests/WolkaboutDataProtocolTests.cpp - tests/WolkaboutErrorProtocolTests.cpp - tests/WolkaboutFileManagementProtocolTests.cpp - tests/WolkaboutFirmwareUpdateProtocolTests.cpp - tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp - tests/WolkaboutGatewayRegistrationProtocolTests.cpp - tests/WolkaboutGatewaySubdeviceProtocolTests.cpp - tests/WolkaboutPlatformStatusProtocolTests.cpp - tests/WolkaboutRegistrationProtocolTests.cpp) - set(TESTS_HEADER_FILES ${TESTS_HEADER_FILES} - tests/mocks/ConnectivityServiceMock.h - tests/mocks/DataProtocolMock.h - tests/mocks/ErrorProtocolMock.h - tests/mocks/FileManagementProtocolMock.h - tests/mocks/FirmwareUpdateProtocolMock.h - tests/mocks/GatewayPlatformStatusProtocolMock.h - tests/mocks/GatewayRegistrationProtocolMock.h - tests/mocks/GatewaySubdeviceProtocolMock.h - tests/mocks/InboundMessageHandlerMock.h - tests/mocks/MessageListenerMock.h - tests/mocks/MessagePersistenceMock.h - tests/mocks/OutboundMessageHandlerMock.h - tests/mocks/OutboundRetryMessageHandlerMock.h - tests/mocks/PahoMqttClientMock.h - tests/mocks/PersistenceMock.h - tests/mocks/PlatformStatusProtocolMock.h - tests/mocks/ProtocolMock.h - tests/mocks/RegistrationProtocolMock.h) - - list(APPEND INSTALL_TARGETS ${PROJECT_NAME}) -endif () - -if (${BUILD_TESTS} AND (NOT ("${TESTS_SOURCE_FILES}" STREQUAL ""))) - add_executable(${PROJECT_NAME}Tests ${TESTS_SOURCE_FILES} ${TESTS_HEADER_FILES}) - target_link_libraries(${PROJECT_NAME}Tests ${PROJECT_NAME} gtest gmock gtest_main Threads::Threads) - target_include_directories(${PROJECT_NAME}Tests PRIVATE ${PROJECT_SOURCE_DIR}) - target_include_directories(${PROJECT_NAME}Tests SYSTEM PRIVATE ${CMAKE_PREFIX_PATH}/include) - target_include_directories(${PROJECT_NAME}Tests PUBLIC $ $) - set_target_properties(${PROJECT_NAME}Tests PROPERTIES INSTALL_RPATH "$ORIGIN/../lib") - add_dependencies(${PROJECT_NAME}Tests libgtest) - - enable_testing() - add_test(NAME "WolkSDK-Cpp_Tests" COMMAND ${PROJECT_NAME}Tests) -endif () - -# Create the install rule -install(DIRECTORY ${CMAKE_LIBRARY_INCLUDE_DIRECTORY} DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN *.h) -install(DIRECTORY ${CMAKE_PREFIX_PATH}/include DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN *.h) -install(DIRECTORY ${CMAKE_PREFIX_PATH}/lib DESTINATION ${CMAKE_INSTALL_PREFIX}) -install(TARGETS ${INSTALL_TARGETS} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) - -# Add the format rule -file(GLOB_RECURSE ALL_FILES ${CMAKE_SOURCE_DIR}/**/*.cpp ${CMAKE_SOURCE_DIR}/**/*.hpp ${CMAKE_SOURCE_DIR}/**/*.h) -list(FILTER ALL_FILES EXCLUDE REGEX "/out") -list(FILTER ALL_FILES EXCLUDE REGEX "json.hpp") -add_custom_target(format - COMMAND "clang-format" -i -sort-includes -style=file ${ALL_FILES} - WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" - COMMENT "[Formatting source code]" - VERBATIM) +## Create the install rule +#install(DIRECTORY ${CMAKE_LIBRARY_INCLUDE_DIRECTORY} DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN *.h) +#install(DIRECTORY ${CMAKE_PREFIX_PATH}/include DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN *.h) +#install(DIRECTORY ${CMAKE_PREFIX_PATH}/lib DESTINATION ${CMAKE_INSTALL_PREFIX}) +#install(TARGETS ${INSTALL_TARGETS} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) +# +## Add the format rule +#file(GLOB_RECURSE ALL_FILES ${CMAKE_SOURCE_DIR}/**/*.cpp ${CMAKE_SOURCE_DIR}/**/*.hpp ${CMAKE_SOURCE_DIR}/**/*.h) +#list(FILTER ALL_FILES EXCLUDE REGEX "/out") +#list(FILTER ALL_FILES EXCLUDE REGEX "json.hpp") +#add_custom_target(format +# COMMAND "clang-format" -i -sort-includes -style=file ${ALL_FILES} +# WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" +# COMMENT "[Formatting source code]" +# VERBATIM) diff --git a/aws/CMakeLists.txt b/aws/CMakeLists.txt new file mode 100644 index 00000000..991988c5 --- /dev/null +++ b/aws/CMakeLists.txt @@ -0,0 +1,35 @@ +# Place the sub-folder this target is placed into a variable +set(SUBDIRECTORY_PATH aws) + +# Include the util dependencies +include(cmake/dependencies.cmake) + +# Create the library +add_library(${AWS_LOG_UPLOADER_TARGET_NAME}) +add_library(${NAMESPACE}::${AWS_LOG_UPLOADER_TARGET_NAME} ALIAS ${AWS_LOG_UPLOADER_TARGET_NAME}) + +# Link the libraries +target_link_libraries(${AWS_LOG_UPLOADER_TARGET_NAME} PRIVATE ${UTIL_TARGET_NAME} aws-cpp-sdk-core aws-cpp-sdk-s3) + +# Set some target properties +set_target_properties(${AWS_LOG_UPLOADER_TARGET_NAME} PROPERTIES OUTPUT_NAME "${NAMESPACE}${AWS_LOG_UPLOADER_TARGET_NAME}") +set_target_properties(${AWS_LOG_UPLOADER_TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN") +set_target_properties(${AWS_LOG_UPLOADER_TARGET_NAME} PROPERTIES VERSION ${PROJECT_VERSION}) +set_target_properties(${AWS_LOG_UPLOADER_TARGET_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) + +# Add the sources +target_sources(${AWS_LOG_UPLOADER_TARGET_NAME} PRIVATE core/log_uploader/AwsLogUploader.cpp) + +# Add the headers +target_sources(${AWS_LOG_UPLOADER_TARGET_NAME} PRIVATE core/log_uploader/AwsLogUploader.h) + +# Add the private include directories +target_include_directories(${AWS_LOG_UPLOADER_TARGET_NAME} + PRIVATE + ${PROJECT_SOURCE_DIR}/${SUBDIRECTORY_PATH}) + +# Add the public include directories +target_include_directories(${AWS_LOG_UPLOADER_TARGET_NAME} + PUBLIC + $ + $) diff --git a/aws/cmake/dependencies.cmake b/aws/cmake/dependencies.cmake new file mode 100644 index 00000000..726d0ad1 --- /dev/null +++ b/aws/cmake/dependencies.cmake @@ -0,0 +1,28 @@ +# Include the CMake modules +include(FetchContent) + +# Define the AWS version +set(AWS_SDK_VERSION "1.8.173") + +# Set the flags for AWS based on the CMake build type +if (CMAKE_BUILD_TYPE STREQUAL "Debug") + option(ENABLE_UNITY_BUILD "If enabled, the SDK will be built using a single unified .cpp file for each service library. Reduces the size of static library binaries on Windows and Linux" OFF) + option(MINIMIZE_SIZE "If enabled, the SDK will be built via a unity aggregation process that results in smaller static libraries; additionally, release binaries will favor size optimizations over speed" OFF) +else (CMAKE_BUILD_TYPE STREQUAL "Release") + option(ENABLE_UNITY_BUILD "If enabled, the SDK will be built using a single unified .cpp file for each service library. Reduces the size of static library binaries on Windows and Linux" ON) + option(MINIMIZE_SIZE "If enabled, the SDK will be built via a unity aggregation process that results in smaller static libraries; additionally, release binaries will favor size optimizations over speed" ON) +endif () + +# Set the options +option(ENABLE_TESTING "Flag to enable/disable building unit and integration tests" OFF) +set(BUILD_ONLY s3 CACHE STRING "A semi-colon delimited list of the projects to build") + +# Add AWS +FetchContent_Declare( + aws-sdk-cpp + GIT_REPOSITORY https://github.com/aws/aws-sdk-cpp + GIT_TAG ${AWS_SDK_VERSION} +) + +# Make available +FetchContent_MakeAvailable(aws-sdk-cpp) diff --git a/core/log_uploader/AwsLogUploader.cpp b/aws/core/log_uploader/AwsLogUploader.cpp similarity index 98% rename from core/log_uploader/AwsLogUploader.cpp rename to aws/core/log_uploader/AwsLogUploader.cpp index 67e59ddc..dcf1d9eb 100644 --- a/core/log_uploader/AwsLogUploader.cpp +++ b/aws/core/log_uploader/AwsLogUploader.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/log_uploader/AwsLogUploader.h b/aws/core/log_uploader/AwsLogUploader.h similarity index 97% rename from core/log_uploader/AwsLogUploader.h rename to aws/core/log_uploader/AwsLogUploader.h index 2f473b5f..85bd7ca4 100644 --- a/core/log_uploader/AwsLogUploader.h +++ b/aws/core/log_uploader/AwsLogUploader.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/cmake/cxx-settings.cmake b/cmake/cxx-settings.cmake new file mode 100644 index 00000000..da577085 --- /dev/null +++ b/cmake/cxx-settings.cmake @@ -0,0 +1,22 @@ +# Set the standard and flags +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic \ + -pedantic-errors -Wcast-align \ + -Wcast-qual -Wconversion \ + -Wdisabled-optimization \ + -Wfloat-equal -Wformat=2 \ + -Werror=init-self \ + -Werror=missing-field-initializers -Wmissing-format-attribute \ + -Wmissing-include-dirs -Wmissing-noreturn \ + -Werror=pointer-arith \ + -Wno-packed -Wno-padded -Wredundant-decls \ + -Werror=shadow -Werror=stack-protector \ + -Wstrict-aliasing=2 -Wno-switch \ + -Werror=unreachable-code -Wunused \ + -Wvariadic-macros \ + -Wwrite-strings -Werror=non-virtual-dtor -Werror=return-type") + +# Set the tests flags +if (${BUILD_TESTS}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -g") +endif () diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake new file mode 100644 index 00000000..e358fc79 --- /dev/null +++ b/cmake/dependencies.cmake @@ -0,0 +1,11 @@ + +find_package(Threads REQUIRED) + +# Define the versions +set(PAHO_MQTT_C_VERSION "1.3.8") +set(PAHO_MQTT_CPP_VERSION "1.2.0") +set(GTEST_VERSION "1.10.0") +set(POCO_VERSION "1.10.1") +set(AWS_SDK_VERSION "1.8.173") +set(NLOHMANN_JSON_VERSION "3.7.3") +set(JSON_SCHEMA_VERSION "2.1.0") diff --git a/cmake/paths.cmake b/cmake/paths.cmake new file mode 100644 index 00000000..75382eb1 --- /dev/null +++ b/cmake/paths.cmake @@ -0,0 +1,16 @@ +# Configure the paths for output +if (NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +endif () + +if (NOT DEFINED CMAKE_LIBRARY_INCLUDE_DIRECTORY) + set(CMAKE_LIBRARY_INCLUDE_DIRECTORY "${CMAKE_BINARY_DIR}/include") +endif () + +if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +endif () + +if (NOT DEFINED CMAKE_PREFIX_PATH) + set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}/build") +endif () diff --git a/cmake/poco-options.cmake b/cmake/poco-options.cmake new file mode 100644 index 00000000..2ee04a78 --- /dev/null +++ b/cmake/poco-options.cmake @@ -0,0 +1,90 @@ +# Options for Poco +if (${BUILD_POCO}) + + # The Utility bundle + OPTION(POCO_BUILD_UTIL "" ON) + if (${POCO_BUILD_UTIL}) + OPTION(POCO_ENABLE_UTIL "" ON) + endif () + + # The Network bundle + OPTION(POCO_BUILD_NET "" OFF) + if (${POCO_BUILD_NET}) + OPTION(POCO_ENABLE_NET "" ON) + OPTION(POCO_ENABLE_NETSSL "" ON) + OPTION(POCO_ENABLE_CRYPTO "" ON) + if (WIN32) + OPTION(POCO_ENABLE_NETSSL_WIN "" OFF) + else () + OPTION(POCO_ENABLE_NETSSL_WIN "" ON) + endif () + endif () + + # The Data bundle + OPTION(POCO_BUILD_DATA "" OFF) + if (${POCO_BUILD_DATA}) + OPTION(POCO_ENABLE_DATA "" ON) + OPTION(POCO_ENABLE_DATA_SQLITE "" ON) + OPTION(POCO_ENABLE_DATA_MYSQL "" OFF) + OPTION(POCO_ENABLE_DATA_ODBC "" ON) + endif () + + # The Encodings bundle + OPTION(POCO_BUILD_ENCODINGS "" OFF) + if (${POCO_BUILD_ENCODINGS}) + OPTION(POCO_ENABLE_ENCODINGS "" ON) + OPTION(POCO_ENABLE_ENCODINGS_COMPILER "" ON) + OPTION(POCO_ENABLE_XML "" ON) + OPTION(POCO_ENABLE_JSON "" ON) + endif () + + # The MongoDB bundle + OPTION(POCO_BUILD_MONGODB "" OFF) + if (${POCO_BUILD_MONGODB}) + OPTION(POCO_ENABLE_MONGODB "" ON) + endif () + + # The Redis bundle + OPTION(POCO_BUILD_REDIS "" OFF) + if (${POCO_BUILD_REDIS}) + OPTION(POCO_ENABLE_REDIS "" ON) + endif () + + # The ZIP bundle + OPTION(POCO_BUILD_ZIP "" OFF) + if (${POCO_BUILD_ZIP}) + OPTION(POCO_ENABLE_SEVENZIP "" ON) + OPTION(POCO_ENABLE_ZIP "" ON) + endif () + + # The PageCompiler bundle + OPTION(POCO_BUILD_PAGECOMPILER "" OFF) + if (${POCO_BUILD_PAGECOMPILER}) + OPTION(POCO_ENABLE_PAGECOMPILER "" ON) + OPTION(POCO_ENABLE_PAGECOMPILER_FILE2PAGE "" ON) + endif () + + # The PDF bundle + OPTION(POCO_BUILD_PDF "" OFF) + if (${POCO_BUILD_PDF}) + OPTION(POCO_ENABLE_PDF "" ON) + endif () + + # The Apache connection bundle + OPTION(POCO_BUILD_APACHECONNECTOR "" OFF) + if (${POCO_BUILD_APACHECONNECTOR}) + OPTION(POCO_ENABLE_APACHECONNECTOR "" ON) + endif () + + # The CppParser bundle + OPTION(POCO_BUILD_CPPPARSER "" OFF) + if (${POCO_BUILD_CPPPARSER}) + OPTION(POCO_ENABLE_CPPPARSER "" ON) + endif () + + # The PocoDoc bundle + OPTION(POCO_BUILD_POCODOC "" OFF) + if (${POCO_BUILD_POCODOC}) + OPTION(POCO_ENABLE_POCODOC "" ON) + endif () +endif () diff --git a/configure.sh b/configure.sh index 43083e97..2227b4fd 100755 --- a/configure.sh +++ b/configure.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2022 Wolkabout Technology s.r.o. +# Copyright 2023 Wolkabout Technology s.r.o. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt new file mode 100644 index 00000000..32ea7d6a --- /dev/null +++ b/connectivity/CMakeLists.txt @@ -0,0 +1,192 @@ +# Place the sub-folder this target is placed into a variable +set(SUBDIRECTORY_PATH connectivity) + +# Include the util dependencies +include(cmake/dependencies.cmake) + +# Create the library +add_library(${CONNECTIVITY_TARGET_NAME}) +add_library(${NAMESPACE}::${CONNECTIVITY_TARGET_NAME} ALIAS ${CONNECTIVITY_TARGET_NAME}) + +# Link the libraries +target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_PREFIX_PATH}/lib) +target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE ${UTIL_TARGET_NAME} paho-mqttpp3 paho-mqtt3as nlohmann_json_schema_validator) + +# Add the dependency +add_dependencies(${CONNECTIVITY_TARGET_NAME} pahomqttcpp) + +# Set some target properties +set_target_properties(${CONNECTIVITY_TARGET_NAME} PROPERTIES OUTPUT_NAME "${NAMESPACE}${CONNECTIVITY_TARGET_NAME}") +set_target_properties(${CONNECTIVITY_TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN") +set_target_properties(${CONNECTIVITY_TARGET_NAME} PROPERTIES VERSION ${PROJECT_VERSION}) +set_target_properties(${CONNECTIVITY_TARGET_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) + +# Add the sources +target_sources(${CONNECTIVITY_TARGET_NAME} PRIVATE core/connectivity/ConnectivityService.cpp + core/connectivity/InboundPlatformMessageHandler.cpp + core/connectivity/OutboundRetryMessageHandler.cpp + core/connectivity/mqtt/MqttCallback.cpp + core/connectivity/mqtt/MqttClient.cpp + core/connectivity/mqtt/MqttConnectivityService.cpp + core/connectivity/mqtt/PahoMqttClient.cpp + core/model/Attribute.cpp + core/model/Device.cpp + core/model/Feed.cpp + core/model/Message.cpp + core/model/Reading.cpp + core/model/messages/AttributeRegistrationMessage.cpp + core/model/messages/ChildrenSynchronizationRequestMessage.cpp + core/model/messages/ChildrenSynchronizationResponseMessage.cpp + core/model/messages/DetailsSynchronizationRequestMessage.cpp + core/model/messages/DetailsSynchronizationResponseMessage.cpp + core/model/messages/DeviceRegistrationMessage.cpp + core/model/messages/DeviceRegistrationResponseMessage.cpp + core/model/messages/DeviceRemovalMessage.cpp + core/model/messages/ErrorMessage.cpp + core/model/messages/FeedRegistrationMessage.cpp + core/model/messages/FeedRemovalMessage.cpp + core/model/messages/FeedValuesMessage.cpp + core/model/messages/FileBinaryRequestMessage.cpp + core/model/messages/FileBinaryResponseMessage.cpp + core/model/messages/FileDeleteMessage.cpp + core/model/messages/FileListRequestMessage.cpp + core/model/messages/FileListResponseMessage.cpp + core/model/messages/FilePurgeMessage.cpp + core/model/messages/FileUploadAbortMessage.cpp + core/model/messages/FileUploadInitiateMessage.cpp + core/model/messages/FileUploadStatusMessage.cpp + core/model/messages/FileUrlDownloadAbortMessage.cpp + core/model/messages/FileUrlDownloadInitMessage.cpp + core/model/messages/FileUrlDownloadStatusMessage.cpp + core/model/messages/FirmwareUpdateAbortMessage.cpp + core/model/messages/FirmwareUpdateInstallMessage.cpp + core/model/messages/FirmwareUpdateStatusMessage.cpp + core/model/messages/GatewaySubdeviceMessage.cpp + core/model/messages/ParametersPullMessage.cpp + core/model/messages/ParametersUpdateMessage.cpp + core/model/messages/PlatformStatusMessage.cpp + core/model/messages/PullFeedValuesMessage.cpp + core/model/messages/RegisteredDevicesRequestMessage.cpp + core/model/messages/RegisteredDevicesResponseMessage.cpp + core/model/messages/PullFeedValuesMessage.cpp + core/model/messages/SynchronizeParametersMessage.cpp + core/persistence/filesystem/CircularFileSystemMessagePersistence.cpp + core/persistence/filesystem/FileSystemMessagePersistence.cpp + core/persistence/filesystem/MessagePersister.cpp + core/persistence/inmemory/InMemoryMessagePersistence.cpp + core/persistence/inmemory/InMemoryPersistence.cpp + core/protocol/wolkabout/WolkaboutDataProtocol.cpp + core/protocol/wolkabout/WolkaboutErrorProtocol.cpp + core/protocol/wolkabout/WolkaboutFileManagementProtocol.cpp + core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.cpp + core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.cpp + core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.cpp + core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.cpp + core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.cpp + core/protocol/wolkabout/WolkaboutProtocol.cpp + core/protocol/wolkabout/WolkaboutRegistrationProtocol.cpp + core/Types.cpp) + +# Add the header files +target_sources(${CONNECTIVITY_TARGET_NAME} PRIVATE core/connectivity/ConnectivityService.h + core/connectivity/InboundMessageHandler.h + core/connectivity/InboundPlatformMessageHandler.h + core/connectivity/OutboundMessageHandler.h + core/connectivity/OutboundRetryMessageHandler.h + core/connectivity/mqtt/MqttCallback.h + core/connectivity/mqtt/MqttClient.h + core/connectivity/mqtt/MqttConnectivityService.h + core/connectivity/mqtt/PahoMqttClient.h + core/model/Attribute.h + core/model/Device.h + core/model/Feed.h + core/model/Message.h + core/model/Reading.h + core/model/messages/AttributeRegistrationMessage.h + core/model/messages/ChildrenSynchronizationRequestMessage.h + core/model/messages/ChildrenSynchronizationResponseMessage.h + core/model/messages/DetailsSynchronizationRequestMessage.h + core/model/messages/DetailsSynchronizationResponseMessage.h + core/model/messages/DeviceRegistrationMessage.h + core/model/messages/DeviceRegistrationResponseMessage.h + core/model/messages/DeviceRemovalMessage.h + core/model/messages/ErrorMessage.h + core/model/messages/FeedRegistrationMessage.h + core/model/messages/FeedRemovalMessage.h + core/model/messages/FeedValuesMessage.h + core/model/messages/FileBinaryRequestMessage.h + core/model/messages/FileBinaryResponseMessage.h + core/model/messages/FileDeleteMessage.h + core/model/messages/FileListRequestMessage.h + core/model/messages/FileListResponseMessage.h + core/model/messages/FilePurgeMessage.h + core/model/messages/FileUploadAbortMessage.h + core/model/messages/FileUploadInitiateMessage.h + core/model/messages/FileUploadStatusMessage.h + core/model/messages/FileUrlDownloadAbortMessage.h + core/model/messages/FileUrlDownloadInitMessage.h + core/model/messages/FileUrlDownloadStatusMessage.h + core/model/messages/FirmwareUpdateAbortMessage.h + core/model/messages/FirmwareUpdateInstallMessage.h + core/model/messages/FirmwareUpdateStatusMessage.h + core/model/messages/GatewaySubdeviceMessage.h + core/model/messages/MessageModel.h + core/model/messages/ParametersPullMessage.h + core/model/messages/ParametersUpdateMessage.h + core/model/messages/PlatformStatusMessage.h + core/model/messages/PullFeedValuesMessage.h + core/model/messages/RegisteredDevicesRequestMessage.h + core/model/messages/RegisteredDevicesResponseMessage.h + core/model/messages/SynchronizeParametersMessage.h + core/persistence/filesystem/CircularFileSystemMessagePersistence.h + core/persistence/filesystem/FileSystemMessagePersistence.h + core/persistence/filesystem/MessagePersister.h + core/persistence/inmemory/InMemoryMessagePersistence.h + core/persistence/inmemory/InMemoryPersistence.h + core/persistence/MessagePersistence.h + core/persistence/Persistence.h + core/protocol/wolkabout/WolkaboutDataProtocol.h + core/protocol/wolkabout/WolkaboutErrorProtocol.h + core/protocol/wolkabout/WolkaboutFileManagementProtocol.h + core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h + core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.h + core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.h + core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.h + core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h + core/protocol/wolkabout/WolkaboutProtocol.h + core/protocol/wolkabout/WolkaboutRegistrationProtocol.h + core/protocol/DataProtocol.h + core/protocol/ErrorProtocol.h + core/protocol/FileManagementProtocol.h + core/protocol/FirmwareUpdateProtocol.h + core/protocol/GatewayPlatformStatusProtocol.h + core/protocol/GatewayRegistrationProtocol.h + core/protocol/GatewaySubdeviceProtocol.h + core/protocol/PlatformStatusProtocol.h + core/protocol/Protocol.h + core/protocol/RegistrationProtocol.h + core/connectivity/InboundMessageHandler.h + core/MessageListener.h + core/Types.h) + +# Add the private include directories +target_include_directories(${CONNECTIVITY_TARGET_NAME} + PRIVATE + ${PROJECT_SOURCE_DIR}/${SUBDIRECTORY_PATH}) + +# Add the system private include directories +target_include_directories(${CONNECTIVITY_TARGET_NAME} + SYSTEM PRIVATE + ${CMAKE_PREFIX_PATH}/include) + +# Add the public include directories +target_include_directories(${CONNECTIVITY_TARGET_NAME} + PUBLIC + $ + $) + +# Include tests if the options is enabled +# TODO Uncomment +#if (${BUILD_TESTS}) +# add_subdirectory(tests) +#endif () diff --git a/connectivity/cmake/dependencies.cmake b/connectivity/cmake/dependencies.cmake new file mode 100644 index 00000000..ae151fa8 --- /dev/null +++ b/connectivity/cmake/dependencies.cmake @@ -0,0 +1,62 @@ +# Include the CMake modules +include(ExternalProject) +include(FetchContent) + +# Define the versions +set(PAHO_MQTT_C_VERSION "1.3.8") +set(PAHO_MQTT_CPP_VERSION "1.2.0") +set(NLOHMANN_JSON_VERSION "3.7.3") +set(JSON_SCHEMA_VERSION "2.1.0") + +# Set the PahoMQTT flags +SET(PAHO_WITH_SSL TRUE CACHE BOOL "Flag that defines whether to build ssl-enabled binaries too. ") +SET(PAHO_ENABLE_TESTING FALSE CACHE BOOL "Build tests and run") +SET(PAHO_ENABLE_CPACK FALSE CACHE BOOL "Enable CPack") + +# Include PahoMQTT for both C and C++ +ExternalProject_Add(pahomqttc + GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.c" + GIT_TAG "v${PAHO_MQTT_C_VERSION}" + UPDATE_COMMAND "" + CMAKE_ARGS + -DPAHO_WITH_SSL=TRUE + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DARP_TOOLCHAIN_ROOT=${ARP_TOOLCHAIN_ROOT} + -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} + -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} + ) + +ExternalProject_Add(pahomqttcpp + GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.cpp" + GIT_TAG "v${PAHO_MQTT_CPP_VERSION}" + UPDATE_COMMAND "" + CMAKE_ARGS -DPAHO_WITH_SSL=TRUE + -DPAHO_MQTT_C_INCLUDE_DIRS=${CMAKE_PREFIX_PATH}/include + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DARP_TOOLCHAIN_ROOT=${ARP_TOOLCHAIN_ROOT} + -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} + -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} + DEPENDS pahomqttc + ) + +# Set JSON flags +option(JSON_BuildTests "Build the unit tests when BUILD_TESTING is enabled." OFF) + +# Include nlohmann json and the schema) +FetchContent_Declare( + nlohmann_json + GIT_REPOSITORY https://github.com/nlohmann/json + GIT_TAG v${NLOHMANN_JSON_VERSION} +) + +FetchContent_Declare( + json-schema + GIT_REPOSITORY https://github.com/pboettch/json-schema-validator + GIT_TAG ${JSON_SCHEMA_VERSION} +) + +# Make everything available +FetchContent_MakeAvailable(nlohmann_json json-schema) + +# Adjust the compile options for `nlohmann_json` to disable the shadow error +target_compile_options(nlohmann_json_schema_validator PRIVATE "-Wno-shadow") diff --git a/core/MessageListener.h b/connectivity/core/MessageListener.h similarity index 95% rename from core/MessageListener.h rename to connectivity/core/MessageListener.h index 61541ca6..5eaf3e39 100644 --- a/core/MessageListener.h +++ b/connectivity/core/MessageListener.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/Types.cpp b/connectivity/core/Types.cpp similarity index 99% rename from core/Types.cpp rename to connectivity/core/Types.cpp index 1e73fe69..860a67d7 100644 --- a/core/Types.cpp +++ b/connectivity/core/Types.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/Types.h b/connectivity/core/Types.h similarity index 99% rename from core/Types.h rename to connectivity/core/Types.h index b8d0aa5c..cf3963d4 100644 --- a/core/Types.h +++ b/connectivity/core/Types.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/connectivity/ConnectivityService.cpp b/connectivity/core/connectivity/ConnectivityService.cpp similarity index 95% rename from core/connectivity/ConnectivityService.cpp rename to connectivity/core/connectivity/ConnectivityService.cpp index 51d3fc59..ec00906c 100644 --- a/core/connectivity/ConnectivityService.cpp +++ b/connectivity/core/connectivity/ConnectivityService.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/connectivity/ConnectivityService.h b/connectivity/core/connectivity/ConnectivityService.h similarity index 96% rename from core/connectivity/ConnectivityService.h rename to connectivity/core/connectivity/ConnectivityService.h index 86cc2194..dd367b20 100644 --- a/core/connectivity/ConnectivityService.h +++ b/connectivity/core/connectivity/ConnectivityService.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/connectivity/InboundMessageHandler.h b/connectivity/core/connectivity/InboundMessageHandler.h similarity index 96% rename from core/connectivity/InboundMessageHandler.h rename to connectivity/core/connectivity/InboundMessageHandler.h index 0d5f0484..e3cee251 100644 --- a/core/connectivity/InboundMessageHandler.h +++ b/connectivity/core/connectivity/InboundMessageHandler.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/connectivity/InboundPlatformMessageHandler.cpp b/connectivity/core/connectivity/InboundPlatformMessageHandler.cpp similarity index 96% rename from core/connectivity/InboundPlatformMessageHandler.cpp rename to connectivity/core/connectivity/InboundPlatformMessageHandler.cpp index 180b1d3e..74224591 100644 --- a/core/connectivity/InboundPlatformMessageHandler.cpp +++ b/connectivity/core/connectivity/InboundPlatformMessageHandler.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ #include "core/model/Message.h" #include "core/protocol/Protocol.h" -#include "core/utilities/Logger.h" -#include "core/utilities/StringUtils.h" +#include "core/utility/Logger.h" +#include "core/utility/StringUtils.h" #include diff --git a/core/connectivity/InboundPlatformMessageHandler.h b/connectivity/core/connectivity/InboundPlatformMessageHandler.h similarity index 95% rename from core/connectivity/InboundPlatformMessageHandler.h rename to connectivity/core/connectivity/InboundPlatformMessageHandler.h index 8af720ed..a37cecc8 100644 --- a/core/connectivity/InboundPlatformMessageHandler.h +++ b/connectivity/core/connectivity/InboundPlatformMessageHandler.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ #define INBOUNDPLATFORMMESSAGEHANDLER_H #include "core/connectivity/InboundMessageHandler.h" -#include "core/utilities/CommandBuffer.h" +#include "core/utility/CommandBuffer.h" #include #include diff --git a/core/connectivity/OutboundMessageHandler.h b/connectivity/core/connectivity/OutboundMessageHandler.h similarity index 95% rename from core/connectivity/OutboundMessageHandler.h rename to connectivity/core/connectivity/OutboundMessageHandler.h index 7042e448..f597a4dd 100644 --- a/core/connectivity/OutboundMessageHandler.h +++ b/connectivity/core/connectivity/OutboundMessageHandler.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/connectivity/OutboundRetryMessageHandler.cpp b/connectivity/core/connectivity/OutboundRetryMessageHandler.cpp similarity index 97% rename from core/connectivity/OutboundRetryMessageHandler.cpp rename to connectivity/core/connectivity/OutboundRetryMessageHandler.cpp index c8fbd2a3..6f806158 100644 --- a/core/connectivity/OutboundRetryMessageHandler.cpp +++ b/connectivity/core/connectivity/OutboundRetryMessageHandler.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ #include "OutboundMessageHandler.h" #include "core/model/Message.h" -#include "core/utilities/Logger.h" -#include "core/utilities/StringUtils.h" +#include "core/utility/Logger.h" +#include "core/utility/StringUtils.h" namespace { diff --git a/core/connectivity/OutboundRetryMessageHandler.h b/connectivity/core/connectivity/OutboundRetryMessageHandler.h similarity index 95% rename from core/connectivity/OutboundRetryMessageHandler.h rename to connectivity/core/connectivity/OutboundRetryMessageHandler.h index c19a34ca..f7a13c69 100644 --- a/core/connectivity/OutboundRetryMessageHandler.h +++ b/connectivity/core/connectivity/OutboundRetryMessageHandler.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #ifndef OUTBOUNDRETRYMESSAGEHANDLER_H #define OUTBOUNDRETRYMESSAGEHANDLER_H -#include "core/utilities/Timer.h" +#include "core/utility/Timer.h" #include #include diff --git a/core/connectivity/mqtt/MqttCallback.cpp b/connectivity/core/connectivity/mqtt/MqttCallback.cpp similarity index 97% rename from core/connectivity/mqtt/MqttCallback.cpp rename to connectivity/core/connectivity/mqtt/MqttCallback.cpp index dc7b3e55..b6234a1b 100644 --- a/core/connectivity/mqtt/MqttCallback.cpp +++ b/connectivity/core/connectivity/mqtt/MqttCallback.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/connectivity/mqtt/MqttCallback.h b/connectivity/core/connectivity/mqtt/MqttCallback.h similarity index 97% rename from core/connectivity/mqtt/MqttCallback.h rename to connectivity/core/connectivity/mqtt/MqttCallback.h index b527b703..11dfad79 100644 --- a/core/connectivity/mqtt/MqttCallback.h +++ b/connectivity/core/connectivity/mqtt/MqttCallback.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/connectivity/mqtt/MqttClient.cpp b/connectivity/core/connectivity/mqtt/MqttClient.cpp similarity index 97% rename from core/connectivity/mqtt/MqttClient.cpp rename to connectivity/core/connectivity/mqtt/MqttClient.cpp index 56321425..26fa2652 100644 --- a/core/connectivity/mqtt/MqttClient.cpp +++ b/connectivity/core/connectivity/mqtt/MqttClient.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/connectivity/mqtt/MqttClient.h b/connectivity/core/connectivity/mqtt/MqttClient.h similarity index 97% rename from core/connectivity/mqtt/MqttClient.h rename to connectivity/core/connectivity/mqtt/MqttClient.h index 4d6d0d36..f3ed63cf 100644 --- a/core/connectivity/mqtt/MqttClient.h +++ b/connectivity/core/connectivity/mqtt/MqttClient.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/connectivity/mqtt/MqttConnectivityService.cpp b/connectivity/core/connectivity/mqtt/MqttConnectivityService.cpp similarity index 99% rename from core/connectivity/mqtt/MqttConnectivityService.cpp rename to connectivity/core/connectivity/mqtt/MqttConnectivityService.cpp index bf8374e4..42723b8d 100644 --- a/core/connectivity/mqtt/MqttConnectivityService.cpp +++ b/connectivity/core/connectivity/mqtt/MqttConnectivityService.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/connectivity/mqtt/MqttConnectivityService.h b/connectivity/core/connectivity/mqtt/MqttConnectivityService.h similarity index 97% rename from core/connectivity/mqtt/MqttConnectivityService.h rename to connectivity/core/connectivity/mqtt/MqttConnectivityService.h index 4f5ae4e8..f10ee845 100644 --- a/core/connectivity/mqtt/MqttConnectivityService.h +++ b/connectivity/core/connectivity/mqtt/MqttConnectivityService.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ #include "core/connectivity/ConnectivityService.h" #include "core/connectivity/OutboundMessageHandler.h" #include "core/connectivity/mqtt/MqttClient.h" -#include "core/utilities/Buffer.h" +#include "core/utility/Buffer.h" #include #include diff --git a/core/connectivity/mqtt/PahoMqttClient.cpp b/connectivity/core/connectivity/mqtt/PahoMqttClient.cpp similarity index 98% rename from core/connectivity/mqtt/PahoMqttClient.cpp rename to connectivity/core/connectivity/mqtt/PahoMqttClient.cpp index 252684fd..27ad0f50 100644 --- a/core/connectivity/mqtt/PahoMqttClient.cpp +++ b/connectivity/core/connectivity/mqtt/PahoMqttClient.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #include "core/connectivity/mqtt/PahoMqttClient.h" #include "core/connectivity/mqtt/MqttCallback.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include #include diff --git a/core/connectivity/mqtt/PahoMqttClient.h b/connectivity/core/connectivity/mqtt/PahoMqttClient.h similarity index 97% rename from core/connectivity/mqtt/PahoMqttClient.h rename to connectivity/core/connectivity/mqtt/PahoMqttClient.h index ccf49197..4cb6c935 100644 --- a/core/connectivity/mqtt/PahoMqttClient.h +++ b/connectivity/core/connectivity/mqtt/PahoMqttClient.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/Attribute.cpp b/connectivity/core/model/Attribute.cpp similarity index 96% rename from core/model/Attribute.cpp rename to connectivity/core/model/Attribute.cpp index 92bbf24b..3e8a1c81 100644 --- a/core/model/Attribute.cpp +++ b/connectivity/core/model/Attribute.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/Attribute.h b/connectivity/core/model/Attribute.h similarity index 97% rename from core/model/Attribute.h rename to connectivity/core/model/Attribute.h index 988ac3a6..070f1cf2 100644 --- a/core/model/Attribute.h +++ b/connectivity/core/model/Attribute.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/Device.cpp b/connectivity/core/model/Device.cpp similarity index 97% rename from core/model/Device.cpp rename to connectivity/core/model/Device.cpp index d96f7b69..be33a8f9 100644 --- a/core/model/Device.cpp +++ b/connectivity/core/model/Device.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/Device.h b/connectivity/core/model/Device.h similarity index 98% rename from core/model/Device.h rename to connectivity/core/model/Device.h index 4ca5cbcd..dc354e18 100644 --- a/core/model/Device.h +++ b/connectivity/core/model/Device.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/Feed.cpp b/connectivity/core/model/Feed.cpp similarity index 96% rename from core/model/Feed.cpp rename to connectivity/core/model/Feed.cpp index d2d3d132..68406719 100644 --- a/core/model/Feed.cpp +++ b/connectivity/core/model/Feed.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/Feed.h b/connectivity/core/model/Feed.h similarity index 98% rename from core/model/Feed.h rename to connectivity/core/model/Feed.h index d1343a6c..41b7bc07 100644 --- a/core/model/Feed.h +++ b/connectivity/core/model/Feed.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/Message.cpp b/connectivity/core/model/Message.cpp similarity index 95% rename from core/model/Message.cpp rename to connectivity/core/model/Message.cpp index 8175aed8..d1158da9 100644 --- a/core/model/Message.cpp +++ b/connectivity/core/model/Message.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/Message.h b/connectivity/core/model/Message.h similarity index 97% rename from core/model/Message.h rename to connectivity/core/model/Message.h index deac0808..8bcaa8ab 100644 --- a/core/model/Message.h +++ b/connectivity/core/model/Message.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/Reading.cpp b/connectivity/core/model/Reading.cpp similarity index 99% rename from core/model/Reading.cpp rename to connectivity/core/model/Reading.cpp index 1cf8293f..47216c48 100644 --- a/core/model/Reading.cpp +++ b/connectivity/core/model/Reading.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/Reading.h b/connectivity/core/model/Reading.h similarity index 99% rename from core/model/Reading.h rename to connectivity/core/model/Reading.h index 92bce62b..47ba2b78 100644 --- a/core/model/Reading.h +++ b/connectivity/core/model/Reading.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/AttributeRegistrationMessage.cpp b/connectivity/core/model/messages/AttributeRegistrationMessage.cpp similarity index 95% rename from core/model/messages/AttributeRegistrationMessage.cpp rename to connectivity/core/model/messages/AttributeRegistrationMessage.cpp index 2de02d57..4cecf81d 100644 --- a/core/model/messages/AttributeRegistrationMessage.cpp +++ b/connectivity/core/model/messages/AttributeRegistrationMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/AttributeRegistrationMessage.h b/connectivity/core/model/messages/AttributeRegistrationMessage.h similarity index 96% rename from core/model/messages/AttributeRegistrationMessage.h rename to connectivity/core/model/messages/AttributeRegistrationMessage.h index ee175798..463ee9a6 100644 --- a/core/model/messages/AttributeRegistrationMessage.h +++ b/connectivity/core/model/messages/AttributeRegistrationMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/ChildrenSynchronizationRequestMessage.cpp b/connectivity/core/model/messages/ChildrenSynchronizationRequestMessage.cpp similarity index 94% rename from core/model/messages/ChildrenSynchronizationRequestMessage.cpp rename to connectivity/core/model/messages/ChildrenSynchronizationRequestMessage.cpp index 0cd6a9ba..153db3d8 100644 --- a/core/model/messages/ChildrenSynchronizationRequestMessage.cpp +++ b/connectivity/core/model/messages/ChildrenSynchronizationRequestMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/ChildrenSynchronizationRequestMessage.h b/connectivity/core/model/messages/ChildrenSynchronizationRequestMessage.h similarity index 95% rename from core/model/messages/ChildrenSynchronizationRequestMessage.h rename to connectivity/core/model/messages/ChildrenSynchronizationRequestMessage.h index caf36a2b..94e1f61b 100644 --- a/core/model/messages/ChildrenSynchronizationRequestMessage.h +++ b/connectivity/core/model/messages/ChildrenSynchronizationRequestMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/ChildrenSynchronizationResponseMessage.cpp b/connectivity/core/model/messages/ChildrenSynchronizationResponseMessage.cpp similarity index 96% rename from core/model/messages/ChildrenSynchronizationResponseMessage.cpp rename to connectivity/core/model/messages/ChildrenSynchronizationResponseMessage.cpp index 6ef8269d..0afcfbd2 100644 --- a/core/model/messages/ChildrenSynchronizationResponseMessage.cpp +++ b/connectivity/core/model/messages/ChildrenSynchronizationResponseMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/ChildrenSynchronizationResponseMessage.h b/connectivity/core/model/messages/ChildrenSynchronizationResponseMessage.h similarity index 96% rename from core/model/messages/ChildrenSynchronizationResponseMessage.h rename to connectivity/core/model/messages/ChildrenSynchronizationResponseMessage.h index 9fc82ccc..3d8098df 100644 --- a/core/model/messages/ChildrenSynchronizationResponseMessage.h +++ b/connectivity/core/model/messages/ChildrenSynchronizationResponseMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/DetailsSynchronizationRequestMessage.cpp b/connectivity/core/model/messages/DetailsSynchronizationRequestMessage.cpp similarity index 94% rename from core/model/messages/DetailsSynchronizationRequestMessage.cpp rename to connectivity/core/model/messages/DetailsSynchronizationRequestMessage.cpp index 239f046a..3ca2fd2a 100644 --- a/core/model/messages/DetailsSynchronizationRequestMessage.cpp +++ b/connectivity/core/model/messages/DetailsSynchronizationRequestMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/DetailsSynchronizationRequestMessage.h b/connectivity/core/model/messages/DetailsSynchronizationRequestMessage.h similarity index 95% rename from core/model/messages/DetailsSynchronizationRequestMessage.h rename to connectivity/core/model/messages/DetailsSynchronizationRequestMessage.h index ea399f6b..2b351ae5 100644 --- a/core/model/messages/DetailsSynchronizationRequestMessage.h +++ b/connectivity/core/model/messages/DetailsSynchronizationRequestMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/DetailsSynchronizationResponseMessage.cpp b/connectivity/core/model/messages/DetailsSynchronizationResponseMessage.cpp similarity index 96% rename from core/model/messages/DetailsSynchronizationResponseMessage.cpp rename to connectivity/core/model/messages/DetailsSynchronizationResponseMessage.cpp index a50e3072..d7fa3963 100644 --- a/core/model/messages/DetailsSynchronizationResponseMessage.cpp +++ b/connectivity/core/model/messages/DetailsSynchronizationResponseMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/DetailsSynchronizationResponseMessage.h b/connectivity/core/model/messages/DetailsSynchronizationResponseMessage.h similarity index 96% rename from core/model/messages/DetailsSynchronizationResponseMessage.h rename to connectivity/core/model/messages/DetailsSynchronizationResponseMessage.h index ba187798..029dd202 100644 --- a/core/model/messages/DetailsSynchronizationResponseMessage.h +++ b/connectivity/core/model/messages/DetailsSynchronizationResponseMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/DeviceRegistrationMessage.cpp b/connectivity/core/model/messages/DeviceRegistrationMessage.cpp similarity index 95% rename from core/model/messages/DeviceRegistrationMessage.cpp rename to connectivity/core/model/messages/DeviceRegistrationMessage.cpp index d309bd5d..1da7a668 100644 --- a/core/model/messages/DeviceRegistrationMessage.cpp +++ b/connectivity/core/model/messages/DeviceRegistrationMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/DeviceRegistrationMessage.h b/connectivity/core/model/messages/DeviceRegistrationMessage.h similarity index 97% rename from core/model/messages/DeviceRegistrationMessage.h rename to connectivity/core/model/messages/DeviceRegistrationMessage.h index 56c15dff..2d1f424b 100644 --- a/core/model/messages/DeviceRegistrationMessage.h +++ b/connectivity/core/model/messages/DeviceRegistrationMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/DeviceRegistrationResponseMessage.cpp b/connectivity/core/model/messages/DeviceRegistrationResponseMessage.cpp similarity index 96% rename from core/model/messages/DeviceRegistrationResponseMessage.cpp rename to connectivity/core/model/messages/DeviceRegistrationResponseMessage.cpp index 897d2674..a763710c 100644 --- a/core/model/messages/DeviceRegistrationResponseMessage.cpp +++ b/connectivity/core/model/messages/DeviceRegistrationResponseMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/DeviceRegistrationResponseMessage.h b/connectivity/core/model/messages/DeviceRegistrationResponseMessage.h similarity index 96% rename from core/model/messages/DeviceRegistrationResponseMessage.h rename to connectivity/core/model/messages/DeviceRegistrationResponseMessage.h index 755bf8d8..4c33e379 100644 --- a/core/model/messages/DeviceRegistrationResponseMessage.h +++ b/connectivity/core/model/messages/DeviceRegistrationResponseMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/DeviceRemovalMessage.cpp b/connectivity/core/model/messages/DeviceRemovalMessage.cpp similarity index 95% rename from core/model/messages/DeviceRemovalMessage.cpp rename to connectivity/core/model/messages/DeviceRemovalMessage.cpp index 6215bbb9..4e697f09 100644 --- a/core/model/messages/DeviceRemovalMessage.cpp +++ b/connectivity/core/model/messages/DeviceRemovalMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/DeviceRemovalMessage.h b/connectivity/core/model/messages/DeviceRemovalMessage.h similarity index 95% rename from core/model/messages/DeviceRemovalMessage.h rename to connectivity/core/model/messages/DeviceRemovalMessage.h index 0d26a69d..33375c23 100644 --- a/core/model/messages/DeviceRemovalMessage.h +++ b/connectivity/core/model/messages/DeviceRemovalMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/ErrorMessage.cpp b/connectivity/core/model/messages/ErrorMessage.cpp similarity index 96% rename from core/model/messages/ErrorMessage.cpp rename to connectivity/core/model/messages/ErrorMessage.cpp index 36ea4542..267df794 100644 --- a/core/model/messages/ErrorMessage.cpp +++ b/connectivity/core/model/messages/ErrorMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/ErrorMessage.h b/connectivity/core/model/messages/ErrorMessage.h similarity index 96% rename from core/model/messages/ErrorMessage.h rename to connectivity/core/model/messages/ErrorMessage.h index 726fc916..88303c87 100644 --- a/core/model/messages/ErrorMessage.h +++ b/connectivity/core/model/messages/ErrorMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FeedRegistrationMessage.cpp b/connectivity/core/model/messages/FeedRegistrationMessage.cpp similarity index 95% rename from core/model/messages/FeedRegistrationMessage.cpp rename to connectivity/core/model/messages/FeedRegistrationMessage.cpp index 85a18bdd..e29f3b71 100644 --- a/core/model/messages/FeedRegistrationMessage.cpp +++ b/connectivity/core/model/messages/FeedRegistrationMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FeedRegistrationMessage.h b/connectivity/core/model/messages/FeedRegistrationMessage.h similarity index 96% rename from core/model/messages/FeedRegistrationMessage.h rename to connectivity/core/model/messages/FeedRegistrationMessage.h index c8c16248..4ac5dd81 100644 --- a/core/model/messages/FeedRegistrationMessage.h +++ b/connectivity/core/model/messages/FeedRegistrationMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FeedRemovalMessage.cpp b/connectivity/core/model/messages/FeedRemovalMessage.cpp similarity index 95% rename from core/model/messages/FeedRemovalMessage.cpp rename to connectivity/core/model/messages/FeedRemovalMessage.cpp index 2215f716..0fcc9656 100644 --- a/core/model/messages/FeedRemovalMessage.cpp +++ b/connectivity/core/model/messages/FeedRemovalMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FeedRemovalMessage.h b/connectivity/core/model/messages/FeedRemovalMessage.h similarity index 96% rename from core/model/messages/FeedRemovalMessage.h rename to connectivity/core/model/messages/FeedRemovalMessage.h index 9a8f843d..6aa10983 100644 --- a/core/model/messages/FeedRemovalMessage.h +++ b/connectivity/core/model/messages/FeedRemovalMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FeedValuesMessage.cpp b/connectivity/core/model/messages/FeedValuesMessage.cpp similarity index 95% rename from core/model/messages/FeedValuesMessage.cpp rename to connectivity/core/model/messages/FeedValuesMessage.cpp index cae234f5..61c2c6cf 100644 --- a/core/model/messages/FeedValuesMessage.cpp +++ b/connectivity/core/model/messages/FeedValuesMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FeedValuesMessage.h b/connectivity/core/model/messages/FeedValuesMessage.h similarity index 96% rename from core/model/messages/FeedValuesMessage.h rename to connectivity/core/model/messages/FeedValuesMessage.h index d5f3f077..c673608c 100644 --- a/core/model/messages/FeedValuesMessage.h +++ b/connectivity/core/model/messages/FeedValuesMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileBinaryRequestMessage.cpp b/connectivity/core/model/messages/FileBinaryRequestMessage.cpp similarity index 96% rename from core/model/messages/FileBinaryRequestMessage.cpp rename to connectivity/core/model/messages/FileBinaryRequestMessage.cpp index acebd305..e5bfb34d 100644 --- a/core/model/messages/FileBinaryRequestMessage.cpp +++ b/connectivity/core/model/messages/FileBinaryRequestMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileBinaryRequestMessage.h b/connectivity/core/model/messages/FileBinaryRequestMessage.h similarity index 96% rename from core/model/messages/FileBinaryRequestMessage.h rename to connectivity/core/model/messages/FileBinaryRequestMessage.h index a9ffd63c..31bc2701 100644 --- a/core/model/messages/FileBinaryRequestMessage.h +++ b/connectivity/core/model/messages/FileBinaryRequestMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileBinaryResponseMessage.cpp b/connectivity/core/model/messages/FileBinaryResponseMessage.cpp similarity index 94% rename from core/model/messages/FileBinaryResponseMessage.cpp rename to connectivity/core/model/messages/FileBinaryResponseMessage.cpp index 334acce4..5581adfc 100644 --- a/core/model/messages/FileBinaryResponseMessage.cpp +++ b/connectivity/core/model/messages/FileBinaryResponseMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ #include "core/model/messages/FileBinaryResponseMessage.h" -#include "core/utilities/ByteUtils.h" +#include "core/utility/ByteUtils.h" namespace wolkabout { diff --git a/core/model/messages/FileBinaryResponseMessage.h b/connectivity/core/model/messages/FileBinaryResponseMessage.h similarity index 96% rename from core/model/messages/FileBinaryResponseMessage.h rename to connectivity/core/model/messages/FileBinaryResponseMessage.h index 22fca43a..4fe61e16 100644 --- a/core/model/messages/FileBinaryResponseMessage.h +++ b/connectivity/core/model/messages/FileBinaryResponseMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileDeleteMessage.cpp b/connectivity/core/model/messages/FileDeleteMessage.cpp similarity index 95% rename from core/model/messages/FileDeleteMessage.cpp rename to connectivity/core/model/messages/FileDeleteMessage.cpp index 1282c742..ef12a2ed 100644 --- a/core/model/messages/FileDeleteMessage.cpp +++ b/connectivity/core/model/messages/FileDeleteMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileDeleteMessage.h b/connectivity/core/model/messages/FileDeleteMessage.h similarity index 95% rename from core/model/messages/FileDeleteMessage.h rename to connectivity/core/model/messages/FileDeleteMessage.h index 856464bf..f8478da0 100644 --- a/core/model/messages/FileDeleteMessage.h +++ b/connectivity/core/model/messages/FileDeleteMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileListRequestMessage.cpp b/connectivity/core/model/messages/FileListRequestMessage.cpp similarity index 94% rename from core/model/messages/FileListRequestMessage.cpp rename to connectivity/core/model/messages/FileListRequestMessage.cpp index 1fe0c8b3..67cd172e 100644 --- a/core/model/messages/FileListRequestMessage.cpp +++ b/connectivity/core/model/messages/FileListRequestMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileListRequestMessage.h b/connectivity/core/model/messages/FileListRequestMessage.h similarity index 95% rename from core/model/messages/FileListRequestMessage.h rename to connectivity/core/model/messages/FileListRequestMessage.h index 5ebc28e1..bceb1654 100644 --- a/core/model/messages/FileListRequestMessage.h +++ b/connectivity/core/model/messages/FileListRequestMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileListResponseMessage.cpp b/connectivity/core/model/messages/FileListResponseMessage.cpp similarity index 95% rename from core/model/messages/FileListResponseMessage.cpp rename to connectivity/core/model/messages/FileListResponseMessage.cpp index 708d689d..0ab906c6 100644 --- a/core/model/messages/FileListResponseMessage.cpp +++ b/connectivity/core/model/messages/FileListResponseMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileListResponseMessage.h b/connectivity/core/model/messages/FileListResponseMessage.h similarity index 96% rename from core/model/messages/FileListResponseMessage.h rename to connectivity/core/model/messages/FileListResponseMessage.h index 62658b99..4125a4fb 100644 --- a/core/model/messages/FileListResponseMessage.h +++ b/connectivity/core/model/messages/FileListResponseMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FilePurgeMessage.cpp b/connectivity/core/model/messages/FilePurgeMessage.cpp similarity index 94% rename from core/model/messages/FilePurgeMessage.cpp rename to connectivity/core/model/messages/FilePurgeMessage.cpp index 7872c41d..314719eb 100644 --- a/core/model/messages/FilePurgeMessage.cpp +++ b/connectivity/core/model/messages/FilePurgeMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FilePurgeMessage.h b/connectivity/core/model/messages/FilePurgeMessage.h similarity index 95% rename from core/model/messages/FilePurgeMessage.h rename to connectivity/core/model/messages/FilePurgeMessage.h index 63e04272..b0588942 100644 --- a/core/model/messages/FilePurgeMessage.h +++ b/connectivity/core/model/messages/FilePurgeMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUploadAbortMessage.cpp b/connectivity/core/model/messages/FileUploadAbortMessage.cpp similarity index 95% rename from core/model/messages/FileUploadAbortMessage.cpp rename to connectivity/core/model/messages/FileUploadAbortMessage.cpp index 7622deb1..50b3ff62 100644 --- a/core/model/messages/FileUploadAbortMessage.cpp +++ b/connectivity/core/model/messages/FileUploadAbortMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUploadAbortMessage.h b/connectivity/core/model/messages/FileUploadAbortMessage.h similarity index 95% rename from core/model/messages/FileUploadAbortMessage.h rename to connectivity/core/model/messages/FileUploadAbortMessage.h index 82334ffd..57389427 100644 --- a/core/model/messages/FileUploadAbortMessage.h +++ b/connectivity/core/model/messages/FileUploadAbortMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUploadInitiateMessage.cpp b/connectivity/core/model/messages/FileUploadInitiateMessage.cpp similarity index 96% rename from core/model/messages/FileUploadInitiateMessage.cpp rename to connectivity/core/model/messages/FileUploadInitiateMessage.cpp index 85d3961d..65790d26 100644 --- a/core/model/messages/FileUploadInitiateMessage.cpp +++ b/connectivity/core/model/messages/FileUploadInitiateMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUploadInitiateMessage.h b/connectivity/core/model/messages/FileUploadInitiateMessage.h similarity index 96% rename from core/model/messages/FileUploadInitiateMessage.h rename to connectivity/core/model/messages/FileUploadInitiateMessage.h index 2578727e..abc61d04 100644 --- a/core/model/messages/FileUploadInitiateMessage.h +++ b/connectivity/core/model/messages/FileUploadInitiateMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUploadStatusMessage.cpp b/connectivity/core/model/messages/FileUploadStatusMessage.cpp similarity index 96% rename from core/model/messages/FileUploadStatusMessage.cpp rename to connectivity/core/model/messages/FileUploadStatusMessage.cpp index d05a270c..9d3049e1 100644 --- a/core/model/messages/FileUploadStatusMessage.cpp +++ b/connectivity/core/model/messages/FileUploadStatusMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUploadStatusMessage.h b/connectivity/core/model/messages/FileUploadStatusMessage.h similarity index 96% rename from core/model/messages/FileUploadStatusMessage.h rename to connectivity/core/model/messages/FileUploadStatusMessage.h index 22b5320b..77ba5594 100644 --- a/core/model/messages/FileUploadStatusMessage.h +++ b/connectivity/core/model/messages/FileUploadStatusMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUrlDownloadAbortMessage.cpp b/connectivity/core/model/messages/FileUrlDownloadAbortMessage.cpp similarity index 95% rename from core/model/messages/FileUrlDownloadAbortMessage.cpp rename to connectivity/core/model/messages/FileUrlDownloadAbortMessage.cpp index 45edb7ce..d5c49f62 100644 --- a/core/model/messages/FileUrlDownloadAbortMessage.cpp +++ b/connectivity/core/model/messages/FileUrlDownloadAbortMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUrlDownloadAbortMessage.h b/connectivity/core/model/messages/FileUrlDownloadAbortMessage.h similarity index 95% rename from core/model/messages/FileUrlDownloadAbortMessage.h rename to connectivity/core/model/messages/FileUrlDownloadAbortMessage.h index 7e405e48..7e99ed1d 100644 --- a/core/model/messages/FileUrlDownloadAbortMessage.h +++ b/connectivity/core/model/messages/FileUrlDownloadAbortMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUrlDownloadInitMessage.cpp b/connectivity/core/model/messages/FileUrlDownloadInitMessage.cpp similarity index 95% rename from core/model/messages/FileUrlDownloadInitMessage.cpp rename to connectivity/core/model/messages/FileUrlDownloadInitMessage.cpp index d8604160..1f7a5a45 100644 --- a/core/model/messages/FileUrlDownloadInitMessage.cpp +++ b/connectivity/core/model/messages/FileUrlDownloadInitMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUrlDownloadInitMessage.h b/connectivity/core/model/messages/FileUrlDownloadInitMessage.h similarity index 95% rename from core/model/messages/FileUrlDownloadInitMessage.h rename to connectivity/core/model/messages/FileUrlDownloadInitMessage.h index d4570586..7c4342b3 100644 --- a/core/model/messages/FileUrlDownloadInitMessage.h +++ b/connectivity/core/model/messages/FileUrlDownloadInitMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUrlDownloadStatusMessage.cpp b/connectivity/core/model/messages/FileUrlDownloadStatusMessage.cpp similarity index 97% rename from core/model/messages/FileUrlDownloadStatusMessage.cpp rename to connectivity/core/model/messages/FileUrlDownloadStatusMessage.cpp index 5bdd5cb7..5c18a60a 100644 --- a/core/model/messages/FileUrlDownloadStatusMessage.cpp +++ b/connectivity/core/model/messages/FileUrlDownloadStatusMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FileUrlDownloadStatusMessage.h b/connectivity/core/model/messages/FileUrlDownloadStatusMessage.h similarity index 97% rename from core/model/messages/FileUrlDownloadStatusMessage.h rename to connectivity/core/model/messages/FileUrlDownloadStatusMessage.h index 0a7849fc..d843d38e 100644 --- a/core/model/messages/FileUrlDownloadStatusMessage.h +++ b/connectivity/core/model/messages/FileUrlDownloadStatusMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FirmwareUpdateAbortMessage.cpp b/connectivity/core/model/messages/FirmwareUpdateAbortMessage.cpp similarity index 94% rename from core/model/messages/FirmwareUpdateAbortMessage.cpp rename to connectivity/core/model/messages/FirmwareUpdateAbortMessage.cpp index 0004dcda..1414f3d7 100644 --- a/core/model/messages/FirmwareUpdateAbortMessage.cpp +++ b/connectivity/core/model/messages/FirmwareUpdateAbortMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FirmwareUpdateAbortMessage.h b/connectivity/core/model/messages/FirmwareUpdateAbortMessage.h similarity index 95% rename from core/model/messages/FirmwareUpdateAbortMessage.h rename to connectivity/core/model/messages/FirmwareUpdateAbortMessage.h index f3a197da..20cb36a5 100644 --- a/core/model/messages/FirmwareUpdateAbortMessage.h +++ b/connectivity/core/model/messages/FirmwareUpdateAbortMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FirmwareUpdateInstallMessage.cpp b/connectivity/core/model/messages/FirmwareUpdateInstallMessage.cpp similarity index 95% rename from core/model/messages/FirmwareUpdateInstallMessage.cpp rename to connectivity/core/model/messages/FirmwareUpdateInstallMessage.cpp index ac29dae0..c88d7261 100644 --- a/core/model/messages/FirmwareUpdateInstallMessage.cpp +++ b/connectivity/core/model/messages/FirmwareUpdateInstallMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FirmwareUpdateInstallMessage.h b/connectivity/core/model/messages/FirmwareUpdateInstallMessage.h similarity index 95% rename from core/model/messages/FirmwareUpdateInstallMessage.h rename to connectivity/core/model/messages/FirmwareUpdateInstallMessage.h index d244aeed..d1261a3f 100644 --- a/core/model/messages/FirmwareUpdateInstallMessage.h +++ b/connectivity/core/model/messages/FirmwareUpdateInstallMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FirmwareUpdateStatusMessage.cpp b/connectivity/core/model/messages/FirmwareUpdateStatusMessage.cpp similarity index 96% rename from core/model/messages/FirmwareUpdateStatusMessage.cpp rename to connectivity/core/model/messages/FirmwareUpdateStatusMessage.cpp index bcc247ab..f46a6ab9 100644 --- a/core/model/messages/FirmwareUpdateStatusMessage.cpp +++ b/connectivity/core/model/messages/FirmwareUpdateStatusMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/FirmwareUpdateStatusMessage.h b/connectivity/core/model/messages/FirmwareUpdateStatusMessage.h similarity index 96% rename from core/model/messages/FirmwareUpdateStatusMessage.h rename to connectivity/core/model/messages/FirmwareUpdateStatusMessage.h index 11b69631..e7f1ef17 100644 --- a/core/model/messages/FirmwareUpdateStatusMessage.h +++ b/connectivity/core/model/messages/FirmwareUpdateStatusMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/GatewaySubdeviceMessage.cpp b/connectivity/core/model/messages/GatewaySubdeviceMessage.cpp similarity index 94% rename from core/model/messages/GatewaySubdeviceMessage.cpp rename to connectivity/core/model/messages/GatewaySubdeviceMessage.cpp index ccd96149..cfc19f3c 100644 --- a/core/model/messages/GatewaySubdeviceMessage.cpp +++ b/connectivity/core/model/messages/GatewaySubdeviceMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/GatewaySubdeviceMessage.h b/connectivity/core/model/messages/GatewaySubdeviceMessage.h similarity index 100% rename from core/model/messages/GatewaySubdeviceMessage.h rename to connectivity/core/model/messages/GatewaySubdeviceMessage.h diff --git a/core/model/messages/MessageModel.h b/connectivity/core/model/messages/MessageModel.h similarity index 96% rename from core/model/messages/MessageModel.h rename to connectivity/core/model/messages/MessageModel.h index 66330250..b8ced34e 100644 --- a/core/model/messages/MessageModel.h +++ b/connectivity/core/model/messages/MessageModel.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/ParametersPullMessage.cpp b/connectivity/core/model/messages/ParametersPullMessage.cpp similarity index 94% rename from core/model/messages/ParametersPullMessage.cpp rename to connectivity/core/model/messages/ParametersPullMessage.cpp index ecf56c83..9d1a04ab 100644 --- a/core/model/messages/ParametersPullMessage.cpp +++ b/connectivity/core/model/messages/ParametersPullMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/ParametersPullMessage.h b/connectivity/core/model/messages/ParametersPullMessage.h similarity index 95% rename from core/model/messages/ParametersPullMessage.h rename to connectivity/core/model/messages/ParametersPullMessage.h index d7a5eaa6..7d82935c 100644 --- a/core/model/messages/ParametersPullMessage.h +++ b/connectivity/core/model/messages/ParametersPullMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/ParametersUpdateMessage.cpp b/connectivity/core/model/messages/ParametersUpdateMessage.cpp similarity index 95% rename from core/model/messages/ParametersUpdateMessage.cpp rename to connectivity/core/model/messages/ParametersUpdateMessage.cpp index 63110d8b..b43f1a9a 100644 --- a/core/model/messages/ParametersUpdateMessage.cpp +++ b/connectivity/core/model/messages/ParametersUpdateMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/ParametersUpdateMessage.h b/connectivity/core/model/messages/ParametersUpdateMessage.h similarity index 96% rename from core/model/messages/ParametersUpdateMessage.h rename to connectivity/core/model/messages/ParametersUpdateMessage.h index 9b63cc7f..de7059e4 100644 --- a/core/model/messages/ParametersUpdateMessage.h +++ b/connectivity/core/model/messages/ParametersUpdateMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/PlatformStatusMessage.cpp b/connectivity/core/model/messages/PlatformStatusMessage.cpp similarity index 95% rename from core/model/messages/PlatformStatusMessage.cpp rename to connectivity/core/model/messages/PlatformStatusMessage.cpp index 00344649..487fd412 100644 --- a/core/model/messages/PlatformStatusMessage.cpp +++ b/connectivity/core/model/messages/PlatformStatusMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ #include "core/model/messages/PlatformStatusMessage.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/core/model/messages/PlatformStatusMessage.h b/connectivity/core/model/messages/PlatformStatusMessage.h similarity index 90% rename from core/model/messages/PlatformStatusMessage.h rename to connectivity/core/model/messages/PlatformStatusMessage.h index f899110a..c2fb0a92 100644 --- a/core/model/messages/PlatformStatusMessage.h +++ b/connectivity/core/model/messages/PlatformStatusMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ enum class ConnectivityStatus }; /** - * This is a utility method that is used to convert a ConnectivityStatus value into a string value. + * This is a util method that is used to convert a ConnectivityStatus value into a string value. * * @param value The ConnectivityStatus value. * @return The value converted into a string. Will not parse value `NONE` into a string. @@ -38,7 +38,7 @@ enum class ConnectivityStatus std::string toString(ConnectivityStatus value); /** - * This is a utility method that is used to convert a string into a ConnectivityStatus value. + * This is a util method that is used to convert a string into a ConnectivityStatus value. * * @param value The value as a string. * @return ConnectivityStatus value parsed from the string. `NONE` if failed to parse. diff --git a/core/model/messages/PullFeedValuesMessage.cpp b/connectivity/core/model/messages/PullFeedValuesMessage.cpp similarity index 94% rename from core/model/messages/PullFeedValuesMessage.cpp rename to connectivity/core/model/messages/PullFeedValuesMessage.cpp index 6d3e62c9..90e1bfc3 100644 --- a/core/model/messages/PullFeedValuesMessage.cpp +++ b/connectivity/core/model/messages/PullFeedValuesMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/PullFeedValuesMessage.h b/connectivity/core/model/messages/PullFeedValuesMessage.h similarity index 95% rename from core/model/messages/PullFeedValuesMessage.h rename to connectivity/core/model/messages/PullFeedValuesMessage.h index 05869ef5..da1d6e52 100644 --- a/core/model/messages/PullFeedValuesMessage.h +++ b/connectivity/core/model/messages/PullFeedValuesMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/RegisteredDevicesRequestMessage.cpp b/connectivity/core/model/messages/RegisteredDevicesRequestMessage.cpp similarity index 96% rename from core/model/messages/RegisteredDevicesRequestMessage.cpp rename to connectivity/core/model/messages/RegisteredDevicesRequestMessage.cpp index a6c7c153..6e337435 100644 --- a/core/model/messages/RegisteredDevicesRequestMessage.cpp +++ b/connectivity/core/model/messages/RegisteredDevicesRequestMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/RegisteredDevicesRequestMessage.h b/connectivity/core/model/messages/RegisteredDevicesRequestMessage.h similarity index 96% rename from core/model/messages/RegisteredDevicesRequestMessage.h rename to connectivity/core/model/messages/RegisteredDevicesRequestMessage.h index 9b68df29..4328d250 100644 --- a/core/model/messages/RegisteredDevicesRequestMessage.h +++ b/connectivity/core/model/messages/RegisteredDevicesRequestMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/RegisteredDevicesResponseMessage.cpp b/connectivity/core/model/messages/RegisteredDevicesResponseMessage.cpp similarity index 97% rename from core/model/messages/RegisteredDevicesResponseMessage.cpp rename to connectivity/core/model/messages/RegisteredDevicesResponseMessage.cpp index e4be6f5e..da37d4bd 100644 --- a/core/model/messages/RegisteredDevicesResponseMessage.cpp +++ b/connectivity/core/model/messages/RegisteredDevicesResponseMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/RegisteredDevicesResponseMessage.h b/connectivity/core/model/messages/RegisteredDevicesResponseMessage.h similarity index 97% rename from core/model/messages/RegisteredDevicesResponseMessage.h rename to connectivity/core/model/messages/RegisteredDevicesResponseMessage.h index 7fd12ca6..e796b5fa 100644 --- a/core/model/messages/RegisteredDevicesResponseMessage.h +++ b/connectivity/core/model/messages/RegisteredDevicesResponseMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/SynchronizeParametersMessage.cpp b/connectivity/core/model/messages/SynchronizeParametersMessage.cpp similarity index 95% rename from core/model/messages/SynchronizeParametersMessage.cpp rename to connectivity/core/model/messages/SynchronizeParametersMessage.cpp index 65423418..bcd3a1e8 100644 --- a/core/model/messages/SynchronizeParametersMessage.cpp +++ b/connectivity/core/model/messages/SynchronizeParametersMessage.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/model/messages/SynchronizeParametersMessage.h b/connectivity/core/model/messages/SynchronizeParametersMessage.h similarity index 96% rename from core/model/messages/SynchronizeParametersMessage.h rename to connectivity/core/model/messages/SynchronizeParametersMessage.h index 179713ff..06406b0e 100644 --- a/core/model/messages/SynchronizeParametersMessage.h +++ b/connectivity/core/model/messages/SynchronizeParametersMessage.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/persistence/MessagePersistence.h b/connectivity/core/persistence/MessagePersistence.h similarity index 97% rename from core/persistence/MessagePersistence.h rename to connectivity/core/persistence/MessagePersistence.h index ee7cced1..b243df6e 100644 --- a/core/persistence/MessagePersistence.h +++ b/connectivity/core/persistence/MessagePersistence.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/persistence/Persistence.h b/connectivity/core/persistence/Persistence.h similarity index 99% rename from core/persistence/Persistence.h rename to connectivity/core/persistence/Persistence.h index 125d1d27..22775fc1 100644 --- a/core/persistence/Persistence.h +++ b/connectivity/core/persistence/Persistence.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/persistence/filesystem/CircularFileSystemMessagePersistence.cpp b/connectivity/core/persistence/filesystem/CircularFileSystemMessagePersistence.cpp similarity index 96% rename from core/persistence/filesystem/CircularFileSystemMessagePersistence.cpp rename to connectivity/core/persistence/filesystem/CircularFileSystemMessagePersistence.cpp index 2a39f0f7..2cf7877a 100644 --- a/core/persistence/filesystem/CircularFileSystemMessagePersistence.cpp +++ b/connectivity/core/persistence/filesystem/CircularFileSystemMessagePersistence.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ #include "core/persistence/filesystem/CircularFileSystemMessagePersistence.h" #include "core/model/Message.h" -#include "core/utilities/FileSystemUtils.h" -#include "core/utilities/Logger.h" +#include "core/utility/FileSystemUtils.h" +#include "core/utility/Logger.h" using namespace wolkabout::legacy; diff --git a/core/persistence/filesystem/CircularFileSystemMessagePersistence.h b/connectivity/core/persistence/filesystem/CircularFileSystemMessagePersistence.h similarity index 97% rename from core/persistence/filesystem/CircularFileSystemMessagePersistence.h rename to connectivity/core/persistence/filesystem/CircularFileSystemMessagePersistence.h index fda2b7ab..503793b1 100644 --- a/core/persistence/filesystem/CircularFileSystemMessagePersistence.h +++ b/connectivity/core/persistence/filesystem/CircularFileSystemMessagePersistence.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/persistence/filesystem/FileSystemMessagePersistence.cpp b/connectivity/core/persistence/filesystem/FileSystemMessagePersistence.cpp similarity index 98% rename from core/persistence/filesystem/FileSystemMessagePersistence.cpp rename to connectivity/core/persistence/filesystem/FileSystemMessagePersistence.cpp index f7d51582..e21ce0f6 100644 --- a/core/persistence/filesystem/FileSystemMessagePersistence.cpp +++ b/connectivity/core/persistence/filesystem/FileSystemMessagePersistence.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ #include "core/persistence/filesystem/FileSystemMessagePersistence.h" #include "core/persistence/filesystem/MessagePersister.h" -#include "core/utilities/FileSystemUtils.h" -#include "core/utilities/Logger.h" +#include "core/utility/FileSystemUtils.h" +#include "core/utility/Logger.h" #include diff --git a/core/persistence/filesystem/FileSystemMessagePersistence.h b/connectivity/core/persistence/filesystem/FileSystemMessagePersistence.h similarity index 97% rename from core/persistence/filesystem/FileSystemMessagePersistence.h rename to connectivity/core/persistence/filesystem/FileSystemMessagePersistence.h index 98b0908f..78cc704e 100644 --- a/core/persistence/filesystem/FileSystemMessagePersistence.h +++ b/connectivity/core/persistence/filesystem/FileSystemMessagePersistence.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/persistence/filesystem/MessagePersister.cpp b/connectivity/core/persistence/filesystem/MessagePersister.cpp similarity index 96% rename from core/persistence/filesystem/MessagePersister.cpp rename to connectivity/core/persistence/filesystem/MessagePersister.cpp index d99c3608..ee734c0f 100644 --- a/core/persistence/filesystem/MessagePersister.cpp +++ b/connectivity/core/persistence/filesystem/MessagePersister.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/persistence/filesystem/MessagePersister.h b/connectivity/core/persistence/filesystem/MessagePersister.h similarity index 95% rename from core/persistence/filesystem/MessagePersister.h rename to connectivity/core/persistence/filesystem/MessagePersister.h index 3caa5570..cae5b653 100644 --- a/core/persistence/filesystem/MessagePersister.h +++ b/connectivity/core/persistence/filesystem/MessagePersister.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/persistence/inmemory/InMemoryMessagePersistence.cpp b/connectivity/core/persistence/inmemory/InMemoryMessagePersistence.cpp similarity index 96% rename from core/persistence/inmemory/InMemoryMessagePersistence.cpp rename to connectivity/core/persistence/inmemory/InMemoryMessagePersistence.cpp index 2feeea84..fc408301 100644 --- a/core/persistence/inmemory/InMemoryMessagePersistence.cpp +++ b/connectivity/core/persistence/inmemory/InMemoryMessagePersistence.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/persistence/inmemory/InMemoryMessagePersistence.h b/connectivity/core/persistence/inmemory/InMemoryMessagePersistence.h similarity index 96% rename from core/persistence/inmemory/InMemoryMessagePersistence.h rename to connectivity/core/persistence/inmemory/InMemoryMessagePersistence.h index c607de33..b9ec30aa 100644 --- a/core/persistence/inmemory/InMemoryMessagePersistence.h +++ b/connectivity/core/persistence/inmemory/InMemoryMessagePersistence.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/persistence/inmemory/InMemoryPersistence.cpp b/connectivity/core/persistence/inmemory/InMemoryPersistence.cpp similarity index 99% rename from core/persistence/inmemory/InMemoryPersistence.cpp rename to connectivity/core/persistence/inmemory/InMemoryPersistence.cpp index 6a24696d..70923835 100644 --- a/core/persistence/inmemory/InMemoryPersistence.cpp +++ b/connectivity/core/persistence/inmemory/InMemoryPersistence.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/persistence/inmemory/InMemoryPersistence.h b/connectivity/core/persistence/inmemory/InMemoryPersistence.h similarity index 98% rename from core/persistence/inmemory/InMemoryPersistence.h rename to connectivity/core/persistence/inmemory/InMemoryPersistence.h index 0129045e..3e0080cc 100644 --- a/core/persistence/inmemory/InMemoryPersistence.h +++ b/connectivity/core/persistence/inmemory/InMemoryPersistence.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/DataProtocol.h b/connectivity/core/protocol/DataProtocol.h similarity index 99% rename from core/protocol/DataProtocol.h rename to connectivity/core/protocol/DataProtocol.h index 100e2bb0..aad16c90 100644 --- a/core/protocol/DataProtocol.h +++ b/connectivity/core/protocol/DataProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/ErrorProtocol.h b/connectivity/core/protocol/ErrorProtocol.h similarity index 96% rename from core/protocol/ErrorProtocol.h rename to connectivity/core/protocol/ErrorProtocol.h index 5e6da029..72d9fe57 100644 --- a/core/protocol/ErrorProtocol.h +++ b/connectivity/core/protocol/ErrorProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/FileManagementProtocol.h b/connectivity/core/protocol/FileManagementProtocol.h similarity index 99% rename from core/protocol/FileManagementProtocol.h rename to connectivity/core/protocol/FileManagementProtocol.h index 98aed749..ea0c36e3 100644 --- a/core/protocol/FileManagementProtocol.h +++ b/connectivity/core/protocol/FileManagementProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/FirmwareUpdateProtocol.h b/connectivity/core/protocol/FirmwareUpdateProtocol.h similarity index 98% rename from core/protocol/FirmwareUpdateProtocol.h rename to connectivity/core/protocol/FirmwareUpdateProtocol.h index 81ba4b39..a9966e07 100644 --- a/core/protocol/FirmwareUpdateProtocol.h +++ b/connectivity/core/protocol/FirmwareUpdateProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/GatewayPlatformStatusProtocol.h b/connectivity/core/protocol/GatewayPlatformStatusProtocol.h similarity index 97% rename from core/protocol/GatewayPlatformStatusProtocol.h rename to connectivity/core/protocol/GatewayPlatformStatusProtocol.h index b837a23e..cb552250 100644 --- a/core/protocol/GatewayPlatformStatusProtocol.h +++ b/connectivity/core/protocol/GatewayPlatformStatusProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/GatewayRegistrationProtocol.h b/connectivity/core/protocol/GatewayRegistrationProtocol.h similarity index 98% rename from core/protocol/GatewayRegistrationProtocol.h rename to connectivity/core/protocol/GatewayRegistrationProtocol.h index c24c2d6c..0d881d3d 100644 --- a/core/protocol/GatewayRegistrationProtocol.h +++ b/connectivity/core/protocol/GatewayRegistrationProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/GatewaySubdeviceProtocol.h b/connectivity/core/protocol/GatewaySubdeviceProtocol.h similarity index 97% rename from core/protocol/GatewaySubdeviceProtocol.h rename to connectivity/core/protocol/GatewaySubdeviceProtocol.h index f8547dc9..326b5a43 100644 --- a/core/protocol/GatewaySubdeviceProtocol.h +++ b/connectivity/core/protocol/GatewaySubdeviceProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/PlatformStatusProtocol.h b/connectivity/core/protocol/PlatformStatusProtocol.h similarity index 96% rename from core/protocol/PlatformStatusProtocol.h rename to connectivity/core/protocol/PlatformStatusProtocol.h index 2359718a..07cc5abd 100644 --- a/core/protocol/PlatformStatusProtocol.h +++ b/connectivity/core/protocol/PlatformStatusProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/Protocol.h b/connectivity/core/protocol/Protocol.h similarity index 98% rename from core/protocol/Protocol.h rename to connectivity/core/protocol/Protocol.h index 225741e4..f7a8a089 100644 --- a/core/protocol/Protocol.h +++ b/connectivity/core/protocol/Protocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/RegistrationProtocol.h b/connectivity/core/protocol/RegistrationProtocol.h similarity index 99% rename from core/protocol/RegistrationProtocol.h rename to connectivity/core/protocol/RegistrationProtocol.h index d31e0fae..5df90d9f 100644 --- a/core/protocol/RegistrationProtocol.h +++ b/connectivity/core/protocol/RegistrationProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutDataProtocol.cpp b/connectivity/core/protocol/wolkabout/WolkaboutDataProtocol.cpp similarity index 99% rename from core/protocol/wolkabout/WolkaboutDataProtocol.cpp rename to connectivity/core/protocol/wolkabout/WolkaboutDataProtocol.cpp index f51a9acc..5e436d9b 100644 --- a/core/protocol/wolkabout/WolkaboutDataProtocol.cpp +++ b/connectivity/core/protocol/wolkabout/WolkaboutDataProtocol.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ #include "core/model/Feed.h" #include "core/model/Reading.h" #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include #include diff --git a/core/protocol/wolkabout/WolkaboutDataProtocol.h b/connectivity/core/protocol/wolkabout/WolkaboutDataProtocol.h similarity index 98% rename from core/protocol/wolkabout/WolkaboutDataProtocol.h rename to connectivity/core/protocol/wolkabout/WolkaboutDataProtocol.h index e293430a..ccd7cb61 100644 --- a/core/protocol/wolkabout/WolkaboutDataProtocol.h +++ b/connectivity/core/protocol/wolkabout/WolkaboutDataProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutErrorProtocol.cpp b/connectivity/core/protocol/wolkabout/WolkaboutErrorProtocol.cpp similarity index 97% rename from core/protocol/wolkabout/WolkaboutErrorProtocol.cpp rename to connectivity/core/protocol/wolkabout/WolkaboutErrorProtocol.cpp index eebb079f..6aaba5af 100644 --- a/core/protocol/wolkabout/WolkaboutErrorProtocol.cpp +++ b/connectivity/core/protocol/wolkabout/WolkaboutErrorProtocol.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #include "core/protocol/wolkabout/WolkaboutErrorProtocol.h" #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" using namespace wolkabout::legacy; diff --git a/core/protocol/wolkabout/WolkaboutErrorProtocol.h b/connectivity/core/protocol/wolkabout/WolkaboutErrorProtocol.h similarity index 97% rename from core/protocol/wolkabout/WolkaboutErrorProtocol.h rename to connectivity/core/protocol/wolkabout/WolkaboutErrorProtocol.h index e43a2b97..56f68ec1 100644 --- a/core/protocol/wolkabout/WolkaboutErrorProtocol.h +++ b/connectivity/core/protocol/wolkabout/WolkaboutErrorProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutFileManagementProtocol.cpp b/connectivity/core/protocol/wolkabout/WolkaboutFileManagementProtocol.cpp similarity index 99% rename from core/protocol/wolkabout/WolkaboutFileManagementProtocol.cpp rename to connectivity/core/protocol/wolkabout/WolkaboutFileManagementProtocol.cpp index da0d2646..fe8f299a 100644 --- a/core/protocol/wolkabout/WolkaboutFileManagementProtocol.cpp +++ b/connectivity/core/protocol/wolkabout/WolkaboutFileManagementProtocol.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #include "core/protocol/wolkabout/WolkaboutFileManagementProtocol.h" #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/core/protocol/wolkabout/WolkaboutFileManagementProtocol.h b/connectivity/core/protocol/wolkabout/WolkaboutFileManagementProtocol.h similarity index 98% rename from core/protocol/wolkabout/WolkaboutFileManagementProtocol.h rename to connectivity/core/protocol/wolkabout/WolkaboutFileManagementProtocol.h index af3d5b30..11a3710a 100644 --- a/core/protocol/wolkabout/WolkaboutFileManagementProtocol.h +++ b/connectivity/core/protocol/wolkabout/WolkaboutFileManagementProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.cpp b/connectivity/core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.cpp similarity index 98% rename from core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.cpp rename to connectivity/core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.cpp index eac08b51..8dc06e28 100644 --- a/core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.cpp +++ b/connectivity/core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #include "core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h" #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h b/connectivity/core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h similarity index 97% rename from core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h rename to connectivity/core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h index f7a129ce..03433606 100644 --- a/core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h +++ b/connectivity/core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.cpp b/connectivity/core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.cpp similarity index 96% rename from core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.cpp rename to connectivity/core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.cpp index 0db3bede..56f78c86 100644 --- a/core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.cpp +++ b/connectivity/core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #include "core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.h" #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" using namespace wolkabout::legacy; diff --git a/core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.h b/connectivity/core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.h similarity index 97% rename from core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.h rename to connectivity/core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.h index cbee5152..393fe1de 100644 --- a/core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.h +++ b/connectivity/core/protocol/wolkabout/WolkaboutGatewayPlatformStatusProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.cpp b/connectivity/core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.cpp similarity index 99% rename from core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.cpp rename to connectivity/core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.cpp index c296eb83..0602f1b0 100644 --- a/core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.cpp +++ b/connectivity/core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #include "core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.h" #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.h b/connectivity/core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.h similarity index 97% rename from core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.h rename to connectivity/core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.h index a9b16aab..3e6e526d 100644 --- a/core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.h +++ b/connectivity/core/protocol/wolkabout/WolkaboutGatewayRegistrationProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.cpp b/connectivity/core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.cpp similarity index 97% rename from core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.cpp rename to connectivity/core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.cpp index 58d1e6f5..887dafd9 100644 --- a/core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.cpp +++ b/connectivity/core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ #include "core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.h" #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" -#include "core/utilities/StringUtils.h" +#include "core/utility/Logger.h" +#include "core/utility/StringUtils.h" #include diff --git a/core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.h b/connectivity/core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.h similarity index 97% rename from core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.h rename to connectivity/core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.h index 46a9882f..cf4bb0f9 100644 --- a/core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.h +++ b/connectivity/core/protocol/wolkabout/WolkaboutGatewaySubdeviceProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.cpp b/connectivity/core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.cpp similarity index 97% rename from core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.cpp rename to connectivity/core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.cpp index 0c0b7c66..e5352309 100644 --- a/core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.cpp +++ b/connectivity/core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #include "core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h" #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" using namespace wolkabout::legacy; diff --git a/core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h b/connectivity/core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h similarity index 97% rename from core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h rename to connectivity/core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h index e380939e..963e815a 100644 --- a/core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h +++ b/connectivity/core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutProtocol.cpp b/connectivity/core/protocol/wolkabout/WolkaboutProtocol.cpp similarity index 99% rename from core/protocol/wolkabout/WolkaboutProtocol.cpp rename to connectivity/core/protocol/wolkabout/WolkaboutProtocol.cpp index 2b10448e..f5801102 100644 --- a/core/protocol/wolkabout/WolkaboutProtocol.cpp +++ b/connectivity/core/protocol/wolkabout/WolkaboutProtocol.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutProtocol.h b/connectivity/core/protocol/wolkabout/WolkaboutProtocol.h similarity index 98% rename from core/protocol/wolkabout/WolkaboutProtocol.h rename to connectivity/core/protocol/wolkabout/WolkaboutProtocol.h index 19c57b16..b781ac66 100644 --- a/core/protocol/wolkabout/WolkaboutProtocol.h +++ b/connectivity/core/protocol/wolkabout/WolkaboutProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/protocol/wolkabout/WolkaboutRegistrationProtocol.cpp b/connectivity/core/protocol/wolkabout/WolkaboutRegistrationProtocol.cpp similarity index 99% rename from core/protocol/wolkabout/WolkaboutRegistrationProtocol.cpp rename to connectivity/core/protocol/wolkabout/WolkaboutRegistrationProtocol.cpp index 1ce332fa..f2273ee9 100644 --- a/core/protocol/wolkabout/WolkaboutRegistrationProtocol.cpp +++ b/connectivity/core/protocol/wolkabout/WolkaboutRegistrationProtocol.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #include "core/protocol/wolkabout/WolkaboutRegistrationProtocol.h" #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/core/protocol/wolkabout/WolkaboutRegistrationProtocol.h b/connectivity/core/protocol/wolkabout/WolkaboutRegistrationProtocol.h similarity index 98% rename from core/protocol/wolkabout/WolkaboutRegistrationProtocol.h rename to connectivity/core/protocol/wolkabout/WolkaboutRegistrationProtocol.h index 4ed32401..2c59ef88 100644 --- a/core/protocol/wolkabout/WolkaboutRegistrationProtocol.h +++ b/connectivity/core/protocol/wolkabout/WolkaboutRegistrationProtocol.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/BufferTests.cpp b/connectivity/tests/BufferTests.cpp similarity index 95% rename from tests/BufferTests.cpp rename to connectivity/tests/BufferTests.cpp index e4f1e74d..cf3bfb2f 100644 --- a/tests/BufferTests.cpp +++ b/connectivity/tests/BufferTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/ByteUtilsTests.cpp b/connectivity/tests/ByteUtilsTests.cpp similarity index 98% rename from tests/ByteUtilsTests.cpp rename to connectivity/tests/ByteUtilsTests.cpp index 89faa91a..2a60950c 100644 --- a/tests/ByteUtilsTests.cpp +++ b/connectivity/tests/ByteUtilsTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/connectivity/tests/CMakeLists.txt b/connectivity/tests/CMakeLists.txt new file mode 100644 index 00000000..c824269f --- /dev/null +++ b/connectivity/tests/CMakeLists.txt @@ -0,0 +1,57 @@ +set(TESTS_SOURCE_FILES ${TESTS_SOURCE_FILES} + tests/BufferTests.cpp + tests/ByteUtilsTests.cpp + tests/CommandBufferTests.cpp + tests/FileSystemUtils.cpp + tests/InboundPlatformMessageHandlerTests.cpp + tests/LoggerTests.cpp + tests/LogManagerTests.cpp + tests/ModelMessagesTests.cpp + tests/ModelsTests.cpp + tests/MqttConnectivityServiceTests.cpp + tests/OutboundRetryMessageHandlerTests.cpp + tests/PahoMqttClientTests.cpp + tests/StringUtilsTests.cpp + tests/TimerTests.cpp + tests/TypesTests.cpp + tests/WolkaboutDataProtocolTests.cpp + tests/WolkaboutErrorProtocolTests.cpp + tests/WolkaboutFileManagementProtocolTests.cpp + tests/WolkaboutFirmwareUpdateProtocolTests.cpp + tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp + tests/WolkaboutGatewayRegistrationProtocolTests.cpp + tests/WolkaboutGatewaySubdeviceProtocolTests.cpp + tests/WolkaboutPlatformStatusProtocolTests.cpp + tests/WolkaboutRegistrationProtocolTests.cpp) +set(TESTS_HEADER_FILES ${TESTS_HEADER_FILES} + tests/mocks/ConnectivityServiceMock.h + tests/mocks/DataProtocolMock.h + tests/mocks/ErrorProtocolMock.h + tests/mocks/FileManagementProtocolMock.h + tests/mocks/FirmwareUpdateProtocolMock.h + tests/mocks/GatewayPlatformStatusProtocolMock.h + tests/mocks/GatewayRegistrationProtocolMock.h + tests/mocks/GatewaySubdeviceProtocolMock.h + tests/mocks/InboundMessageHandlerMock.h + tests/mocks/MessageListenerMock.h + tests/mocks/MessagePersistenceMock.h + tests/mocks/OutboundMessageHandlerMock.h + tests/mocks/OutboundRetryMessageHandlerMock.h + tests/mocks/PahoMqttClientMock.h + tests/mocks/PersistenceMock.h + tests/mocks/PlatformStatusProtocolMock.h + tests/mocks/ProtocolMock.h + tests/mocks/RegistrationProtocolMock.h) + +list(APPEND INSTALL_TARGETS ${PROJECT_NAME}) + +add_executable(${PROJECT_NAME}Tests ${TESTS_SOURCE_FILES} ${TESTS_HEADER_FILES}) +target_link_libraries(${PROJECT_NAME}Tests ${PROJECT_NAME} gtest gmock gtest_main Threads::Threads) +target_include_directories(${PROJECT_NAME}Tests PRIVATE ${PROJECT_SOURCE_DIR}) +target_include_directories(${PROJECT_NAME}Tests SYSTEM PRIVATE ${CMAKE_PREFIX_PATH}/include) +target_include_directories(${PROJECT_NAME}Tests PUBLIC $ $) +set_target_properties(${PROJECT_NAME}Tests PROPERTIES INSTALL_RPATH "$ORIGIN/../lib") +add_dependencies(${PROJECT_NAME}Tests libgtest) + +enable_testing() +add_test(NAME "WolkSDK-Cpp_Tests" COMMAND ${PROJECT_NAME}Tests) diff --git a/tests/CommandBufferTests.cpp b/connectivity/tests/CommandBufferTests.cpp similarity index 95% rename from tests/CommandBufferTests.cpp rename to connectivity/tests/CommandBufferTests.cpp index b78c8c03..fab097b1 100644 --- a/tests/CommandBufferTests.cpp +++ b/connectivity/tests/CommandBufferTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/FileSystemUtils.cpp b/connectivity/tests/FileSystemUtils.cpp similarity index 99% rename from tests/FileSystemUtils.cpp rename to connectivity/tests/FileSystemUtils.cpp index b69d62c2..baf2cb07 100644 --- a/tests/FileSystemUtils.cpp +++ b/connectivity/tests/FileSystemUtils.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/InboundPlatformMessageHandlerTests.cpp b/connectivity/tests/InboundPlatformMessageHandlerTests.cpp similarity index 98% rename from tests/InboundPlatformMessageHandlerTests.cpp rename to connectivity/tests/InboundPlatformMessageHandlerTests.cpp index 4b1d9ba1..280c061c 100644 --- a/tests/InboundPlatformMessageHandlerTests.cpp +++ b/connectivity/tests/InboundPlatformMessageHandlerTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/LogManagerTests.cpp b/connectivity/tests/LogManagerTests.cpp similarity index 95% rename from tests/LogManagerTests.cpp rename to connectivity/tests/LogManagerTests.cpp index bdfd721a..e5420176 100644 --- a/tests/LogManagerTests.cpp +++ b/connectivity/tests/LogManagerTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/LoggerTests.cpp b/connectivity/tests/LoggerTests.cpp similarity index 97% rename from tests/LoggerTests.cpp rename to connectivity/tests/LoggerTests.cpp index d5d5e58b..bc8db105 100644 --- a/tests/LoggerTests.cpp +++ b/connectivity/tests/LoggerTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/ModelMessagesTests.cpp b/connectivity/tests/ModelMessagesTests.cpp similarity index 99% rename from tests/ModelMessagesTests.cpp rename to connectivity/tests/ModelMessagesTests.cpp index 659310db..b377dbf8 100644 --- a/tests/ModelMessagesTests.cpp +++ b/connectivity/tests/ModelMessagesTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/ModelsTests.cpp b/connectivity/tests/ModelsTests.cpp similarity index 99% rename from tests/ModelsTests.cpp rename to connectivity/tests/ModelsTests.cpp index 5fba20be..a3f13e33 100644 --- a/tests/ModelsTests.cpp +++ b/connectivity/tests/ModelsTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/MqttConnectivityServiceTests.cpp b/connectivity/tests/MqttConnectivityServiceTests.cpp similarity index 97% rename from tests/MqttConnectivityServiceTests.cpp rename to connectivity/tests/MqttConnectivityServiceTests.cpp index fa770688..3ee8d81c 100644 --- a/tests/MqttConnectivityServiceTests.cpp +++ b/connectivity/tests/MqttConnectivityServiceTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/OutboundRetryMessageHandlerTests.cpp b/connectivity/tests/OutboundRetryMessageHandlerTests.cpp similarity index 98% rename from tests/OutboundRetryMessageHandlerTests.cpp rename to connectivity/tests/OutboundRetryMessageHandlerTests.cpp index 13f66432..3cb37da4 100644 --- a/tests/OutboundRetryMessageHandlerTests.cpp +++ b/connectivity/tests/OutboundRetryMessageHandlerTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/PahoMqttClientTests.cpp b/connectivity/tests/PahoMqttClientTests.cpp similarity index 95% rename from tests/PahoMqttClientTests.cpp rename to connectivity/tests/PahoMqttClientTests.cpp index a5323c55..5a0dfe09 100644 --- a/tests/PahoMqttClientTests.cpp +++ b/connectivity/tests/PahoMqttClientTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/StringUtilsTests.cpp b/connectivity/tests/StringUtilsTests.cpp similarity index 98% rename from tests/StringUtilsTests.cpp rename to connectivity/tests/StringUtilsTests.cpp index b1349757..341b1e23 100644 --- a/tests/StringUtilsTests.cpp +++ b/connectivity/tests/StringUtilsTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/TimerTests.cpp b/connectivity/tests/TimerTests.cpp similarity index 98% rename from tests/TimerTests.cpp rename to connectivity/tests/TimerTests.cpp index 5fc39241..64e17f0d 100644 --- a/tests/TimerTests.cpp +++ b/connectivity/tests/TimerTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/TypesTests.cpp b/connectivity/tests/TypesTests.cpp similarity index 99% rename from tests/TypesTests.cpp rename to connectivity/tests/TypesTests.cpp index efcc8bfa..82daea20 100644 --- a/tests/TypesTests.cpp +++ b/connectivity/tests/TypesTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ #define private public #define protected public -#include "core/Types.h" +#include "core/utility/Types.h" #undef private #undef protected diff --git a/tests/WolkaboutDataProtocolTests.cpp b/connectivity/tests/WolkaboutDataProtocolTests.cpp similarity index 99% rename from tests/WolkaboutDataProtocolTests.cpp rename to connectivity/tests/WolkaboutDataProtocolTests.cpp index a880b989..38754c2a 100644 --- a/tests/WolkaboutDataProtocolTests.cpp +++ b/connectivity/tests/WolkaboutDataProtocolTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/WolkaboutErrorProtocolTests.cpp b/connectivity/tests/WolkaboutErrorProtocolTests.cpp similarity index 98% rename from tests/WolkaboutErrorProtocolTests.cpp rename to connectivity/tests/WolkaboutErrorProtocolTests.cpp index 91470f65..6ac73d07 100644 --- a/tests/WolkaboutErrorProtocolTests.cpp +++ b/connectivity/tests/WolkaboutErrorProtocolTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/WolkaboutFileManagementProtocolTests.cpp b/connectivity/tests/WolkaboutFileManagementProtocolTests.cpp similarity index 100% rename from tests/WolkaboutFileManagementProtocolTests.cpp rename to connectivity/tests/WolkaboutFileManagementProtocolTests.cpp diff --git a/tests/WolkaboutFirmwareUpdateProtocolTests.cpp b/connectivity/tests/WolkaboutFirmwareUpdateProtocolTests.cpp similarity index 100% rename from tests/WolkaboutFirmwareUpdateProtocolTests.cpp rename to connectivity/tests/WolkaboutFirmwareUpdateProtocolTests.cpp diff --git a/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp b/connectivity/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp similarity index 98% rename from tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp rename to connectivity/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp index adb49992..9a8c53c3 100644 --- a/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp +++ b/connectivity/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/WolkaboutGatewayRegistrationProtocolTests.cpp b/connectivity/tests/WolkaboutGatewayRegistrationProtocolTests.cpp similarity index 99% rename from tests/WolkaboutGatewayRegistrationProtocolTests.cpp rename to connectivity/tests/WolkaboutGatewayRegistrationProtocolTests.cpp index b10d70b3..1e910c01 100644 --- a/tests/WolkaboutGatewayRegistrationProtocolTests.cpp +++ b/connectivity/tests/WolkaboutGatewayRegistrationProtocolTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp b/connectivity/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp similarity index 99% rename from tests/WolkaboutGatewaySubdeviceProtocolTests.cpp rename to connectivity/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp index 410a9bf2..6dcc38c3 100644 --- a/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp +++ b/connectivity/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/WolkaboutPlatformStatusProtocolTests.cpp b/connectivity/tests/WolkaboutPlatformStatusProtocolTests.cpp similarity index 98% rename from tests/WolkaboutPlatformStatusProtocolTests.cpp rename to connectivity/tests/WolkaboutPlatformStatusProtocolTests.cpp index ef49ef3f..db6992d3 100644 --- a/tests/WolkaboutPlatformStatusProtocolTests.cpp +++ b/connectivity/tests/WolkaboutPlatformStatusProtocolTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/WolkaboutRegistrationProtocolTests.cpp b/connectivity/tests/WolkaboutRegistrationProtocolTests.cpp similarity index 99% rename from tests/WolkaboutRegistrationProtocolTests.cpp rename to connectivity/tests/WolkaboutRegistrationProtocolTests.cpp index 0bafe9f7..4cfcf6b7 100644 --- a/tests/WolkaboutRegistrationProtocolTests.cpp +++ b/connectivity/tests/WolkaboutRegistrationProtocolTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/ConnectivityServiceMock.h b/connectivity/tests/mocks/ConnectivityServiceMock.h similarity index 96% rename from tests/mocks/ConnectivityServiceMock.h rename to connectivity/tests/mocks/ConnectivityServiceMock.h index 1dfdabe6..7a3aed60 100644 --- a/tests/mocks/ConnectivityServiceMock.h +++ b/connectivity/tests/mocks/ConnectivityServiceMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/DataProtocolMock.h b/connectivity/tests/mocks/DataProtocolMock.h similarity index 98% rename from tests/mocks/DataProtocolMock.h rename to connectivity/tests/mocks/DataProtocolMock.h index 485a5897..c84d94cc 100644 --- a/tests/mocks/DataProtocolMock.h +++ b/connectivity/tests/mocks/DataProtocolMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/ErrorProtocolMock.h b/connectivity/tests/mocks/ErrorProtocolMock.h similarity index 97% rename from tests/mocks/ErrorProtocolMock.h rename to connectivity/tests/mocks/ErrorProtocolMock.h index 13c5672b..56067d8c 100644 --- a/tests/mocks/ErrorProtocolMock.h +++ b/connectivity/tests/mocks/ErrorProtocolMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/FileManagementProtocolMock.h b/connectivity/tests/mocks/FileManagementProtocolMock.h similarity index 98% rename from tests/mocks/FileManagementProtocolMock.h rename to connectivity/tests/mocks/FileManagementProtocolMock.h index 67fe4ddd..554327bd 100644 --- a/tests/mocks/FileManagementProtocolMock.h +++ b/connectivity/tests/mocks/FileManagementProtocolMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/FirmwareUpdateProtocolMock.h b/connectivity/tests/mocks/FirmwareUpdateProtocolMock.h similarity index 100% rename from tests/mocks/FirmwareUpdateProtocolMock.h rename to connectivity/tests/mocks/FirmwareUpdateProtocolMock.h diff --git a/tests/mocks/GatewayPlatformStatusProtocolMock.h b/connectivity/tests/mocks/GatewayPlatformStatusProtocolMock.h similarity index 97% rename from tests/mocks/GatewayPlatformStatusProtocolMock.h rename to connectivity/tests/mocks/GatewayPlatformStatusProtocolMock.h index bfb408c2..488795a3 100644 --- a/tests/mocks/GatewayPlatformStatusProtocolMock.h +++ b/connectivity/tests/mocks/GatewayPlatformStatusProtocolMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/GatewayRegistrationProtocolMock.h b/connectivity/tests/mocks/GatewayRegistrationProtocolMock.h similarity index 97% rename from tests/mocks/GatewayRegistrationProtocolMock.h rename to connectivity/tests/mocks/GatewayRegistrationProtocolMock.h index ad362c66..07552a93 100644 --- a/tests/mocks/GatewayRegistrationProtocolMock.h +++ b/connectivity/tests/mocks/GatewayRegistrationProtocolMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/GatewaySubdeviceProtocolMock.h b/connectivity/tests/mocks/GatewaySubdeviceProtocolMock.h similarity index 97% rename from tests/mocks/GatewaySubdeviceProtocolMock.h rename to connectivity/tests/mocks/GatewaySubdeviceProtocolMock.h index 64d6ba89..650d9229 100644 --- a/tests/mocks/GatewaySubdeviceProtocolMock.h +++ b/connectivity/tests/mocks/GatewaySubdeviceProtocolMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/InboundMessageHandlerMock.h b/connectivity/tests/mocks/InboundMessageHandlerMock.h similarity index 96% rename from tests/mocks/InboundMessageHandlerMock.h rename to connectivity/tests/mocks/InboundMessageHandlerMock.h index ff3ac97d..e57b16d5 100644 --- a/tests/mocks/InboundMessageHandlerMock.h +++ b/connectivity/tests/mocks/InboundMessageHandlerMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/MessageListenerMock.h b/connectivity/tests/mocks/MessageListenerMock.h similarity index 96% rename from tests/mocks/MessageListenerMock.h rename to connectivity/tests/mocks/MessageListenerMock.h index a4a9398a..0145a306 100644 --- a/tests/mocks/MessageListenerMock.h +++ b/connectivity/tests/mocks/MessageListenerMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/MessagePersistenceMock.h b/connectivity/tests/mocks/MessagePersistenceMock.h similarity index 96% rename from tests/mocks/MessagePersistenceMock.h rename to connectivity/tests/mocks/MessagePersistenceMock.h index c8ed966f..62373882 100644 --- a/tests/mocks/MessagePersistenceMock.h +++ b/connectivity/tests/mocks/MessagePersistenceMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/OutboundMessageHandlerMock.h b/connectivity/tests/mocks/OutboundMessageHandlerMock.h similarity index 95% rename from tests/mocks/OutboundMessageHandlerMock.h rename to connectivity/tests/mocks/OutboundMessageHandlerMock.h index ddac5630..f104c8b8 100644 --- a/tests/mocks/OutboundMessageHandlerMock.h +++ b/connectivity/tests/mocks/OutboundMessageHandlerMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/OutboundRetryMessageHandlerMock.h b/connectivity/tests/mocks/OutboundRetryMessageHandlerMock.h similarity index 96% rename from tests/mocks/OutboundRetryMessageHandlerMock.h rename to connectivity/tests/mocks/OutboundRetryMessageHandlerMock.h index 892263ac..b9504cff 100644 --- a/tests/mocks/OutboundRetryMessageHandlerMock.h +++ b/connectivity/tests/mocks/OutboundRetryMessageHandlerMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/PahoMqttClientMock.h b/connectivity/tests/mocks/PahoMqttClientMock.h similarity index 96% rename from tests/mocks/PahoMqttClientMock.h rename to connectivity/tests/mocks/PahoMqttClientMock.h index eca11f73..974d704f 100644 --- a/tests/mocks/PahoMqttClientMock.h +++ b/connectivity/tests/mocks/PahoMqttClientMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/PersistenceMock.h b/connectivity/tests/mocks/PersistenceMock.h similarity index 97% rename from tests/mocks/PersistenceMock.h rename to connectivity/tests/mocks/PersistenceMock.h index ba889d79..f4f31766 100644 --- a/tests/mocks/PersistenceMock.h +++ b/connectivity/tests/mocks/PersistenceMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/PlatformStatusProtocolMock.h b/connectivity/tests/mocks/PlatformStatusProtocolMock.h similarity index 97% rename from tests/mocks/PlatformStatusProtocolMock.h rename to connectivity/tests/mocks/PlatformStatusProtocolMock.h index dfb928a6..6c6f65ec 100644 --- a/tests/mocks/PlatformStatusProtocolMock.h +++ b/connectivity/tests/mocks/PlatformStatusProtocolMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/ProtocolMock.h b/connectivity/tests/mocks/ProtocolMock.h similarity index 96% rename from tests/mocks/ProtocolMock.h rename to connectivity/tests/mocks/ProtocolMock.h index 7507bf7f..a19a0f64 100644 --- a/tests/mocks/ProtocolMock.h +++ b/connectivity/tests/mocks/ProtocolMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/mocks/RegistrationProtocolMock.h b/connectivity/tests/mocks/RegistrationProtocolMock.h similarity index 98% rename from tests/mocks/RegistrationProtocolMock.h rename to connectivity/tests/mocks/RegistrationProtocolMock.h index ca7fb9d2..52fbbe8f 100644 --- a/tests/mocks/RegistrationProtocolMock.h +++ b/connectivity/tests/mocks/RegistrationProtocolMock.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/LICENSE b/core/LICENSE deleted file mode 100644 index 261eeb9e..00000000 --- a/core/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt deleted file mode 100644 index c7d15cbf..00000000 --- a/dependencies/CMakeLists.txt +++ /dev/null @@ -1,137 +0,0 @@ -include(ExternalProject) - -set(SPDLOG_VERSION "1.8.5") -set(PAHO_MQTT_C_VERSION "1.3.8") -set(PAHO_MQTT_CPP_VERSION "1.2.0") -set(GTEST_VERSION "1.10.0") -set(POCO_VERSION "1.10.1") -set(AWS_SDK_VERSION "1.8.173") -set(NLOHMANN_JSON_VERSION "3.7.3") -set(JSON_SCHEMA_VERSION "2.1.0") - -if (NOT TARGET spdlog) - ExternalProject_Add(spdlog - GIT_REPOSITORY "https://github.com/gabime/spdlog" - GIT_TAG "v${SPDLOG_VERSION}" - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} - -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} - ) -endif () - -if (BUILD_CONNECTIVITY AND NOT TARGET pahomqttc AND NOT TARGET pahomqttcpp) - ExternalProject_Add(pahomqttc - GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.c" - GIT_TAG "v${PAHO_MQTT_C_VERSION}" - UPDATE_COMMAND "" - CMAKE_ARGS - -DPAHO_WITH_SSL=TRUE - -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} - -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} - ) - - ExternalProject_Add(pahomqttcpp - GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.cpp" - GIT_TAG "v${PAHO_MQTT_CPP_VERSION}" - UPDATE_COMMAND "" - CMAKE_ARGS -DPAHO_WITH_SSL=TRUE - -DPAHO_MQTT_C_INCLUDE_DIRS=${CMAKE_PREFIX_PATH}/include - -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} - -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} - DEPENDS pahomqttc - ) -endif () - -if (BUILD_GTEST AND NOT TARGET libgtest) - ExternalProject_Add(libgtest - GIT_REPOSITORY "https://github.com/google/googletest" - GIT_TAG "release-${GTEST_VERSION}" - CMAKE_ARGS -DBUILD_SHARED_LIBS=ON - -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} - -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} - ) -endif () - -if (BUILD_POCO AND NOT TARGET libpoco) - if (NOT DEFINED POCO_INSTALL_DIR) - set(POCO_INSTALL_DIR ${CMAKE_PREFIX_PATH}) - endif () - - ExternalProject_Add(libpoco - GIT_REPOSITORY "https://github.com/pocoproject/poco" - GIT_TAG "poco-${POCO_VERSION}-release" - CMAKE_ARGS - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DDISABLE_CPP14=TRUE - -DENABLE_ENCODINGS=${POCO_ENABLE_ENCODINGS} - -DENABLE_ENCODINGS_COMPILER=${POCO_ENABLE_ENCODINGS_COMPILER} - -DENABLE_XML=${POCO_ENABLE_XML} - -DENABLE_JSON=${POCO_ENABLE_JSON} - -DENABLE_MONGODB=${POCO_ENABLE_MONGODB} - -DENABLE_REDIS=${POCO_ENABLE_REDIS} - -DENABLE_PDF=${POCO_ENABLE_PDF} - -DENABLE_UTIL=${POCO_ENABLE_UTIL} - -DENABLE_NET=${POCO_ENABLE_NET} - -DENABLE_NETSSL=${POCO_ENABLE_NETSSL} - -DENABLE_NETSSL_WIN=${POCO_ENABLE_NETSSL_WIN} - -DENABLE_CRYPTO=${POCO_ENABLE_CRYPTO} - -DENABLE_DATA=${POCO_ENABLE_DATA} - -DENABLE_DATA_SQLITE=${POCO_ENABLE_DATA_SQLITE} - -DENABLE_DATA_MYSQL=${POCO_ENABLE_DATA_MYSQL} - -DENABLE_DATA_ODBC=${POCO_ENABLE_DATA_ODBC} - -DENABLE_SEVENZIP=${POCO_ENABLE_SEVENZIP} - -DENABLE_ZIP=${POCO_ENABLE_ZIP} - -DENABLE_APACHECONNECTOR=${POCO_ENABLE_APACHECONNECTOR} - -DENABLE_CPPPARSER=${POCO_ENABLE_CPPPARSER} - -DENABLE_POCODOC=${POCO_ENABLE_POCODOC} - -DENABLE_PAGECOMPILER=${POCO_ENABLE_PAGECOMPILER} - -DENABLE_PAGECOMPILER_FILE2PAGE=${POCO_ENABLE_PAGECOMPILER_FILE2PAGE} - -DCMAKE_INSTALL_PREFIX=${POCO_INSTALL_DIR} - -DCMAKE_INSTALL_RPATH=$ORIGIN - ) -endif () - -if (BUILD_AWS_LOG_UPLOADER AND NOT TARGET aws-sdk-cpp) - if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(AWS_UNITY_BUILD "OFF") - set(AWS_MINIMIZE_SIZE "OFF") - else (CMAKE_BUILD_TYPE STREQUAL "Release") - set(AWS_UNITY_BUILD "ON") - set(AWS_MINIMIZE_SIZE "ON") - endif () - - ExternalProject_Add(aws-sdk-cpp - GIT_REPOSITORY "https://github.com/aws/aws-sdk-cpp" - GIT_TAG "${AWS_SDK_VERSION}" - CMAKE_ARGS - -DBUILD_SHARED_LIBS=ON - -DBUILD_ONLY=s3 - -DENABLE_UNITY_BUILD=${AWS_UNITY_BUILD} - -DMINIMIZE_SIZE=${AWS_MINIMIZE_SIZE} - -DENABLE_TESTING=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON - -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH}) -endif () - -if (NOT TARGET nlohmann_json) - ExternalProject_Add(nlohmann_json - GIT_REPOSITORY "https://github.com/nlohmann/json" - GIT_TAG "v${NLOHMANN_JSON_VERSION}" - CMAKE_ARGS - -DJSON_BuildTests=OFF - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH}) -endif () - -if (NOT TARGET json-schema) - ExternalProject_Add(json-schema - GIT_REPOSITORY "https://github.com/pboettch/json-schema-validator" - GIT_TAG "${JSON_SCHEMA_VERSION}" - CMAKE_ARGS - -DBUILD_SHARED_LIBS=ON - -DBUILD_TESTS=OFF - -DBUILD_EXAMPLES=OFF - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH}) - add_dependencies(json-schema nlohmann_json) -endif () diff --git a/out/coverage.sh b/out/coverage.sh deleted file mode 100755 index 0ca1a29f..00000000 --- a/out/coverage.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -WORK_DIR=$(pwd | sed -e "s/\/out//g") -echo "${WORK_DIR}" - -rm ./coverage.info -rm -rf ./coverage -lcov -b . -c -d . -o ./coverage.info -lcov -r ./coverage.info '/usr/*' "${WORK_DIR}/core/persistence/*" "${WORK_DIR}/core/utilities/json.hpp" "${WORK_DIR}/out/*" "${WORK_DIR}/tests/*" -o ./coverage.info -genhtml -o ./coverage ./coverage.info diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt new file mode 100644 index 00000000..bea90793 --- /dev/null +++ b/util/CMakeLists.txt @@ -0,0 +1,50 @@ +# Place the sub-folder this target is placed into a variable +set(SUBDIRECTORY_PATH util) + +# Include the util dependencies +include(cmake/dependencies.cmake) + +# Create the library +add_library(${UTIL_TARGET_NAME}) +add_library(${NAMESPACE}::${UTIL_TARGET_NAME} ALIAS ${UTIL_TARGET_NAME}) + +# Link the libraries +target_link_libraries(${UTIL_TARGET_NAME} PRIVATE OpenSSL::Crypto spdlog::spdlog) + +# Set some target properties +set_target_properties(${UTIL_TARGET_NAME} PROPERTIES OUTPUT_NAME "${NAMESPACE}${UTIL_TARGET_NAME}") +set_target_properties(${UTIL_TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN") +set_target_properties(${UTIL_TARGET_NAME} PROPERTIES VERSION ${PROJECT_VERSION}) +set_target_properties(${UTIL_TARGET_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) + +# Add the sources +target_sources(${UTIL_TARGET_NAME} PRIVATE core/utility/ByteUtils.cpp + core/utility/CommandBuffer.cpp + core/utility/FileSystemUtils.cpp + core/utility/Logger.cpp + core/utility/LogManager.cpp + core/utility/StringUtils.cpp + core/utility/Timer.cpp) + +# Add the headers +target_sources(${UTIL_TARGET_NAME} PRIVATE core/utility/Buffer.h + core/utility/ByteUtils.h + core/utility/CommandBuffer.h + core/utility/FileSystemUtils.h + core/utility/Logger.h + core/utility/LogManager.h + core/utility/LogUploader.h + core/utility/Service.h + core/utility/StringUtils.h + core/utility/Timer.h) + +# Add the private include directories +target_include_directories(${UTIL_TARGET_NAME} + PRIVATE + ${PROJECT_SOURCE_DIR}/${SUBDIRECTORY_PATH}) + +# Add the public include directories +target_include_directories(${UTIL_TARGET_NAME} + PUBLIC + $ + $) diff --git a/util/cmake/dependencies.cmake b/util/cmake/dependencies.cmake new file mode 100644 index 00000000..59f18b40 --- /dev/null +++ b/util/cmake/dependencies.cmake @@ -0,0 +1,18 @@ +# Include the CMake modules +include(FetchContent) + +# Add the pre-installed libraries +find_package(OpenSSL REQUIRED) + +# Define the spdlog version +set(SPDLOG_VERSION "1.8.5") + +# Add spdlog +FetchContent_Declare( + spdlog + GIT_REPOSITORY https://github.com/gabime/spdlog + GIT_TAG v${SPDLOG_VERSION} +) + +# Make available +FetchContent_MakeAvailable(spdlog) diff --git a/core/utilities/Buffer.h b/util/core/utility/Buffer.h similarity index 97% rename from core/utilities/Buffer.h rename to util/core/utility/Buffer.h index 0d407602..c058423d 100644 --- a/core/utilities/Buffer.h +++ b/util/core/utility/Buffer.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #ifndef WOLKABOUTCORE_BUFFER_H #define WOLKABOUTCORE_BUFFER_H -#include "core/utilities/Logger.h" +#include "Logger.h" #include #include diff --git a/core/utilities/ByteUtils.cpp b/util/core/utility/ByteUtils.cpp similarity index 97% rename from core/utilities/ByteUtils.cpp rename to util/core/utility/ByteUtils.cpp index e6a2b109..f1ead08e 100644 --- a/core/utilities/ByteUtils.cpp +++ b/util/core/utility/ByteUtils.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "core/utilities/ByteUtils.h" +#include "ByteUtils.h" #include #include diff --git a/core/utilities/ByteUtils.h b/util/core/utility/ByteUtils.h similarity index 96% rename from core/utilities/ByteUtils.h rename to util/core/utility/ByteUtils.h index da6e5b2e..a0b56950 100644 --- a/core/utilities/ByteUtils.h +++ b/util/core/utility/ByteUtils.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/utilities/CommandBuffer.cpp b/util/core/utility/CommandBuffer.cpp similarity index 98% rename from core/utilities/CommandBuffer.cpp rename to util/core/utility/CommandBuffer.cpp index addf0c1d..c72da1ae 100644 --- a/core/utilities/CommandBuffer.cpp +++ b/util/core/utility/CommandBuffer.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/utilities/CommandBuffer.h b/util/core/utility/CommandBuffer.h similarity index 97% rename from core/utilities/CommandBuffer.h rename to util/core/utility/CommandBuffer.h index 77f5bc04..e996bd54 100644 --- a/core/utilities/CommandBuffer.h +++ b/util/core/utility/CommandBuffer.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/utilities/FileSystemUtils.cpp b/util/core/utility/FileSystemUtils.cpp similarity index 99% rename from core/utilities/FileSystemUtils.cpp rename to util/core/utility/FileSystemUtils.cpp index 9e78ae00..64ecb491 100644 --- a/core/utilities/FileSystemUtils.cpp +++ b/util/core/utility/FileSystemUtils.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/utilities/FileSystemUtils.h b/util/core/utility/FileSystemUtils.h similarity index 95% rename from core/utilities/FileSystemUtils.h rename to util/core/utility/FileSystemUtils.h index 574dba5c..e0d126f1 100644 --- a/core/utilities/FileSystemUtils.h +++ b/util/core/utility/FileSystemUtils.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #ifndef WOLKABOUTCORE_FILESYSTEMUTILS_H #define WOLKABOUTCORE_FILESYSTEMUTILS_H -#include "core/utilities/ByteUtils.h" +#include "ByteUtils.h" #include #include diff --git a/core/utilities/LogManager.cpp b/util/core/utility/LogManager.cpp similarity index 100% rename from core/utilities/LogManager.cpp rename to util/core/utility/LogManager.cpp diff --git a/core/utilities/LogManager.h b/util/core/utility/LogManager.h similarity index 97% rename from core/utilities/LogManager.h rename to util/core/utility/LogManager.h index 44882da9..0a0a632e 100644 --- a/core/utilities/LogManager.h +++ b/util/core/utility/LogManager.h @@ -5,8 +5,8 @@ #ifndef WOLKABOUTCORE_LOGMANAGER_H #define WOLKABOUTCORE_LOGMANAGER_H -#include "core/utilities/LogUploader.h" -#include "core/utilities/Timer.h" +#include "LogUploader.h" +#include "Timer.h" #include #include diff --git a/core/utilities/LogUploader.h b/util/core/utility/LogUploader.h similarity index 100% rename from core/utilities/LogUploader.h rename to util/core/utility/LogUploader.h diff --git a/core/utilities/Logger.cpp b/util/core/utility/Logger.cpp similarity index 95% rename from core/utilities/Logger.cpp rename to util/core/utility/Logger.cpp index 33d4828a..f680e4ec 100644 --- a/core/utilities/Logger.cpp +++ b/util/core/utility/Logger.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include #include -#include -#include -#include -#include -#include -#include +#include "spdlog/common.h" +#include "spdlog/details/file_helper.h" +#include "spdlog/sinks/daily_file_sink.h" +#include "spdlog/sinks/ringbuffer_sink.h" +#include "spdlog/sinks/stdout_sinks.h" +#include "spdlog/spdlog.h" namespace { diff --git a/core/utilities/Logger.h b/util/core/utility/Logger.h similarity index 98% rename from core/utilities/Logger.h rename to util/core/utility/Logger.h index 455fb69c..5c087036 100644 --- a/core/utilities/Logger.h +++ b/util/core/utility/Logger.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/utilities/Service.h b/util/core/utility/Service.h similarity index 100% rename from core/utilities/Service.h rename to util/core/utility/Service.h diff --git a/core/utilities/StringUtils.cpp b/util/core/utility/StringUtils.cpp similarity index 99% rename from core/utilities/StringUtils.cpp rename to util/core/utility/StringUtils.cpp index adf9f725..1cf2afbf 100644 --- a/core/utilities/StringUtils.cpp +++ b/util/core/utility/StringUtils.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/utilities/StringUtils.h b/util/core/utility/StringUtils.h similarity index 97% rename from core/utilities/StringUtils.h rename to util/core/utility/StringUtils.h index 71e83afd..8349c510 100644 --- a/core/utilities/StringUtils.h +++ b/util/core/utility/StringUtils.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #ifndef WOLKABOUTCORE_STRINGUTILS_H #define WOLKABOUTCORE_STRINGUTILS_H -#include "core/utilities/ByteUtils.h" +#include "ByteUtils.h" #include #include diff --git a/core/utilities/Timer.cpp b/util/core/utility/Timer.cpp similarity index 97% rename from core/utilities/Timer.cpp rename to util/core/utility/Timer.cpp index 62c4cd49..37b4268b 100644 --- a/core/utilities/Timer.cpp +++ b/util/core/utility/Timer.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/core/utilities/Timer.h b/util/core/utility/Timer.h similarity index 96% rename from core/utilities/Timer.h rename to util/core/utility/Timer.h index c04227d1..866619b8 100644 --- a/core/utilities/Timer.h +++ b/util/core/utility/Timer.h @@ -1,5 +1,5 @@ /** - * Copyright 2022 Wolkabout Technology s.r.o. + * Copyright 2023 Wolkabout Technology s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From bb061caa5bb8229f2f2730a97f9e050bf37d2d09 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Tue, 13 Jun 2023 10:00:00 +0200 Subject: [PATCH 02/20] Add the `-Wno-pedantic` for `nlohmann_json_schema_validator` target because AMD64/20.04 compiler fails --- connectivity/cmake/dependencies.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/cmake/dependencies.cmake b/connectivity/cmake/dependencies.cmake index ae151fa8..e0f67795 100644 --- a/connectivity/cmake/dependencies.cmake +++ b/connectivity/cmake/dependencies.cmake @@ -59,4 +59,4 @@ FetchContent_Declare( FetchContent_MakeAvailable(nlohmann_json json-schema) # Adjust the compile options for `nlohmann_json` to disable the shadow error -target_compile_options(nlohmann_json_schema_validator PRIVATE "-Wno-shadow") +target_compile_options(nlohmann_json_schema_validator PRIVATE "-Wno-shadow;-Wno-pedantic") From 310d479edaf4c2c7744bff309f617fa790a5b301 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Tue, 13 Jun 2023 13:52:57 +0200 Subject: [PATCH 03/20] Fixed up absolutely everything, even the tests --- CMakeLists.txt | 23 ------ aws/core/log_uploader/AwsLogUploader.cpp | 2 +- cmake/dependencies.cmake | 11 --- cmake/paths.cmake | 4 - connectivity/CMakeLists.txt | 11 ++- connectivity/cmake/dependencies.cmake | 19 ++--- .../OutboundRetryMessageHandler.cpp | 4 +- connectivity/tests/CMakeLists.txt | 82 ++++++++++++------- connectivity/tests/cmake/dependencies.cmake | 18 ++++ .../tests/{ => tests}/BufferTests.cpp | 4 +- .../tests/{ => tests}/ByteUtilsTests.cpp | 5 +- .../tests/{ => tests}/CommandBufferTests.cpp | 4 +- .../tests/{ => tests}/FileSystemUtils.cpp | 4 +- .../InboundPlatformMessageHandlerTests.cpp | 2 +- .../tests/{ => tests}/LogManagerTests.cpp | 4 +- .../tests/{ => tests}/LoggerTests.cpp | 2 +- .../tests/{ => tests}/ModelMessagesTests.cpp | 2 +- .../tests/{ => tests}/ModelsTests.cpp | 2 +- .../MqttConnectivityServiceTests.cpp | 2 +- .../OutboundRetryMessageHandlerTests.cpp | 2 +- .../tests/{ => tests}/PahoMqttClientTests.cpp | 2 +- .../tests/{ => tests}/StringUtilsTests.cpp | 4 +- connectivity/tests/{ => tests}/TimerTests.cpp | 4 +- connectivity/tests/{ => tests}/TypesTests.cpp | 4 +- .../WolkaboutDataProtocolTests.cpp | 2 +- .../WolkaboutErrorProtocolTests.cpp | 2 +- .../WolkaboutFileManagementProtocolTests.cpp | 2 +- .../WolkaboutFirmwareUpdateProtocolTests.cpp | 2 +- ...boutGatewayPlatformStatusProtocolTests.cpp | 2 +- ...kaboutGatewayRegistrationProtocolTests.cpp | 2 +- ...WolkaboutGatewaySubdeviceProtocolTests.cpp | 4 +- .../WolkaboutPlatformStatusProtocolTests.cpp | 2 +- .../WolkaboutRegistrationProtocolTests.cpp | 2 +- util/CMakeLists.txt | 2 +- util/cmake/dependencies.cmake | 1 + util/core/utility/Buffer.h | 2 +- util/core/utility/ByteUtils.cpp | 2 +- util/core/utility/CommandBuffer.cpp | 2 +- util/core/utility/FileSystemUtils.cpp | 4 +- util/core/utility/FileSystemUtils.h | 2 +- util/core/utility/LogManager.cpp | 10 +-- util/core/utility/LogManager.h | 4 +- util/core/utility/Logger.cpp | 12 +-- util/core/utility/StringUtils.cpp | 2 +- util/core/utility/StringUtils.h | 2 +- util/core/utility/Timer.cpp | 2 +- 46 files changed, 142 insertions(+), 146 deletions(-) delete mode 100644 cmake/dependencies.cmake create mode 100644 connectivity/tests/cmake/dependencies.cmake rename connectivity/tests/{ => tests}/BufferTests.cpp (93%) rename connectivity/tests/{ => tests}/ByteUtilsTests.cpp (96%) rename connectivity/tests/{ => tests}/CommandBufferTests.cpp (92%) rename connectivity/tests/{ => tests}/FileSystemUtils.cpp (98%) rename connectivity/tests/{ => tests}/InboundPlatformMessageHandlerTests.cpp (98%) rename connectivity/tests/{ => tests}/LogManagerTests.cpp (93%) rename connectivity/tests/{ => tests}/LoggerTests.cpp (97%) rename connectivity/tests/{ => tests}/ModelMessagesTests.cpp (99%) rename connectivity/tests/{ => tests}/ModelsTests.cpp (99%) rename connectivity/tests/{ => tests}/MqttConnectivityServiceTests.cpp (98%) rename connectivity/tests/{ => tests}/OutboundRetryMessageHandlerTests.cpp (99%) rename connectivity/tests/{ => tests}/PahoMqttClientTests.cpp (96%) rename connectivity/tests/{ => tests}/StringUtilsTests.cpp (97%) rename connectivity/tests/{ => tests}/TimerTests.cpp (98%) rename connectivity/tests/{ => tests}/TypesTests.cpp (99%) rename connectivity/tests/{ => tests}/WolkaboutDataProtocolTests.cpp (99%) rename connectivity/tests/{ => tests}/WolkaboutErrorProtocolTests.cpp (99%) rename connectivity/tests/{ => tests}/WolkaboutFileManagementProtocolTests.cpp (99%) rename connectivity/tests/{ => tests}/WolkaboutFirmwareUpdateProtocolTests.cpp (99%) rename connectivity/tests/{ => tests}/WolkaboutGatewayPlatformStatusProtocolTests.cpp (98%) rename connectivity/tests/{ => tests}/WolkaboutGatewayRegistrationProtocolTests.cpp (99%) rename connectivity/tests/{ => tests}/WolkaboutGatewaySubdeviceProtocolTests.cpp (99%) rename connectivity/tests/{ => tests}/WolkaboutPlatformStatusProtocolTests.cpp (99%) rename connectivity/tests/{ => tests}/WolkaboutRegistrationProtocolTests.cpp (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83fc2ca2..0d670d22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,10 +30,6 @@ set(UTIL_TARGET_NAME ${PROJECT_NAME}Util) set(AWS_LOG_UPLOADER_TARGET_NAME ${PROJECT_NAME}AwsLogUploader) set(CONNECTIVITY_TARGET_NAME ${PROJECT_NAME}) -# Define the installation components -set(REL_COMPONENT RELEASE) -set(DEV_COMPONENT DEV) - # Options for our library OPTION(BUILD_CONNECTIVITY "Build the library with Paho MQTT and allow MQTT connection to the platform." ON) OPTION(BUILD_POCO "Build the library with Poco." ON) @@ -55,9 +51,6 @@ include(cmake/paths.cmake) # Set up the C++ settings include(cmake/cxx-settings.cmake) -# Import dependencies -include(cmake/dependencies.cmake) - # Add the util library add_subdirectory(util) @@ -70,19 +63,3 @@ endif () if (${BUILD_CONNECTIVITY}) add_subdirectory(connectivity) endif () - -## Create the install rule -#install(DIRECTORY ${CMAKE_LIBRARY_INCLUDE_DIRECTORY} DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN *.h) -#install(DIRECTORY ${CMAKE_PREFIX_PATH}/include DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN *.h) -#install(DIRECTORY ${CMAKE_PREFIX_PATH}/lib DESTINATION ${CMAKE_INSTALL_PREFIX}) -#install(TARGETS ${INSTALL_TARGETS} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) -# -## Add the format rule -#file(GLOB_RECURSE ALL_FILES ${CMAKE_SOURCE_DIR}/**/*.cpp ${CMAKE_SOURCE_DIR}/**/*.hpp ${CMAKE_SOURCE_DIR}/**/*.h) -#list(FILTER ALL_FILES EXCLUDE REGEX "/out") -#list(FILTER ALL_FILES EXCLUDE REGEX "json.hpp") -#add_custom_target(format -# COMMAND "clang-format" -i -sort-includes -style=file ${ALL_FILES} -# WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" -# COMMENT "[Formatting source code]" -# VERBATIM) diff --git a/aws/core/log_uploader/AwsLogUploader.cpp b/aws/core/log_uploader/AwsLogUploader.cpp index dcf1d9eb..9c83a6fd 100644 --- a/aws/core/log_uploader/AwsLogUploader.cpp +++ b/aws/core/log_uploader/AwsLogUploader.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "AwsLogUploader.h" +#include "core/log_uploader/AwsLogUploader.h" #include "core/utilities/Logger.h" diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake deleted file mode 100644 index e358fc79..00000000 --- a/cmake/dependencies.cmake +++ /dev/null @@ -1,11 +0,0 @@ - -find_package(Threads REQUIRED) - -# Define the versions -set(PAHO_MQTT_C_VERSION "1.3.8") -set(PAHO_MQTT_CPP_VERSION "1.2.0") -set(GTEST_VERSION "1.10.0") -set(POCO_VERSION "1.10.1") -set(AWS_SDK_VERSION "1.8.173") -set(NLOHMANN_JSON_VERSION "3.7.3") -set(JSON_SCHEMA_VERSION "2.1.0") diff --git a/cmake/paths.cmake b/cmake/paths.cmake index 75382eb1..cf824979 100644 --- a/cmake/paths.cmake +++ b/cmake/paths.cmake @@ -10,7 +10,3 @@ endif () if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") endif () - -if (NOT DEFINED CMAKE_PREFIX_PATH) - set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}/build") -endif () diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index 32ea7d6a..cee5b72a 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -9,7 +9,7 @@ add_library(${CONNECTIVITY_TARGET_NAME}) add_library(${NAMESPACE}::${CONNECTIVITY_TARGET_NAME} ALIAS ${CONNECTIVITY_TARGET_NAME}) # Link the libraries -target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_PREFIX_PATH}/lib) +target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_BINARY_DIR}/lib) target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE ${UTIL_TARGET_NAME} paho-mqttpp3 paho-mqtt3as nlohmann_json_schema_validator) # Add the dependency @@ -177,7 +177,7 @@ target_include_directories(${CONNECTIVITY_TARGET_NAME} # Add the system private include directories target_include_directories(${CONNECTIVITY_TARGET_NAME} SYSTEM PRIVATE - ${CMAKE_PREFIX_PATH}/include) + ${CMAKE_BINARY_DIR}/include) # Add the public include directories target_include_directories(${CONNECTIVITY_TARGET_NAME} @@ -186,7 +186,6 @@ target_include_directories(${CONNECTIVITY_TARGET_NAME} $) # Include tests if the options is enabled -# TODO Uncomment -#if (${BUILD_TESTS}) -# add_subdirectory(tests) -#endif () +if (${BUILD_TESTS}) + add_subdirectory(tests) +endif () diff --git a/connectivity/cmake/dependencies.cmake b/connectivity/cmake/dependencies.cmake index e0f67795..c2e80944 100644 --- a/connectivity/cmake/dependencies.cmake +++ b/connectivity/cmake/dependencies.cmake @@ -8,11 +8,6 @@ set(PAHO_MQTT_CPP_VERSION "1.2.0") set(NLOHMANN_JSON_VERSION "3.7.3") set(JSON_SCHEMA_VERSION "2.1.0") -# Set the PahoMQTT flags -SET(PAHO_WITH_SSL TRUE CACHE BOOL "Flag that defines whether to build ssl-enabled binaries too. ") -SET(PAHO_ENABLE_TESTING FALSE CACHE BOOL "Build tests and run") -SET(PAHO_ENABLE_CPACK FALSE CACHE BOOL "Enable CPack") - # Include PahoMQTT for both C and C++ ExternalProject_Add(pahomqttc GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.c" @@ -22,20 +17,20 @@ ExternalProject_Add(pahomqttc -DPAHO_WITH_SSL=TRUE -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DARP_TOOLCHAIN_ROOT=${ARP_TOOLCHAIN_ROOT} - -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} - -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} + -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} ) ExternalProject_Add(pahomqttcpp GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.cpp" GIT_TAG "v${PAHO_MQTT_CPP_VERSION}" UPDATE_COMMAND "" - CMAKE_ARGS -DPAHO_WITH_SSL=TRUE - -DPAHO_MQTT_C_INCLUDE_DIRS=${CMAKE_PREFIX_PATH}/include + CMAKE_ARGS + -DPAHO_WITH_SSL=TRUE + -DPAHO_MQTT_C_INCLUDE_DIRS=${CMAKE_BINARY_DIR}/include -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DARP_TOOLCHAIN_ROOT=${ARP_TOOLCHAIN_ROOT} - -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} - -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} + -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR} + -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} DEPENDS pahomqttc ) @@ -58,5 +53,5 @@ FetchContent_Declare( # Make everything available FetchContent_MakeAvailable(nlohmann_json json-schema) -# Adjust the compile options for `nlohmann_json` to disable the shadow error +# Adjust the compile options for `nlohmann_json` to disable the shadow and pedantic target_compile_options(nlohmann_json_schema_validator PRIVATE "-Wno-shadow;-Wno-pedantic") diff --git a/connectivity/core/connectivity/OutboundRetryMessageHandler.cpp b/connectivity/core/connectivity/OutboundRetryMessageHandler.cpp index 6f806158..2a6ce6da 100644 --- a/connectivity/core/connectivity/OutboundRetryMessageHandler.cpp +++ b/connectivity/core/connectivity/OutboundRetryMessageHandler.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "OutboundRetryMessageHandler.h" +#include "core/connectivity/OutboundRetryMessageHandler.h" -#include "OutboundMessageHandler.h" +#include "core/connectivity/OutboundMessageHandler.h" #include "core/model/Message.h" #include "core/utility/Logger.h" #include "core/utility/StringUtils.h" diff --git a/connectivity/tests/CMakeLists.txt b/connectivity/tests/CMakeLists.txt index c824269f..5adbf7f9 100644 --- a/connectivity/tests/CMakeLists.txt +++ b/connectivity/tests/CMakeLists.txt @@ -1,4 +1,23 @@ -set(TESTS_SOURCE_FILES ${TESTS_SOURCE_FILES} +# Place the sub-folder this target is placed into a variable +set(SUBDIRECTORY_PATH connectivity/tests) + +# Enable testing +enable_testing() + +# Include the dependencies +include(cmake/dependencies.cmake) + +# Create the target +add_executable(${PROJECT_NAME}Tests) + +# Link the libraries +target_link_libraries(${PROJECT_NAME}Tests ${CONNECTIVITY_TARGET_NAME} ${UTIL_TARGET_NAME} gtest gmock gtest_main) + +# Set some target properties +set_target_properties(${PROJECT_NAME}Tests PROPERTIES OUTPUT_NAME "${NAMESPACE}${PROJECT_NAME}Tests") +set_target_properties(${PROJECT_NAME}Tests PROPERTIES INSTALL_RPATH "$ORIGIN/../lib") + +target_sources(${PROJECT_NAME}Tests PRIVATE tests/BufferTests.cpp tests/ByteUtilsTests.cpp tests/CommandBufferTests.cpp @@ -23,35 +42,36 @@ set(TESTS_SOURCE_FILES ${TESTS_SOURCE_FILES} tests/WolkaboutGatewaySubdeviceProtocolTests.cpp tests/WolkaboutPlatformStatusProtocolTests.cpp tests/WolkaboutRegistrationProtocolTests.cpp) -set(TESTS_HEADER_FILES ${TESTS_HEADER_FILES} - tests/mocks/ConnectivityServiceMock.h - tests/mocks/DataProtocolMock.h - tests/mocks/ErrorProtocolMock.h - tests/mocks/FileManagementProtocolMock.h - tests/mocks/FirmwareUpdateProtocolMock.h - tests/mocks/GatewayPlatformStatusProtocolMock.h - tests/mocks/GatewayRegistrationProtocolMock.h - tests/mocks/GatewaySubdeviceProtocolMock.h - tests/mocks/InboundMessageHandlerMock.h - tests/mocks/MessageListenerMock.h - tests/mocks/MessagePersistenceMock.h - tests/mocks/OutboundMessageHandlerMock.h - tests/mocks/OutboundRetryMessageHandlerMock.h - tests/mocks/PahoMqttClientMock.h - tests/mocks/PersistenceMock.h - tests/mocks/PlatformStatusProtocolMock.h - tests/mocks/ProtocolMock.h - tests/mocks/RegistrationProtocolMock.h) - -list(APPEND INSTALL_TARGETS ${PROJECT_NAME}) - -add_executable(${PROJECT_NAME}Tests ${TESTS_SOURCE_FILES} ${TESTS_HEADER_FILES}) -target_link_libraries(${PROJECT_NAME}Tests ${PROJECT_NAME} gtest gmock gtest_main Threads::Threads) -target_include_directories(${PROJECT_NAME}Tests PRIVATE ${PROJECT_SOURCE_DIR}) -target_include_directories(${PROJECT_NAME}Tests SYSTEM PRIVATE ${CMAKE_PREFIX_PATH}/include) -target_include_directories(${PROJECT_NAME}Tests PUBLIC $ $) -set_target_properties(${PROJECT_NAME}Tests PROPERTIES INSTALL_RPATH "$ORIGIN/../lib") -add_dependencies(${PROJECT_NAME}Tests libgtest) -enable_testing() +target_sources(${PROJECT_NAME}Tests PRIVATE + mocks/ConnectivityServiceMock.h + mocks/DataProtocolMock.h + mocks/ErrorProtocolMock.h + mocks/FileManagementProtocolMock.h + mocks/FirmwareUpdateProtocolMock.h + mocks/GatewayPlatformStatusProtocolMock.h + mocks/GatewayRegistrationProtocolMock.h + mocks/GatewaySubdeviceProtocolMock.h + mocks/InboundMessageHandlerMock.h + mocks/MessageListenerMock.h + mocks/MessagePersistenceMock.h + mocks/OutboundMessageHandlerMock.h + mocks/OutboundRetryMessageHandlerMock.h + mocks/PahoMqttClientMock.h + mocks/PersistenceMock.h + mocks/PlatformStatusProtocolMock.h + mocks/ProtocolMock.h + mocks/RegistrationProtocolMock.h) + +# Add the private include directories +target_include_directories(${PROJECT_NAME}Tests + PRIVATE + ${PROJECT_SOURCE_DIR}/${SUBDIRECTORY_PATH}) + +# Add the system private include directories +target_include_directories(${PROJECT_NAME}Tests + SYSTEM PRIVATE + ${CMAKE_BINARY_DIR}/include) + +# Add it to CTest add_test(NAME "WolkSDK-Cpp_Tests" COMMAND ${PROJECT_NAME}Tests) diff --git a/connectivity/tests/cmake/dependencies.cmake b/connectivity/tests/cmake/dependencies.cmake new file mode 100644 index 00000000..29a21143 --- /dev/null +++ b/connectivity/tests/cmake/dependencies.cmake @@ -0,0 +1,18 @@ +# Include the CMake modules +include(FetchContent) + +# Define the gtest/gmock version +set(GTEST_VERSION "1.10.0") + +# Add gtest/gmock +FetchContent_Declare( + libgtest + GIT_REPOSITORY https://github.com/google/googletest + GIT_TAG release-${GTEST_VERSION} +) + +# Make available +FetchContent_MakeAvailable(libgtest) + +# Adjust the compile options for `nlohmann_json` to disable the compilation errors with our flags +target_compile_options(gtest PRIVATE "-Wno-error=maybe-uninitialized;-Wno-error=suggest-attribute=noreturn") diff --git a/connectivity/tests/BufferTests.cpp b/connectivity/tests/tests/BufferTests.cpp similarity index 93% rename from connectivity/tests/BufferTests.cpp rename to connectivity/tests/tests/BufferTests.cpp index cf3bfb2f..1ece2b4c 100644 --- a/connectivity/tests/BufferTests.cpp +++ b/connectivity/tests/tests/BufferTests.cpp @@ -19,11 +19,11 @@ #define private public #define protected public -#include "core/utilities/Buffer.h" +#include "core/utility/Buffer.h" #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/ByteUtilsTests.cpp b/connectivity/tests/tests/ByteUtilsTests.cpp similarity index 96% rename from connectivity/tests/ByteUtilsTests.cpp rename to connectivity/tests/tests/ByteUtilsTests.cpp index 2a60950c..a600388c 100644 --- a/connectivity/tests/ByteUtilsTests.cpp +++ b/connectivity/tests/tests/ByteUtilsTests.cpp @@ -19,11 +19,12 @@ #define private public #define protected public -#include "core/utilities/ByteUtils.h" +#include "core/utility/ByteUtils.h" +#include "core/utility/ByteUtils.h" #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/CommandBufferTests.cpp b/connectivity/tests/tests/CommandBufferTests.cpp similarity index 92% rename from connectivity/tests/CommandBufferTests.cpp rename to connectivity/tests/tests/CommandBufferTests.cpp index fab097b1..d535e3b0 100644 --- a/connectivity/tests/CommandBufferTests.cpp +++ b/connectivity/tests/tests/CommandBufferTests.cpp @@ -19,11 +19,11 @@ #define private public #define protected public -#include "core/utilities/CommandBuffer.h" +#include "core/utility/CommandBuffer.h" #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/FileSystemUtils.cpp b/connectivity/tests/tests/FileSystemUtils.cpp similarity index 98% rename from connectivity/tests/FileSystemUtils.cpp rename to connectivity/tests/tests/FileSystemUtils.cpp index baf2cb07..0ad9c383 100644 --- a/connectivity/tests/FileSystemUtils.cpp +++ b/connectivity/tests/tests/FileSystemUtils.cpp @@ -19,11 +19,11 @@ #define private public #define protected public -#include "core/utilities/FileSystemUtils.h" +#include "core/utility/FileSystemUtils.h" #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/InboundPlatformMessageHandlerTests.cpp b/connectivity/tests/tests/InboundPlatformMessageHandlerTests.cpp similarity index 98% rename from connectivity/tests/InboundPlatformMessageHandlerTests.cpp rename to connectivity/tests/tests/InboundPlatformMessageHandlerTests.cpp index 280c061c..09437b09 100644 --- a/connectivity/tests/InboundPlatformMessageHandlerTests.cpp +++ b/connectivity/tests/tests/InboundPlatformMessageHandlerTests.cpp @@ -23,7 +23,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include "tests/mocks/MessageListenerMock.h" #include "tests/mocks/ProtocolMock.h" diff --git a/connectivity/tests/LogManagerTests.cpp b/connectivity/tests/tests/LogManagerTests.cpp similarity index 93% rename from connectivity/tests/LogManagerTests.cpp rename to connectivity/tests/tests/LogManagerTests.cpp index e5420176..05bb248a 100644 --- a/connectivity/tests/LogManagerTests.cpp +++ b/connectivity/tests/tests/LogManagerTests.cpp @@ -19,11 +19,11 @@ #define private public #define protected public -#include "core/utilities/LogManager.h" +#include "core/utility/LogManager.h" #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/LoggerTests.cpp b/connectivity/tests/tests/LoggerTests.cpp similarity index 97% rename from connectivity/tests/LoggerTests.cpp rename to connectivity/tests/tests/LoggerTests.cpp index bc8db105..00b22030 100644 --- a/connectivity/tests/LoggerTests.cpp +++ b/connectivity/tests/tests/LoggerTests.cpp @@ -19,7 +19,7 @@ #define private public #define protected public -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #undef private #undef protected diff --git a/connectivity/tests/ModelMessagesTests.cpp b/connectivity/tests/tests/ModelMessagesTests.cpp similarity index 99% rename from connectivity/tests/ModelMessagesTests.cpp rename to connectivity/tests/tests/ModelMessagesTests.cpp index b377dbf8..d6cd24d4 100644 --- a/connectivity/tests/ModelMessagesTests.cpp +++ b/connectivity/tests/tests/ModelMessagesTests.cpp @@ -57,7 +57,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/ModelsTests.cpp b/connectivity/tests/tests/ModelsTests.cpp similarity index 99% rename from connectivity/tests/ModelsTests.cpp rename to connectivity/tests/tests/ModelsTests.cpp index a3f13e33..059a777d 100644 --- a/connectivity/tests/ModelsTests.cpp +++ b/connectivity/tests/tests/ModelsTests.cpp @@ -27,7 +27,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/MqttConnectivityServiceTests.cpp b/connectivity/tests/tests/MqttConnectivityServiceTests.cpp similarity index 98% rename from connectivity/tests/MqttConnectivityServiceTests.cpp rename to connectivity/tests/tests/MqttConnectivityServiceTests.cpp index 3ee8d81c..d8a43123 100644 --- a/connectivity/tests/MqttConnectivityServiceTests.cpp +++ b/connectivity/tests/tests/MqttConnectivityServiceTests.cpp @@ -23,7 +23,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include "tests/mocks/MessagePersistenceMock.h" #include "tests/mocks/PahoMqttClientMock.h" diff --git a/connectivity/tests/OutboundRetryMessageHandlerTests.cpp b/connectivity/tests/tests/OutboundRetryMessageHandlerTests.cpp similarity index 99% rename from connectivity/tests/OutboundRetryMessageHandlerTests.cpp rename to connectivity/tests/tests/OutboundRetryMessageHandlerTests.cpp index 3cb37da4..f43630b6 100644 --- a/connectivity/tests/OutboundRetryMessageHandlerTests.cpp +++ b/connectivity/tests/tests/OutboundRetryMessageHandlerTests.cpp @@ -23,7 +23,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include "tests/mocks/OutboundMessageHandlerMock.h" #include diff --git a/connectivity/tests/PahoMqttClientTests.cpp b/connectivity/tests/tests/PahoMqttClientTests.cpp similarity index 96% rename from connectivity/tests/PahoMqttClientTests.cpp rename to connectivity/tests/tests/PahoMqttClientTests.cpp index 5a0dfe09..038e1a90 100644 --- a/connectivity/tests/PahoMqttClientTests.cpp +++ b/connectivity/tests/tests/PahoMqttClientTests.cpp @@ -23,7 +23,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/StringUtilsTests.cpp b/connectivity/tests/tests/StringUtilsTests.cpp similarity index 97% rename from connectivity/tests/StringUtilsTests.cpp rename to connectivity/tests/tests/StringUtilsTests.cpp index 341b1e23..99f41ccf 100644 --- a/connectivity/tests/StringUtilsTests.cpp +++ b/connectivity/tests/tests/StringUtilsTests.cpp @@ -19,11 +19,11 @@ #define private public #define protected public -#include "core/utilities/StringUtils.h" +#include "core/utility/StringUtils.h" #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/TimerTests.cpp b/connectivity/tests/tests/TimerTests.cpp similarity index 98% rename from connectivity/tests/TimerTests.cpp rename to connectivity/tests/tests/TimerTests.cpp index 64e17f0d..9c280408 100644 --- a/connectivity/tests/TimerTests.cpp +++ b/connectivity/tests/tests/TimerTests.cpp @@ -19,11 +19,11 @@ #define private public #define protected public -#include "core/utilities/Timer.h" +#include "core/utility/Timer.h" #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/TypesTests.cpp b/connectivity/tests/tests/TypesTests.cpp similarity index 99% rename from connectivity/tests/TypesTests.cpp rename to connectivity/tests/tests/TypesTests.cpp index 82daea20..40a79162 100644 --- a/connectivity/tests/TypesTests.cpp +++ b/connectivity/tests/tests/TypesTests.cpp @@ -19,11 +19,11 @@ #define private public #define protected public -#include "core/utility/Types.h" +#include "core/Types.h" #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/WolkaboutDataProtocolTests.cpp b/connectivity/tests/tests/WolkaboutDataProtocolTests.cpp similarity index 99% rename from connectivity/tests/WolkaboutDataProtocolTests.cpp rename to connectivity/tests/tests/WolkaboutDataProtocolTests.cpp index 38754c2a..3a4117ec 100644 --- a/connectivity/tests/WolkaboutDataProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutDataProtocolTests.cpp @@ -21,7 +21,7 @@ #undef protected #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/WolkaboutErrorProtocolTests.cpp b/connectivity/tests/tests/WolkaboutErrorProtocolTests.cpp similarity index 99% rename from connectivity/tests/WolkaboutErrorProtocolTests.cpp rename to connectivity/tests/tests/WolkaboutErrorProtocolTests.cpp index 6ac73d07..fcdc124f 100644 --- a/connectivity/tests/WolkaboutErrorProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutErrorProtocolTests.cpp @@ -23,7 +23,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/WolkaboutFileManagementProtocolTests.cpp b/connectivity/tests/tests/WolkaboutFileManagementProtocolTests.cpp similarity index 99% rename from connectivity/tests/WolkaboutFileManagementProtocolTests.cpp rename to connectivity/tests/tests/WolkaboutFileManagementProtocolTests.cpp index c68539b0..039c06f5 100644 --- a/connectivity/tests/WolkaboutFileManagementProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutFileManagementProtocolTests.cpp @@ -21,7 +21,7 @@ #undef protected #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/WolkaboutFirmwareUpdateProtocolTests.cpp b/connectivity/tests/tests/WolkaboutFirmwareUpdateProtocolTests.cpp similarity index 99% rename from connectivity/tests/WolkaboutFirmwareUpdateProtocolTests.cpp rename to connectivity/tests/tests/WolkaboutFirmwareUpdateProtocolTests.cpp index 68541b3f..9086dbf7 100644 --- a/connectivity/tests/WolkaboutFirmwareUpdateProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutFirmwareUpdateProtocolTests.cpp @@ -21,7 +21,7 @@ #undef protected #include "core/protocol/wolkabout/WolkaboutProtocol.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp b/connectivity/tests/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp similarity index 98% rename from connectivity/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp rename to connectivity/tests/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp index 9a8c53c3..823414af 100644 --- a/connectivity/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutGatewayPlatformStatusProtocolTests.cpp @@ -23,7 +23,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/WolkaboutGatewayRegistrationProtocolTests.cpp b/connectivity/tests/tests/WolkaboutGatewayRegistrationProtocolTests.cpp similarity index 99% rename from connectivity/tests/WolkaboutGatewayRegistrationProtocolTests.cpp rename to connectivity/tests/tests/WolkaboutGatewayRegistrationProtocolTests.cpp index 1e910c01..f5933890 100644 --- a/connectivity/tests/WolkaboutGatewayRegistrationProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutGatewayRegistrationProtocolTests.cpp @@ -23,7 +23,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp b/connectivity/tests/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp similarity index 99% rename from connectivity/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp rename to connectivity/tests/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp index 6dcc38c3..37e35092 100644 --- a/connectivity/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutGatewaySubdeviceProtocolTests.cpp @@ -28,8 +28,8 @@ #include "core/protocol/wolkabout/WolkaboutDataProtocol.h" #include "core/protocol/wolkabout/WolkaboutProtocol.h" #include "core/protocol/wolkabout/WolkaboutRegistrationProtocol.h" -#include "core/utilities/Logger.h" -#include "core/utilities/StringUtils.h" +#include "core/utility/Logger.h" +#include "core/utility/StringUtils.h" #include diff --git a/connectivity/tests/WolkaboutPlatformStatusProtocolTests.cpp b/connectivity/tests/tests/WolkaboutPlatformStatusProtocolTests.cpp similarity index 99% rename from connectivity/tests/WolkaboutPlatformStatusProtocolTests.cpp rename to connectivity/tests/tests/WolkaboutPlatformStatusProtocolTests.cpp index db6992d3..b9b94a05 100644 --- a/connectivity/tests/WolkaboutPlatformStatusProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutPlatformStatusProtocolTests.cpp @@ -23,7 +23,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/connectivity/tests/WolkaboutRegistrationProtocolTests.cpp b/connectivity/tests/tests/WolkaboutRegistrationProtocolTests.cpp similarity index 99% rename from connectivity/tests/WolkaboutRegistrationProtocolTests.cpp rename to connectivity/tests/tests/WolkaboutRegistrationProtocolTests.cpp index 4cfcf6b7..c5b48cf1 100644 --- a/connectivity/tests/WolkaboutRegistrationProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutRegistrationProtocolTests.cpp @@ -23,7 +23,7 @@ #undef private #undef protected -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index bea90793..8ac97ca5 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -9,7 +9,7 @@ add_library(${UTIL_TARGET_NAME}) add_library(${NAMESPACE}::${UTIL_TARGET_NAME} ALIAS ${UTIL_TARGET_NAME}) # Link the libraries -target_link_libraries(${UTIL_TARGET_NAME} PRIVATE OpenSSL::Crypto spdlog::spdlog) +target_link_libraries(${UTIL_TARGET_NAME} PRIVATE OpenSSL::Crypto spdlog::spdlog Threads::Threads) # Set some target properties set_target_properties(${UTIL_TARGET_NAME} PROPERTIES OUTPUT_NAME "${NAMESPACE}${UTIL_TARGET_NAME}") diff --git a/util/cmake/dependencies.cmake b/util/cmake/dependencies.cmake index 59f18b40..f9088604 100644 --- a/util/cmake/dependencies.cmake +++ b/util/cmake/dependencies.cmake @@ -3,6 +3,7 @@ include(FetchContent) # Add the pre-installed libraries find_package(OpenSSL REQUIRED) +find_package(Threads REQUIRED) # Define the spdlog version set(SPDLOG_VERSION "1.8.5") diff --git a/util/core/utility/Buffer.h b/util/core/utility/Buffer.h index c058423d..ad6ff808 100644 --- a/util/core/utility/Buffer.h +++ b/util/core/utility/Buffer.h @@ -17,7 +17,7 @@ #ifndef WOLKABOUTCORE_BUFFER_H #define WOLKABOUTCORE_BUFFER_H -#include "Logger.h" +#include "core/utility/Logger.h" #include #include diff --git a/util/core/utility/ByteUtils.cpp b/util/core/utility/ByteUtils.cpp index f1ead08e..f2cf9879 100644 --- a/util/core/utility/ByteUtils.cpp +++ b/util/core/utility/ByteUtils.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "ByteUtils.h" +#include "core/utility/ByteUtils.h" #include #include diff --git a/util/core/utility/CommandBuffer.cpp b/util/core/utility/CommandBuffer.cpp index c72da1ae..abd51ee9 100644 --- a/util/core/utility/CommandBuffer.cpp +++ b/util/core/utility/CommandBuffer.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "CommandBuffer.h" +#include "core/utility/CommandBuffer.h" #include #include diff --git a/util/core/utility/FileSystemUtils.cpp b/util/core/utility/FileSystemUtils.cpp index 64ecb491..85161d63 100644 --- a/util/core/utility/FileSystemUtils.cpp +++ b/util/core/utility/FileSystemUtils.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "FileSystemUtils.h" +#include "core/utility/FileSystemUtils.h" -#include "Logger.h" +#include "core/utility/Logger.h" #include #include diff --git a/util/core/utility/FileSystemUtils.h b/util/core/utility/FileSystemUtils.h index e0d126f1..4283e1ea 100644 --- a/util/core/utility/FileSystemUtils.h +++ b/util/core/utility/FileSystemUtils.h @@ -17,7 +17,7 @@ #ifndef WOLKABOUTCORE_FILESYSTEMUTILS_H #define WOLKABOUTCORE_FILESYSTEMUTILS_H -#include "ByteUtils.h" +#include "core/utility/ByteUtils.h" #include #include diff --git a/util/core/utility/LogManager.cpp b/util/core/utility/LogManager.cpp index 87d9adf9..d985d8ca 100644 --- a/util/core/utility/LogManager.cpp +++ b/util/core/utility/LogManager.cpp @@ -2,12 +2,12 @@ * Copyright (c) 2022 Wolkabout. */ -#include "LogManager.h" +#include "core/utility/LogManager.h" -#include "FileSystemUtils.h" -#include "Logger.h" -#include "StringUtils.h" -#include "Timer.h" +#include "core/utility/FileSystemUtils.h" +#include "core/utility/Logger.h" +#include "core/utility/StringUtils.h" +#include "core/utility/Timer.h" #include #include diff --git a/util/core/utility/LogManager.h b/util/core/utility/LogManager.h index 0a0a632e..7dcc5328 100644 --- a/util/core/utility/LogManager.h +++ b/util/core/utility/LogManager.h @@ -5,8 +5,8 @@ #ifndef WOLKABOUTCORE_LOGMANAGER_H #define WOLKABOUTCORE_LOGMANAGER_H -#include "LogUploader.h" -#include "Timer.h" +#include "core/utility/LogUploader.h" +#include "core/utility/Timer.h" #include #include diff --git a/util/core/utility/Logger.cpp b/util/core/utility/Logger.cpp index f680e4ec..0434a900 100644 --- a/util/core/utility/Logger.cpp +++ b/util/core/utility/Logger.cpp @@ -18,12 +18,12 @@ #include #include -#include "spdlog/common.h" -#include "spdlog/details/file_helper.h" -#include "spdlog/sinks/daily_file_sink.h" -#include "spdlog/sinks/ringbuffer_sink.h" -#include "spdlog/sinks/stdout_sinks.h" -#include "spdlog/spdlog.h" +#include +#include +#include +#include +#include +#include namespace { diff --git a/util/core/utility/StringUtils.cpp b/util/core/utility/StringUtils.cpp index 1cf2afbf..b3107ec1 100644 --- a/util/core/utility/StringUtils.cpp +++ b/util/core/utility/StringUtils.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "StringUtils.h" +#include "core/utility/StringUtils.h" #include #include diff --git a/util/core/utility/StringUtils.h b/util/core/utility/StringUtils.h index 8349c510..4f2b6174 100644 --- a/util/core/utility/StringUtils.h +++ b/util/core/utility/StringUtils.h @@ -17,7 +17,7 @@ #ifndef WOLKABOUTCORE_STRINGUTILS_H #define WOLKABOUTCORE_STRINGUTILS_H -#include "ByteUtils.h" +#include "core/utility/ByteUtils.h" #include #include diff --git a/util/core/utility/Timer.cpp b/util/core/utility/Timer.cpp index 37b4268b..494943e2 100644 --- a/util/core/utility/Timer.cpp +++ b/util/core/utility/Timer.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Timer.h" +#include "core/utility/Timer.h" namespace wolkabout::legacy { From 64c2b43829de3acfe4ddbced33c117236d99cbdc Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Tue, 13 Jun 2023 15:45:56 +0200 Subject: [PATCH 04/20] Figured out the entire install target too --- CMakeLists.txt | 14 +- aws/CMakeLists.txt | 7 +- cmake/Config.cmake.in | 8 ++ cmake/install.cmake | 123 ++++++++++++++++++ configure.sh | 4 - connectivity/CMakeLists.txt | 7 +- connectivity/cmake/dependencies.cmake | 10 ++ .../WolkaboutFileManagementProtocolTests.cpp | 2 +- .../WolkaboutFirmwareUpdateProtocolTests.cpp | 2 +- tools/git/pre-commit | 42 ------ util/CMakeLists.txt | 7 +- util/core/utility/LogManager.cpp | 14 +- util/core/utility/LogManager.h | 14 +- util/core/utility/LogUploader.h | 15 ++- 14 files changed, 200 insertions(+), 69 deletions(-) create mode 100644 cmake/Config.cmake.in create mode 100644 cmake/install.cmake delete mode 100644 tools/git/pre-commit diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d670d22..87101e17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,13 +22,15 @@ set(PROJECT_VERSION_SUFFIX) set(NAMESPACE Wolkabout) set(EMAIL elab@wolkabout.com) set(REPO_LINK https://github.com/Wolkabout/WolkUtil-CXX) -set(SOURCE_PREFIX_FOLDER connectivity/core) -set(SOURCE_ROOT_FOLDER wolkabout) +set(SOURCE_ROOT_FOLDER core) # Define the names for all modules set(UTIL_TARGET_NAME ${PROJECT_NAME}Util) +set(UTIL_SUBDIRECTORY_PATH util) set(AWS_LOG_UPLOADER_TARGET_NAME ${PROJECT_NAME}AwsLogUploader) +set(AWS_LOG_UPLOADER_SUBDIRECTORY_PATH aws) set(CONNECTIVITY_TARGET_NAME ${PROJECT_NAME}) +set(CONNECTIVITY_SUBDIRECTORY_PATH connectivity) # Options for our library OPTION(BUILD_CONNECTIVITY "Build the library with Paho MQTT and allow MQTT connection to the platform." ON) @@ -36,6 +38,7 @@ OPTION(BUILD_POCO "Build the library with Poco." ON) OPTION(BUILD_GTEST "Build the library with GTest." ON) OPTION(BUILD_AWS_LOG_UPLOADER "Build the library with AwsLogUploader." OFF) OPTION(BUILD_TESTS "Build the unit tests" ON) +OPTION(INSTALL_TARGET "Add the installation target for the project." ON) # Check the GTEST and TESTS option if (NOT ${BUILD_GTEST} AND ${BUILD_TESTS}) @@ -59,7 +62,12 @@ if (${BUILD_AWS_LOG_UPLOADER}) add_subdirectory(aws) endif () -## If Connectivity should be built +# If Connectivity should be built if (${BUILD_CONNECTIVITY}) add_subdirectory(connectivity) endif () + +# If install should be included +if (${INSTALL_TARGET}) + include(cmake/install.cmake) +endif () diff --git a/aws/CMakeLists.txt b/aws/CMakeLists.txt index 991988c5..98c72b42 100644 --- a/aws/CMakeLists.txt +++ b/aws/CMakeLists.txt @@ -1,6 +1,3 @@ -# Place the sub-folder this target is placed into a variable -set(SUBDIRECTORY_PATH aws) - # Include the util dependencies include(cmake/dependencies.cmake) @@ -26,10 +23,10 @@ target_sources(${AWS_LOG_UPLOADER_TARGET_NAME} PRIVATE core/log_uploader/AwsLogU # Add the private include directories target_include_directories(${AWS_LOG_UPLOADER_TARGET_NAME} PRIVATE - ${PROJECT_SOURCE_DIR}/${SUBDIRECTORY_PATH}) + ${PROJECT_SOURCE_DIR}/${AWS_LOG_UPLOADER_SUBDIRECTORY_PATH}) # Add the public include directories target_include_directories(${AWS_LOG_UPLOADER_TARGET_NAME} PUBLIC - $ + $ $) diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in new file mode 100644 index 00000000..53797ba4 --- /dev/null +++ b/cmake/Config.cmake.in @@ -0,0 +1,8 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@NAMESPACE@@PROJECT_NAME@Targets.cmake") + +check_required_components(@NAMESPACE@@PROJECT_NAME@) + +find_package(OpenSSL REQUIRED) +find_package(Threads REQUIRED) diff --git a/cmake/install.cmake b/cmake/install.cmake new file mode 100644 index 00000000..b4e46680 --- /dev/null +++ b/cmake/install.cmake @@ -0,0 +1,123 @@ +# Import the required modules +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) + +# Define the destination for public headers +set(PUBLIC_HEADERS_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SOURCE_ROOT_FOLDER}) +string(TOLOWER ${PUBLIC_HEADERS_DESTINATION} PUBLIC_HEADERS_DESTINATION) + +# Define the component names +set(REL_COMPONENT RELEASE) +set(DEV_COMPONENT DEV) + +# Define the targets lists +set(TARGETS_LIST ${UTIL_TARGET_NAME} ${AWS_LOG_UPLOADER_TARGET_NAME} ${CONNECTIVITY_TARGET_NAME}) +set(TARGETS_DIRECTORIES ${UTIL_SUBDIRECTORY_PATH} ${AWS_LOG_UPLOADER_SUBDIRECTORY_PATH} ${CONNECTIVITY_SUBDIRECTORY_PATH}) + +# Go through the targets +list(LENGTH TARGETS_LIST TARGETS_LENGTH) +math(EXPR TARGETS_LENGTH ${TARGETS_LENGTH}-1) +foreach (INDEX RANGE ${TARGETS_LENGTH}) + list(GET TARGETS_LIST ${INDEX} TARGET) + list(GET TARGETS_DIRECTORIES ${INDEX} TARGET_DIRECTORY) + + if (NOT TARGET "${TARGET}") + continue() + endif () + + # Create the install rule for the main target + # install(TARGETS ${TARGET} + # EXPORT ${PROJECT_NAME}Targets + # LIBRARY + # COMPONENT ${REL_COMPONENT} + # NAMELINK_SKIP + # PUBLIC_HEADER + # DESTINATION ${PUBLIC_HEADERS_DESTINATION} + # INCLUDES DESTINATION ${PUBLIC_HEADERS_DESTINATION}) + + # Install all the header files + get_target_property(HEADER_FILES ${TARGET} SOURCES) + list(FILTER HEADER_FILES INCLUDE REGEX .*.h$) + list(TRANSFORM HEADER_FILES PREPEND ${TARGET_DIRECTORY}/) + string(LENGTH ${TARGET_DIRECTORY}/${SOURCE_ROOT_FOLDER}/ SOURCE_ROOT_FOLDER_LENGTH) + foreach (HEADER_FILE ${HEADER_FILES}) + string(FIND ${HEADER_FILE} / SLASH_POSITION REVERSE) + math(EXPR SLASH_POSITION ${SLASH_POSITION}+1) + string(SUBSTRING ${HEADER_FILE} 0 ${SLASH_POSITION} HEADER_SUBDIRECTORY) + string(SUBSTRING ${HEADER_SUBDIRECTORY} ${SOURCE_ROOT_FOLDER_LENGTH} -1 HEADER_SUBDIRECTORY) + install(FILES ${HEADER_FILE} + COMPONENT ${DEV_COMPONENT} + DESTINATION ${PUBLIC_HEADERS_DESTINATION}/${HEADER_SUBDIRECTORY}) + endforeach () + + # Add the util extra targets + if (${TARGET} STREQUAL ${UTIL_TARGET_NAME}) + install(TARGETS spdlog + EXPORT ${PROJECT_NAME}Targets + LIBRARY + COMPONENT ${REL_COMPONENT} + NAMELINK_SKIP + PUBLIC_HEADER + DESTINATION ${PUBLIC_HEADERS_DESTINATION} + INCLUDES DESTINATION ${PUBLIC_HEADERS_DESTINATION}) + endif () + + # Add the connectivity extra targets + if (${TARGET} STREQUAL ${CONNECTIVITY_TARGET_NAME}) + # Install libpaho files + install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ + COMPONENT ${REL_COMPONENT} + DESTINATION ${CMAKE_INSTALL_LIBDIR} + FILES_MATCHING PATTERN REGEX "libpaho(.*).so") + install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ + COMPONENT ${REL_COMPONENT} + DESTINATION ${CMAKE_INSTALL_LIBDIR} + FILES_MATCHING PATTERN REGEX "(.*)[Pp]aho(.*).cmake") + install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ + COMPONENT ${DEV_COMPONENT} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + # Install the json schema validator target + install(TARGETS nlohmann_json_schema_validator + EXPORT ${PROJECT_NAME}Targets + LIBRARY + COMPONENT ${REL_COMPONENT} + NAMELINK_SKIP + PUBLIC_HEADER + DESTINATION ${PUBLIC_HEADERS_DESTINATION} + INCLUDES DESTINATION ${PUBLIC_HEADERS_DESTINATION}) + endif () + +endforeach () + +# Create the config file +configure_package_config_file( + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/cmake/${NAMESPACE}${PROJECT_NAME}Config.cmake" + INSTALL_DESTINATION cmake) + +# Generate the version file +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/cmake/${NAMESPACE}${PROJECT_NAME}ConfigVersion.cmake" + VERSION "${PROJECT_VERSION}" + COMPATIBILITY AnyNewerVersion +) + +# Expose the Targets.cmake in the CURRENT_BINARY_DIR +export(EXPORT ${PROJECT_NAME}Targets + FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/${NAMESPACE}${PROJECT_NAME}Targets.cmake" + NAMESPACE ${NAMESPACE}::) + +# Install the CMake files +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/cmake/${NAMESPACE}${PROJECT_NAME}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/cmake/${NAMESPACE}${PROJECT_NAME}ConfigVersion.cmake" + COMPONENT ${DEV_COMPONENT} + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${NAMESPACE}${PROJECT_NAME}") +install(EXPORT + ${PROJECT_NAME}Targets + FILE + "${NAMESPACE}${PROJECT_NAME}Targets.cmake" + NAMESPACE ${NAMESPACE}:: + COMPONENT ${DEV_COMPONENT} + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${NAMESPACE}${PROJECT_NAME}") diff --git a/configure.sh b/configure.sh index 2227b4fd..ba1ff9b3 100755 --- a/configure.sh +++ b/configure.sh @@ -17,10 +17,6 @@ # Create the directory used mkdir -p out -# Add the pre-commit hook to check code format with .clang-format -cp tools/git/pre-commit .git/hooks/pre-commit -chmod +x .git/hooks/pre-commit - # Enter the directory and start the CMake build pushd out || exit cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .. diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index cee5b72a..4f2da093 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -1,6 +1,3 @@ -# Place the sub-folder this target is placed into a variable -set(SUBDIRECTORY_PATH connectivity) - # Include the util dependencies include(cmake/dependencies.cmake) @@ -172,7 +169,7 @@ target_sources(${CONNECTIVITY_TARGET_NAME} PRIVATE core/connectivity/Connectivit # Add the private include directories target_include_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE - ${PROJECT_SOURCE_DIR}/${SUBDIRECTORY_PATH}) + ${PROJECT_SOURCE_DIR}/${CONNECTIVITY_SUBDIRECTORY_PATH}) # Add the system private include directories target_include_directories(${CONNECTIVITY_TARGET_NAME} @@ -182,7 +179,7 @@ target_include_directories(${CONNECTIVITY_TARGET_NAME} # Add the public include directories target_include_directories(${CONNECTIVITY_TARGET_NAME} PUBLIC - $ + $ $) # Include tests if the options is enabled diff --git a/connectivity/cmake/dependencies.cmake b/connectivity/cmake/dependencies.cmake index c2e80944..f0d678b7 100644 --- a/connectivity/cmake/dependencies.cmake +++ b/connectivity/cmake/dependencies.cmake @@ -44,6 +44,12 @@ FetchContent_Declare( GIT_TAG v${NLOHMANN_JSON_VERSION} ) +# Save the flags, for reset after we run the cmake for schema +set(_BUILD_TESTS ${BUILD_TESTS}) +set(_BUILD_EXAMPLES ${BUILD_EXAMPLES}) +set(BUILD_TESTS OFF CACHE BOOL "Build tests" FORCE) +set(BUILD_EXAMPLES OFF CACHE BOOL "Build examples" FORCE) + FetchContent_Declare( json-schema GIT_REPOSITORY https://github.com/pboettch/json-schema-validator @@ -53,5 +59,9 @@ FetchContent_Declare( # Make everything available FetchContent_MakeAvailable(nlohmann_json json-schema) +# Reset the flags for schema +set(BUILD_TESTS ${_BUILD_TESTS} CACHE BOOL "Build tests" FORCE) +set(BUILD_EXAMPLES ${_BUILD_EXAMPLES} CACHE BOOL "Build examples" FORCE) + # Adjust the compile options for `nlohmann_json` to disable the shadow and pedantic target_compile_options(nlohmann_json_schema_validator PRIVATE "-Wno-shadow;-Wno-pedantic") diff --git a/connectivity/tests/tests/WolkaboutFileManagementProtocolTests.cpp b/connectivity/tests/tests/WolkaboutFileManagementProtocolTests.cpp index 039c06f5..69249c3a 100644 --- a/connectivity/tests/tests/WolkaboutFileManagementProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutFileManagementProtocolTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Adriateh d.o.o. + * Copyright 2023 Wolkabout Technology s.r.o * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/connectivity/tests/tests/WolkaboutFirmwareUpdateProtocolTests.cpp b/connectivity/tests/tests/WolkaboutFirmwareUpdateProtocolTests.cpp index 9086dbf7..324a5760 100644 --- a/connectivity/tests/tests/WolkaboutFirmwareUpdateProtocolTests.cpp +++ b/connectivity/tests/tests/WolkaboutFirmwareUpdateProtocolTests.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2022 Adriateh d.o.o. + * Copyright 2023 Wolkabout Technology s.r.o * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tools/git/pre-commit b/tools/git/pre-commit deleted file mode 100644 index ce7d1bd3..00000000 --- a/tools/git/pre-commit +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (C) <2022> -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# -STYLE=$(git config --get hooks.clangformat.style) - -if [ -n "${STYLE}" ] ; then - STYLEARG="-style=${STYLE}" -else - STYLEARG="-style=file" -fi - -format_file() { - file="${1}" - clang-format ${STYLEARG} ${1} -sort-includes -output-replacements-xml | grep "/dev/null - if [ $? -ne 1 ] - then - echo "File ["${1}"] in commit did not match format rules" - exit 1; - fi -} - -case "${1}" in - --about ) - echo "Runs clang-format on source files" - ;; - * ) - for file in `git diff --cached --name-only --diff-filter=ACMRT | grep -E "^(.*\.(c|cpp|h|hpp)\$)" | grep -v "mpack" | grep -v "json.hpp"` ; do - format_file "${file}" - done - ;; -esac diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index 8ac97ca5..35986fa3 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -1,6 +1,3 @@ -# Place the sub-folder this target is placed into a variable -set(SUBDIRECTORY_PATH util) - # Include the util dependencies include(cmake/dependencies.cmake) @@ -41,10 +38,10 @@ target_sources(${UTIL_TARGET_NAME} PRIVATE core/utility/Buffer.h # Add the private include directories target_include_directories(${UTIL_TARGET_NAME} PRIVATE - ${PROJECT_SOURCE_DIR}/${SUBDIRECTORY_PATH}) + ${PROJECT_SOURCE_DIR}/${UTIL_SUBDIRECTORY_PATH}) # Add the public include directories target_include_directories(${UTIL_TARGET_NAME} PUBLIC - $ + $ $) diff --git a/util/core/utility/LogManager.cpp b/util/core/utility/LogManager.cpp index d985d8ca..4c81ae01 100644 --- a/util/core/utility/LogManager.cpp +++ b/util/core/utility/LogManager.cpp @@ -1,5 +1,17 @@ /** - * Copyright (c) 2022 Wolkabout. + * Copyright 2023 Wolkabout Technology s.r.o + * + * 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. */ #include "core/utility/LogManager.h" diff --git a/util/core/utility/LogManager.h b/util/core/utility/LogManager.h index 7dcc5328..a50310fa 100644 --- a/util/core/utility/LogManager.h +++ b/util/core/utility/LogManager.h @@ -1,5 +1,17 @@ /** - * Copyright (c) 2022 Wolkabout. + * Copyright 2023 Wolkabout Technology s.r.o + * + * 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. */ #ifndef WOLKABOUTCORE_LOGMANAGER_H diff --git a/util/core/utility/LogUploader.h b/util/core/utility/LogUploader.h index 17196be7..8616f61b 100644 --- a/util/core/utility/LogUploader.h +++ b/util/core/utility/LogUploader.h @@ -1,6 +1,19 @@ /** - * Copyright (c) 2022 Wolkabout + * Copyright 2023 Wolkabout Technology s.r.o + * + * 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. */ + #ifndef WOLKABOUTCORE_LOGUPLOADER_H #define WOLKABOUTCORE_LOGUPLOADER_H From 5508fd0cb3e90571c7f3d986a9e0cfc4bfeda0b9 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Tue, 13 Jun 2023 15:56:00 +0200 Subject: [PATCH 05/20] Link the `connectivity` library with `nlohmann_json` --- connectivity/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index 4f2da093..9d22e65e 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -7,7 +7,7 @@ add_library(${NAMESPACE}::${CONNECTIVITY_TARGET_NAME} ALIAS ${CONNECTIVITY_TARGE # Link the libraries target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_BINARY_DIR}/lib) -target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE ${UTIL_TARGET_NAME} paho-mqttpp3 paho-mqtt3as nlohmann_json_schema_validator) +target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE ${UTIL_TARGET_NAME} paho-mqttpp3 paho-mqtt3as nlohmann_json::nlohmann_json nlohmann_json_schema_validator) # Add the dependency add_dependencies(${CONNECTIVITY_TARGET_NAME} pahomqttcpp) From 7f40bb7f0e25d3d8ea3cc2393aa642bf5662c1a0 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Tue, 13 Jun 2023 16:28:43 +0200 Subject: [PATCH 06/20] Okay, now transitive linking should work, and also enabled full install --- aws/CMakeLists.txt | 2 +- cmake/install.cmake | 18 +++++++++--------- connectivity/CMakeLists.txt | 2 +- connectivity/cmake/dependencies.cmake | 6 +++--- connectivity/tests/CMakeLists.txt | 1 + util/CMakeLists.txt | 2 +- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/aws/CMakeLists.txt b/aws/CMakeLists.txt index 98c72b42..83eb80e5 100644 --- a/aws/CMakeLists.txt +++ b/aws/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(${AWS_LOG_UPLOADER_TARGET_NAME}) add_library(${NAMESPACE}::${AWS_LOG_UPLOADER_TARGET_NAME} ALIAS ${AWS_LOG_UPLOADER_TARGET_NAME}) # Link the libraries -target_link_libraries(${AWS_LOG_UPLOADER_TARGET_NAME} PRIVATE ${UTIL_TARGET_NAME} aws-cpp-sdk-core aws-cpp-sdk-s3) +target_link_libraries(${AWS_LOG_UPLOADER_TARGET_NAME} ${UTIL_TARGET_NAME} aws-cpp-sdk-core aws-cpp-sdk-s3) # Set some target properties set_target_properties(${AWS_LOG_UPLOADER_TARGET_NAME} PROPERTIES OUTPUT_NAME "${NAMESPACE}${AWS_LOG_UPLOADER_TARGET_NAME}") diff --git a/cmake/install.cmake b/cmake/install.cmake index b4e46680..2b92974b 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -26,14 +26,14 @@ foreach (INDEX RANGE ${TARGETS_LENGTH}) endif () # Create the install rule for the main target - # install(TARGETS ${TARGET} - # EXPORT ${PROJECT_NAME}Targets - # LIBRARY - # COMPONENT ${REL_COMPONENT} - # NAMELINK_SKIP - # PUBLIC_HEADER - # DESTINATION ${PUBLIC_HEADERS_DESTINATION} - # INCLUDES DESTINATION ${PUBLIC_HEADERS_DESTINATION}) + install(TARGETS ${TARGET} + EXPORT ${PROJECT_NAME}Targets + LIBRARY + COMPONENT ${REL_COMPONENT} + NAMELINK_SKIP + PUBLIC_HEADER + DESTINATION ${PUBLIC_HEADERS_DESTINATION} + INCLUDES DESTINATION ${PUBLIC_HEADERS_DESTINATION}) # Install all the header files get_target_property(HEADER_FILES ${TARGET} SOURCES) @@ -78,7 +78,7 @@ foreach (INDEX RANGE ${TARGETS_LENGTH}) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) # Install the json schema validator target - install(TARGETS nlohmann_json_schema_validator + install(TARGETS nlohmann_json nlohmann_json_schema_validator EXPORT ${PROJECT_NAME}Targets LIBRARY COMPONENT ${REL_COMPONENT} diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index 9d22e65e..d604882c 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -7,7 +7,7 @@ add_library(${NAMESPACE}::${CONNECTIVITY_TARGET_NAME} ALIAS ${CONNECTIVITY_TARGE # Link the libraries target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_BINARY_DIR}/lib) -target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE ${UTIL_TARGET_NAME} paho-mqttpp3 paho-mqtt3as nlohmann_json::nlohmann_json nlohmann_json_schema_validator) +target_link_libraries(${CONNECTIVITY_TARGET_NAME} ${UTIL_TARGET_NAME} paho-mqttpp3 paho-mqtt3as nlohmann_json::nlohmann_json nlohmann_json_schema_validator) # Add the dependency add_dependencies(${CONNECTIVITY_TARGET_NAME} pahomqttcpp) diff --git a/connectivity/cmake/dependencies.cmake b/connectivity/cmake/dependencies.cmake index f0d678b7..98936e43 100644 --- a/connectivity/cmake/dependencies.cmake +++ b/connectivity/cmake/dependencies.cmake @@ -5,7 +5,7 @@ include(FetchContent) # Define the versions set(PAHO_MQTT_C_VERSION "1.3.8") set(PAHO_MQTT_CPP_VERSION "1.2.0") -set(NLOHMANN_JSON_VERSION "3.7.3") +set(NLOHMANN_JSON_VERSION "3.11.2") set(JSON_SCHEMA_VERSION "2.1.0") # Include PahoMQTT for both C and C++ @@ -39,7 +39,7 @@ option(JSON_BuildTests "Build the unit tests when BUILD_TESTING is enabled." OFF # Include nlohmann json and the schema) FetchContent_Declare( - nlohmann_json + json GIT_REPOSITORY https://github.com/nlohmann/json GIT_TAG v${NLOHMANN_JSON_VERSION} ) @@ -57,7 +57,7 @@ FetchContent_Declare( ) # Make everything available -FetchContent_MakeAvailable(nlohmann_json json-schema) +FetchContent_MakeAvailable(json json-schema) # Reset the flags for schema set(BUILD_TESTS ${_BUILD_TESTS} CACHE BOOL "Build tests" FORCE) diff --git a/connectivity/tests/CMakeLists.txt b/connectivity/tests/CMakeLists.txt index 5adbf7f9..1283fb65 100644 --- a/connectivity/tests/CMakeLists.txt +++ b/connectivity/tests/CMakeLists.txt @@ -11,6 +11,7 @@ include(cmake/dependencies.cmake) add_executable(${PROJECT_NAME}Tests) # Link the libraries +target_link_directories(${PROJECT_NAME}Tests PUBLIC ${CMAKE_BINARY_DIR}/lib) target_link_libraries(${PROJECT_NAME}Tests ${CONNECTIVITY_TARGET_NAME} ${UTIL_TARGET_NAME} gtest gmock gtest_main) # Set some target properties diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index 35986fa3..6f47b322 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(${UTIL_TARGET_NAME}) add_library(${NAMESPACE}::${UTIL_TARGET_NAME} ALIAS ${UTIL_TARGET_NAME}) # Link the libraries -target_link_libraries(${UTIL_TARGET_NAME} PRIVATE OpenSSL::Crypto spdlog::spdlog Threads::Threads) +target_link_libraries(${UTIL_TARGET_NAME} OpenSSL::Crypto spdlog::spdlog Threads::Threads) # Set some target properties set_target_properties(${UTIL_TARGET_NAME} PROPERTIES OUTPUT_NAME "${NAMESPACE}${UTIL_TARGET_NAME}") From 7e5bdb03bd51b081e44e74ccd19c1d1988d761b9 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Tue, 13 Jun 2023 16:38:21 +0200 Subject: [PATCH 07/20] Set the `nlohmann` to `v3.7.3` --- connectivity/cmake/dependencies.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/cmake/dependencies.cmake b/connectivity/cmake/dependencies.cmake index 98936e43..5b64b9ba 100644 --- a/connectivity/cmake/dependencies.cmake +++ b/connectivity/cmake/dependencies.cmake @@ -5,7 +5,7 @@ include(FetchContent) # Define the versions set(PAHO_MQTT_C_VERSION "1.3.8") set(PAHO_MQTT_CPP_VERSION "1.2.0") -set(NLOHMANN_JSON_VERSION "3.11.2") +set(NLOHMANN_JSON_VERSION "3.7.3") set(JSON_SCHEMA_VERSION "2.1.0") # Include PahoMQTT for both C and C++ From 417655c06c6f28a597e2ef08f2a0afe5328238cc Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Tue, 13 Jun 2023 16:55:45 +0200 Subject: [PATCH 08/20] Write the release notes --- RELEASE_NOTES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 618687a5..6592b9c0 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -6,6 +6,9 @@ /_/ /_/ ======================================================================================================================== +**Version 3.4.0** + - [IMPROVEMENT] - Completely reworked the CMake structure of the project. + **Version 3.3.0** - [IMPROVEMENT] - Modernized the CMake a little bit more to appeal to more modern way of including headers. From 30a407140a1bf2a809d6a10aee3614528ec8e424 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Tue, 13 Jun 2023 17:08:35 +0200 Subject: [PATCH 09/20] Enabled tests to be run through `CTest` --- CMakeLists.txt | 4 ++++ connectivity/tests/CMakeLists.txt | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87101e17..92d98b83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ # limitations under the License. # Set the version policy +set(CMAKE_POSITION_INDEPENDENT_CODE ON) cmake_policy(SET CMP0048 NEW) # Define the project @@ -44,6 +45,9 @@ OPTION(INSTALL_TARGET "Add the installation target for the project." ON) if (NOT ${BUILD_GTEST} AND ${BUILD_TESTS}) message(FATAL_ERROR "The library can not build TESTS without GTEST.") endif () +if (${BUILD_TESTS}) + enable_testing() +endif () # Add the poco options include(cmake/poco-options.cmake) diff --git a/connectivity/tests/CMakeLists.txt b/connectivity/tests/CMakeLists.txt index 1283fb65..ffb2f5bd 100644 --- a/connectivity/tests/CMakeLists.txt +++ b/connectivity/tests/CMakeLists.txt @@ -1,9 +1,6 @@ # Place the sub-folder this target is placed into a variable set(SUBDIRECTORY_PATH connectivity/tests) -# Enable testing -enable_testing() - # Include the dependencies include(cmake/dependencies.cmake) From 0dbe7513800c05099eea4c456184689dd64f0234 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Tue, 13 Jun 2023 17:29:41 +0200 Subject: [PATCH 10/20] More old paths --- .github/workflows/cmake_build_and_test.yml | 2 +- aws/core/log_uploader/AwsLogUploader.cpp | 2 +- aws/core/log_uploader/AwsLogUploader.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake_build_and_test.yml b/.github/workflows/cmake_build_and_test.yml index ac18e2fa..75e3d2e9 100644 --- a/.github/workflows/cmake_build_and_test.yml +++ b/.github/workflows/cmake_build_and_test.yml @@ -51,4 +51,4 @@ jobs: uses: jidicula/clang-format-action@v3.5.2 with: clang-format-version: 10 - exclude-regex: "core/utilities/nlohmann/json.hpp" + exclude-regex: "core/utility/nlohmann/json.hpp" diff --git a/aws/core/log_uploader/AwsLogUploader.cpp b/aws/core/log_uploader/AwsLogUploader.cpp index 9c83a6fd..abc731eb 100644 --- a/aws/core/log_uploader/AwsLogUploader.cpp +++ b/aws/core/log_uploader/AwsLogUploader.cpp @@ -16,7 +16,7 @@ #include "core/log_uploader/AwsLogUploader.h" -#include "core/utilities/Logger.h" +#include "core/utility/Logger.h" #include #include diff --git a/aws/core/log_uploader/AwsLogUploader.h b/aws/core/log_uploader/AwsLogUploader.h index 85bd7ca4..8679a8a9 100644 --- a/aws/core/log_uploader/AwsLogUploader.h +++ b/aws/core/log_uploader/AwsLogUploader.h @@ -17,7 +17,7 @@ #ifndef AWSLOGUPLOADER_H #define AWSLOGUPLOADER_H -#include "core/utilities/LogUploader.h" +#include "core/utility/LogUploader.h" #include From 0bd37bdd4947f4eeae600c32030dd479f464d73e Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Mon, 19 Jun 2023 11:19:39 +0200 Subject: [PATCH 11/20] Reduce back `CMake` version to `3.5` --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 92d98b83..a6f28922 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) cmake_policy(SET CMP0048 NEW) # Define the project -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.5) project(SDKCore VERSION 3.4.0) set(PROJECT_VERSION_SUFFIX) set(NAMESPACE Wolkabout) From 3bb8298b92f1aa215d7e48c962a816e69a40ce52 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Mon, 19 Jun 2023 11:29:25 +0200 Subject: [PATCH 12/20] Bump to version supporting `FetchContent` --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6f28922..7fcb521b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) cmake_policy(SET CMP0048 NEW) # Define the project -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.11) project(SDKCore VERSION 3.4.0) set(PROJECT_VERSION_SUFFIX) set(NAMESPACE Wolkabout) From 3ce0f47a688d6c68b175ed3cc70129d56b5053df Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Mon, 19 Jun 2023 15:33:47 +0200 Subject: [PATCH 13/20] Replace all `FetchContent_MakeAvailable` with `FetchContent_Populate` --- aws/cmake/dependencies.cmake | 3 ++- connectivity/cmake/dependencies.cmake | 5 ++++- connectivity/tests/cmake/dependencies.cmake | 3 ++- util/cmake/dependencies.cmake | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/aws/cmake/dependencies.cmake b/aws/cmake/dependencies.cmake index 726d0ad1..45401d8f 100644 --- a/aws/cmake/dependencies.cmake +++ b/aws/cmake/dependencies.cmake @@ -25,4 +25,5 @@ FetchContent_Declare( ) # Make available -FetchContent_MakeAvailable(aws-sdk-cpp) +FetchContent_Populate(aws-sdk-cpp) +add_subdirectory(${aws-sdk-cpp_SOURCE_DIR} ${aws-sdk-cpp_BINARY_DIR}) diff --git a/connectivity/cmake/dependencies.cmake b/connectivity/cmake/dependencies.cmake index 5b64b9ba..d7de487c 100644 --- a/connectivity/cmake/dependencies.cmake +++ b/connectivity/cmake/dependencies.cmake @@ -57,7 +57,10 @@ FetchContent_Declare( ) # Make everything available -FetchContent_MakeAvailable(json json-schema) +FetchContent_Populate(json) +FetchContent_Populate(json-schema) +add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR}) +add_subdirectory(${json-schema_SOURCE_DIR} ${json-schema_BINARY_DIR}) # Reset the flags for schema set(BUILD_TESTS ${_BUILD_TESTS} CACHE BOOL "Build tests" FORCE) diff --git a/connectivity/tests/cmake/dependencies.cmake b/connectivity/tests/cmake/dependencies.cmake index 29a21143..9e56491e 100644 --- a/connectivity/tests/cmake/dependencies.cmake +++ b/connectivity/tests/cmake/dependencies.cmake @@ -12,7 +12,8 @@ FetchContent_Declare( ) # Make available -FetchContent_MakeAvailable(libgtest) +FetchContent_Populate(libgtest) +add_subdirectory(${libgtest_SOURCE_DIR} ${libgtest_BINARY_DIR}) # Adjust the compile options for `nlohmann_json` to disable the compilation errors with our flags target_compile_options(gtest PRIVATE "-Wno-error=maybe-uninitialized;-Wno-error=suggest-attribute=noreturn") diff --git a/util/cmake/dependencies.cmake b/util/cmake/dependencies.cmake index f9088604..8fb544a4 100644 --- a/util/cmake/dependencies.cmake +++ b/util/cmake/dependencies.cmake @@ -16,4 +16,5 @@ FetchContent_Declare( ) # Make available -FetchContent_MakeAvailable(spdlog) +FetchContent_Populate(spdlog) +add_subdirectory(${spdlog_SOURCE_DIR} ${spdlog_BINARY_DIR}) From 10b76f87727d053f70184d0c42f2e4e1d42b72de Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Wed, 21 Jun 2023 14:32:37 +0200 Subject: [PATCH 14/20] Revert to `FetchContent_MakeAvailable` --- aws/cmake/dependencies.cmake | 5 ++--- connectivity/cmake/dependencies.cmake | 17 +++++++---------- connectivity/tests/cmake/dependencies.cmake | 5 ++--- util/cmake/dependencies.cmake | 5 ++--- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/aws/cmake/dependencies.cmake b/aws/cmake/dependencies.cmake index 45401d8f..6f8de6b0 100644 --- a/aws/cmake/dependencies.cmake +++ b/aws/cmake/dependencies.cmake @@ -2,7 +2,7 @@ include(FetchContent) # Define the AWS version -set(AWS_SDK_VERSION "1.8.173") +set(AWS_SDK_VERSION 1.8.173) # Set the flags for AWS based on the CMake build type if (CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -25,5 +25,4 @@ FetchContent_Declare( ) # Make available -FetchContent_Populate(aws-sdk-cpp) -add_subdirectory(${aws-sdk-cpp_SOURCE_DIR} ${aws-sdk-cpp_BINARY_DIR}) +FetchContent_MakeAvailable(aws-sdk-cpp) diff --git a/connectivity/cmake/dependencies.cmake b/connectivity/cmake/dependencies.cmake index d7de487c..ee8e5105 100644 --- a/connectivity/cmake/dependencies.cmake +++ b/connectivity/cmake/dependencies.cmake @@ -3,15 +3,15 @@ include(ExternalProject) include(FetchContent) # Define the versions -set(PAHO_MQTT_C_VERSION "1.3.8") -set(PAHO_MQTT_CPP_VERSION "1.2.0") -set(NLOHMANN_JSON_VERSION "3.7.3") -set(JSON_SCHEMA_VERSION "2.1.0") +set(PAHO_MQTT_C_VERSION 1.3.8) +set(PAHO_MQTT_CPP_VERSION 1.2.0) +set(NLOHMANN_JSON_VERSION 3.7.3) +set(JSON_SCHEMA_VERSION 2.1.0) # Include PahoMQTT for both C and C++ ExternalProject_Add(pahomqttc GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.c" - GIT_TAG "v${PAHO_MQTT_C_VERSION}" + GIT_TAG v${PAHO_MQTT_C_VERSION} UPDATE_COMMAND "" CMAKE_ARGS -DPAHO_WITH_SSL=TRUE @@ -22,7 +22,7 @@ ExternalProject_Add(pahomqttc ExternalProject_Add(pahomqttcpp GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.cpp" - GIT_TAG "v${PAHO_MQTT_CPP_VERSION}" + GIT_TAG v${PAHO_MQTT_CPP_VERSION} UPDATE_COMMAND "" CMAKE_ARGS -DPAHO_WITH_SSL=TRUE @@ -57,10 +57,7 @@ FetchContent_Declare( ) # Make everything available -FetchContent_Populate(json) -FetchContent_Populate(json-schema) -add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR}) -add_subdirectory(${json-schema_SOURCE_DIR} ${json-schema_BINARY_DIR}) +FetchContent_MakeAvailable(json json-schema) # Reset the flags for schema set(BUILD_TESTS ${_BUILD_TESTS} CACHE BOOL "Build tests" FORCE) diff --git a/connectivity/tests/cmake/dependencies.cmake b/connectivity/tests/cmake/dependencies.cmake index 9e56491e..21ac21e2 100644 --- a/connectivity/tests/cmake/dependencies.cmake +++ b/connectivity/tests/cmake/dependencies.cmake @@ -2,7 +2,7 @@ include(FetchContent) # Define the gtest/gmock version -set(GTEST_VERSION "1.10.0") +set(GTEST_VERSION 1.10.0) # Add gtest/gmock FetchContent_Declare( @@ -12,8 +12,7 @@ FetchContent_Declare( ) # Make available -FetchContent_Populate(libgtest) -add_subdirectory(${libgtest_SOURCE_DIR} ${libgtest_BINARY_DIR}) +FetchContent_MakeAvailable(libgtest) # Adjust the compile options for `nlohmann_json` to disable the compilation errors with our flags target_compile_options(gtest PRIVATE "-Wno-error=maybe-uninitialized;-Wno-error=suggest-attribute=noreturn") diff --git a/util/cmake/dependencies.cmake b/util/cmake/dependencies.cmake index 8fb544a4..3a54ada0 100644 --- a/util/cmake/dependencies.cmake +++ b/util/cmake/dependencies.cmake @@ -6,7 +6,7 @@ find_package(OpenSSL REQUIRED) find_package(Threads REQUIRED) # Define the spdlog version -set(SPDLOG_VERSION "1.8.5") +set(SPDLOG_VERSION 1.8.5) # Add spdlog FetchContent_Declare( @@ -16,5 +16,4 @@ FetchContent_Declare( ) # Make available -FetchContent_Populate(spdlog) -add_subdirectory(${spdlog_SOURCE_DIR} ${spdlog_BINARY_DIR}) +FetchContent_MakeAvailable(spdlog) From 4c62ff090503e6c5e2e82e907780eae2c09c40f9 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Wed, 21 Jun 2023 15:05:38 +0200 Subject: [PATCH 15/20] Reverted to more standard way of functioning for libraries --- cmake/install.cmake | 6 ++--- cmake/paths.cmake | 10 +++++--- connectivity/CMakeLists.txt | 4 ++-- connectivity/cmake/dependencies.cmake | 33 +++++++++++++++++++++++---- connectivity/tests/CMakeLists.txt | 4 ++-- 5 files changed, 42 insertions(+), 15 deletions(-) diff --git a/cmake/install.cmake b/cmake/install.cmake index 2b92974b..8fe15c75 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -65,15 +65,15 @@ foreach (INDEX RANGE ${TARGETS_LENGTH}) # Add the connectivity extra targets if (${TARGET} STREQUAL ${CONNECTIVITY_TARGET_NAME}) # Install libpaho files - install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ + install(DIRECTORY ${CMAKE_PREFIX_PATH}/lib/ COMPONENT ${REL_COMPONENT} DESTINATION ${CMAKE_INSTALL_LIBDIR} FILES_MATCHING PATTERN REGEX "libpaho(.*).so") - install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ + install(DIRECTORY ${CMAKE_PREFIX_PATH}/lib/ COMPONENT ${REL_COMPONENT} DESTINATION ${CMAKE_INSTALL_LIBDIR} FILES_MATCHING PATTERN REGEX "(.*)[Pp]aho(.*).cmake") - install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ + install(DIRECTORY ${CMAKE_PREFIX_PATH}/include/ COMPONENT ${DEV_COMPONENT} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/cmake/paths.cmake b/cmake/paths.cmake index cf824979..e9d8623c 100644 --- a/cmake/paths.cmake +++ b/cmake/paths.cmake @@ -1,12 +1,16 @@ # Configure the paths for output if (NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) endif () if (NOT DEFINED CMAKE_LIBRARY_INCLUDE_DIRECTORY) - set(CMAKE_LIBRARY_INCLUDE_DIRECTORY "${CMAKE_BINARY_DIR}/include") + set(CMAKE_LIBRARY_INCLUDE_DIRECTORY ${CMAKE_BINARY_DIR}/include) endif () if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +endif () + +if (NOT DEFINED CMAKE_PREFIX_PATH) + set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/build) endif () diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index d604882c..ca42ad90 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(${CONNECTIVITY_TARGET_NAME}) add_library(${NAMESPACE}::${CONNECTIVITY_TARGET_NAME} ALIAS ${CONNECTIVITY_TARGET_NAME}) # Link the libraries -target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_BINARY_DIR}/lib) +target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_PREFIX_PATH}/lib) target_link_libraries(${CONNECTIVITY_TARGET_NAME} ${UTIL_TARGET_NAME} paho-mqttpp3 paho-mqtt3as nlohmann_json::nlohmann_json nlohmann_json_schema_validator) # Add the dependency @@ -174,7 +174,7 @@ target_include_directories(${CONNECTIVITY_TARGET_NAME} # Add the system private include directories target_include_directories(${CONNECTIVITY_TARGET_NAME} SYSTEM PRIVATE - ${CMAKE_BINARY_DIR}/include) + ${CMAKE_PREFIX_PATH}/include) # Add the public include directories target_include_directories(${CONNECTIVITY_TARGET_NAME} diff --git a/connectivity/cmake/dependencies.cmake b/connectivity/cmake/dependencies.cmake index ee8e5105..80ee71ec 100644 --- a/connectivity/cmake/dependencies.cmake +++ b/connectivity/cmake/dependencies.cmake @@ -14,10 +14,22 @@ ExternalProject_Add(pahomqttc GIT_TAG v${PAHO_MQTT_C_VERSION} UPDATE_COMMAND "" CMAKE_ARGS - -DPAHO_WITH_SSL=TRUE + # Options for pahomqttc + -DPAHO_WITH_SSL=ON + -DPAHO_BUILD_SHARED=ON + -DPAHO_BUILD_STATIC=OFF + -DPAHO_BUILD_DOCUMENTATION=OFF + -DPAHO_BUILD_SAMPLES=OFF + -DPAHO_BUILD_DEB_PACKAGE=OFF + -DPAHO_ENABLE_TESTING=OFF + -DPAHO_ENABLE_CPACK=OFF + + # Target path for installation + -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} + + # In case the library needs to cross-compile -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DARP_TOOLCHAIN_ROOT=${ARP_TOOLCHAIN_ROOT} - -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} ) ExternalProject_Add(pahomqttcpp @@ -25,12 +37,23 @@ ExternalProject_Add(pahomqttcpp GIT_TAG v${PAHO_MQTT_CPP_VERSION} UPDATE_COMMAND "" CMAKE_ARGS - -DPAHO_WITH_SSL=TRUE + # Options for pahomqttcpp + -DPAHO_WITH_SSL=ON + -DPAHO_BUILD_SHARED=ON + -DPAHO_BUILD_STATIC=OFF + -DPAHO_BUILD_DOCUMENTATION=OFF + -DPAHO_BUILD_SAMPLES=OFF + -DPAHO_BUILD_DEB_PACKAGE=OFF + -DPAHO_BUILD_TESTS=OFF + + # Target path for installation -DPAHO_MQTT_C_INCLUDE_DIRS=${CMAKE_BINARY_DIR}/include + -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} + -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} + + # In case the library needs to cross-compile -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DARP_TOOLCHAIN_ROOT=${ARP_TOOLCHAIN_ROOT} - -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR} - -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} DEPENDS pahomqttc ) diff --git a/connectivity/tests/CMakeLists.txt b/connectivity/tests/CMakeLists.txt index ffb2f5bd..13f10398 100644 --- a/connectivity/tests/CMakeLists.txt +++ b/connectivity/tests/CMakeLists.txt @@ -8,7 +8,7 @@ include(cmake/dependencies.cmake) add_executable(${PROJECT_NAME}Tests) # Link the libraries -target_link_directories(${PROJECT_NAME}Tests PUBLIC ${CMAKE_BINARY_DIR}/lib) +target_link_directories(${PROJECT_NAME}Tests PUBLIC ${CMAKE_PREFIX_PATH}/lib) target_link_libraries(${PROJECT_NAME}Tests ${CONNECTIVITY_TARGET_NAME} ${UTIL_TARGET_NAME} gtest gmock gtest_main) # Set some target properties @@ -69,7 +69,7 @@ target_include_directories(${PROJECT_NAME}Tests # Add the system private include directories target_include_directories(${PROJECT_NAME}Tests SYSTEM PRIVATE - ${CMAKE_BINARY_DIR}/include) + ${CMAKE_PREFIX_PATH}/include) # Add it to CTest add_test(NAME "WolkSDK-Cpp_Tests" COMMAND ${PROJECT_NAME}Tests) From 465d4c26cdf7cf1c0f9581e5d2c1e527e6848284 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Wed, 21 Jun 2023 15:11:36 +0200 Subject: [PATCH 16/20] Fix the include path for `pahomqttcpp` build --- connectivity/cmake/dependencies.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/cmake/dependencies.cmake b/connectivity/cmake/dependencies.cmake index 80ee71ec..2b64e84f 100644 --- a/connectivity/cmake/dependencies.cmake +++ b/connectivity/cmake/dependencies.cmake @@ -47,7 +47,7 @@ ExternalProject_Add(pahomqttcpp -DPAHO_BUILD_TESTS=OFF # Target path for installation - -DPAHO_MQTT_C_INCLUDE_DIRS=${CMAKE_BINARY_DIR}/include + -DPAHO_MQTT_C_INCLUDE_DIRS=${CMAKE_PREFIX_PATH}/include -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} From 1d36664e8dd4851d4f747f5a5ed12a4a3dcb2f49 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Wed, 21 Jun 2023 16:22:26 +0200 Subject: [PATCH 17/20] Link paho libraries privately --- connectivity/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index ca42ad90..53b00aca 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -7,7 +7,8 @@ add_library(${NAMESPACE}::${CONNECTIVITY_TARGET_NAME} ALIAS ${CONNECTIVITY_TARGE # Link the libraries target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_PREFIX_PATH}/lib) -target_link_libraries(${CONNECTIVITY_TARGET_NAME} ${UTIL_TARGET_NAME} paho-mqttpp3 paho-mqtt3as nlohmann_json::nlohmann_json nlohmann_json_schema_validator) +target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE paho-mqttpp3 paho-mqtt3as) +target_link_libraries(${CONNECTIVITY_TARGET_NAME} ${UTIL_TARGET_NAME} nlohmann_json::nlohmann_json nlohmann_json_schema_validator) # Add the dependency add_dependencies(${CONNECTIVITY_TARGET_NAME} pahomqttcpp) From 17ff765019dc7a62cedbf2dce27f5af1317cf800 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Wed, 21 Jun 2023 16:39:43 +0200 Subject: [PATCH 18/20] Link all libraries privately --- connectivity/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index 53b00aca..73fda08b 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -7,8 +7,7 @@ add_library(${NAMESPACE}::${CONNECTIVITY_TARGET_NAME} ALIAS ${CONNECTIVITY_TARGE # Link the libraries target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_PREFIX_PATH}/lib) -target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE paho-mqttpp3 paho-mqtt3as) -target_link_libraries(${CONNECTIVITY_TARGET_NAME} ${UTIL_TARGET_NAME} nlohmann_json::nlohmann_json nlohmann_json_schema_validator) +target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE paho-mqttpp3 paho-mqtt3as ${UTIL_TARGET_NAME} nlohmann_json::nlohmann_json nlohmann_json_schema_validator) # Add the dependency add_dependencies(${CONNECTIVITY_TARGET_NAME} pahomqttcpp) From c81019df2d6ba593d921e46516ee4a51e850a381 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Wed, 21 Jun 2023 16:55:44 +0200 Subject: [PATCH 19/20] Made only our libraries (and paho mqtt) link publicly, everything else privately --- aws/CMakeLists.txt | 3 ++- connectivity/CMakeLists.txt | 3 ++- util/CMakeLists.txt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/aws/CMakeLists.txt b/aws/CMakeLists.txt index 83eb80e5..356bea05 100644 --- a/aws/CMakeLists.txt +++ b/aws/CMakeLists.txt @@ -6,7 +6,8 @@ add_library(${AWS_LOG_UPLOADER_TARGET_NAME}) add_library(${NAMESPACE}::${AWS_LOG_UPLOADER_TARGET_NAME} ALIAS ${AWS_LOG_UPLOADER_TARGET_NAME}) # Link the libraries -target_link_libraries(${AWS_LOG_UPLOADER_TARGET_NAME} ${UTIL_TARGET_NAME} aws-cpp-sdk-core aws-cpp-sdk-s3) +target_link_libraries(${AWS_LOG_UPLOADER_TARGET_NAME} PUBLIC ${UTIL_TARGET_NAME}) +target_link_libraries(${AWS_LOG_UPLOADER_TARGET_NAME} PRIVATE aws-cpp-sdk-core aws-cpp-sdk-s3) # Set some target properties set_target_properties(${AWS_LOG_UPLOADER_TARGET_NAME} PROPERTIES OUTPUT_NAME "${NAMESPACE}${AWS_LOG_UPLOADER_TARGET_NAME}") diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index 73fda08b..58331f3d 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -7,7 +7,8 @@ add_library(${NAMESPACE}::${CONNECTIVITY_TARGET_NAME} ALIAS ${CONNECTIVITY_TARGE # Link the libraries target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_PREFIX_PATH}/lib) -target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE paho-mqttpp3 paho-mqtt3as ${UTIL_TARGET_NAME} nlohmann_json::nlohmann_json nlohmann_json_schema_validator) +target_link_libraries(${CONNECTIVITY_TARGET_NAME} PUBLIC paho-mqttpp3 paho-mqtt3as ${UTIL_TARGET_NAME}) +target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE nlohmann_json::nlohmann_json nlohmann_json_schema_validator) # Add the dependency add_dependencies(${CONNECTIVITY_TARGET_NAME} pahomqttcpp) diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index 6f47b322..35986fa3 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(${UTIL_TARGET_NAME}) add_library(${NAMESPACE}::${UTIL_TARGET_NAME} ALIAS ${UTIL_TARGET_NAME}) # Link the libraries -target_link_libraries(${UTIL_TARGET_NAME} OpenSSL::Crypto spdlog::spdlog Threads::Threads) +target_link_libraries(${UTIL_TARGET_NAME} PRIVATE OpenSSL::Crypto spdlog::spdlog Threads::Threads) # Set some target properties set_target_properties(${UTIL_TARGET_NAME} PROPERTIES OUTPUT_NAME "${NAMESPACE}${UTIL_TARGET_NAME}") From cd3bbfdd79422fea705bf1035b92d3dd9a5800d3 Mon Sep 17 00:00:00 2001 From: nanavuletic Date: Wed, 21 Jun 2023 17:07:40 +0200 Subject: [PATCH 20/20] Remove all modifiers for library linking --- aws/CMakeLists.txt | 3 +-- connectivity/CMakeLists.txt | 3 +-- util/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/aws/CMakeLists.txt b/aws/CMakeLists.txt index 356bea05..83eb80e5 100644 --- a/aws/CMakeLists.txt +++ b/aws/CMakeLists.txt @@ -6,8 +6,7 @@ add_library(${AWS_LOG_UPLOADER_TARGET_NAME}) add_library(${NAMESPACE}::${AWS_LOG_UPLOADER_TARGET_NAME} ALIAS ${AWS_LOG_UPLOADER_TARGET_NAME}) # Link the libraries -target_link_libraries(${AWS_LOG_UPLOADER_TARGET_NAME} PUBLIC ${UTIL_TARGET_NAME}) -target_link_libraries(${AWS_LOG_UPLOADER_TARGET_NAME} PRIVATE aws-cpp-sdk-core aws-cpp-sdk-s3) +target_link_libraries(${AWS_LOG_UPLOADER_TARGET_NAME} ${UTIL_TARGET_NAME} aws-cpp-sdk-core aws-cpp-sdk-s3) # Set some target properties set_target_properties(${AWS_LOG_UPLOADER_TARGET_NAME} PROPERTIES OUTPUT_NAME "${NAMESPACE}${AWS_LOG_UPLOADER_TARGET_NAME}") diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index 58331f3d..16aea995 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -7,8 +7,7 @@ add_library(${NAMESPACE}::${CONNECTIVITY_TARGET_NAME} ALIAS ${CONNECTIVITY_TARGE # Link the libraries target_link_directories(${CONNECTIVITY_TARGET_NAME} PRIVATE ${CMAKE_PREFIX_PATH}/lib) -target_link_libraries(${CONNECTIVITY_TARGET_NAME} PUBLIC paho-mqttpp3 paho-mqtt3as ${UTIL_TARGET_NAME}) -target_link_libraries(${CONNECTIVITY_TARGET_NAME} PRIVATE nlohmann_json::nlohmann_json nlohmann_json_schema_validator) +target_link_libraries(${CONNECTIVITY_TARGET_NAME} paho-mqttpp3 paho-mqtt3as ${UTIL_TARGET_NAME} nlohmann_json::nlohmann_json nlohmann_json_schema_validator) # Add the dependency add_dependencies(${CONNECTIVITY_TARGET_NAME} pahomqttcpp) diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index 35986fa3..6f47b322 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(${UTIL_TARGET_NAME}) add_library(${NAMESPACE}::${UTIL_TARGET_NAME} ALIAS ${UTIL_TARGET_NAME}) # Link the libraries -target_link_libraries(${UTIL_TARGET_NAME} PRIVATE OpenSSL::Crypto spdlog::spdlog Threads::Threads) +target_link_libraries(${UTIL_TARGET_NAME} OpenSSL::Crypto spdlog::spdlog Threads::Threads) # Set some target properties set_target_properties(${UTIL_TARGET_NAME} PROPERTIES OUTPUT_NAME "${NAMESPACE}${UTIL_TARGET_NAME}")