Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Using the new WolkSDK-Cpp version v3.4.0 #69

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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cmake-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ jobs:
uses: jidicula/clang-format-action@v3.5.2
with:
clang-format-version: 10
exclude-regex: "WolkSDK-Cpp/core/utilities/nlohmann/json.hpp"
exclude-regex: "WolkSDK-Cpp/core/utility/nlohmann/json.hpp"
31 changes: 8 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.11)
project(WolkAboutConnector C CXX)

set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -49,9 +49,6 @@ if (${BUILD_TESTS})
endif ()
endif ()

# Setup the option for optional Poco file downloader
OPTION(BUILD_POCO_HTTP_DOWNLOADER "Build the optional `FileDownloader` implementation that uses Poco" ON)

# Setup the option for optional apt/systemd firmware updaters
OPTION(BUILD_APT_SYSTEMD_FIRMWARE_UPDATER "Build the optional apt/systemd firmware updaters" OFF)

Expand Down Expand Up @@ -117,7 +114,7 @@ add_subdirectory(WolkSDK-Cpp)

# Define the version of the library
set(WOLKCONNECT_VERSION_MAJOR 4)
set(WOLKCONNECT_VERSION_MINOR 2)
set(WOLKCONNECT_VERSION_MINOR 3)
set(WOLKCONNECT_VERSION_PATCH 0)
set(WOLKCONNECT_VERSION_SUFFIX)

Expand Down Expand Up @@ -162,12 +159,6 @@ set(LIB_HEADER_FILES wolk/api/FeedUpdateHandler.h

file(COPY wolk/ DESTINATION ${CMAKE_LIBRARY_INCLUDE_DIRECTORY}/wolk PATTERN *.cpp EXCLUDE PATTERN "poco/HTTPFileDownloader.h" EXCLUDE)

if (${BUILD_POCO_HTTP_DOWNLOADER})
set(LIB_SOURCE_FILES ${LIB_SOURCE_FILES} wolk/service/file_management/poco/HTTPFileDownloader.cpp)
set(LIB_HEADER_FILES ${LIB_HEADER_FILES} wolk/service/file_management/poco/HTTPFileDownloader.h)
file(COPY wolk/service/file_management/poco/HTTPFileDownloader.h DESTINATION ${CMAKE_LIBRARY_INCLUDE_DIRECTORY}/wolk/service/file_management/poco)
endif ()

if (${BUILD_APT_SYSTEMD_FIRMWARE_UPDATER})
set(LIB_SOURCE_FILES ${LIB_SOURCE_FILES} wolk/service/firmware_update/debian/DebianPackageInstaller.cpp
wolk/service/firmware_update/debian/GenericDBusInterface.cpp
Expand All @@ -184,19 +175,14 @@ if (${BUILD_APT_SYSTEMD_FIRMWARE_UPDATER})
endif ()

add_library(${PROJECT_NAME} SHARED ${LIB_SOURCE_FILES} ${LIB_HEADER_FILES})
target_link_libraries(${PROJECT_NAME} PUBLIC WolkAboutCore Threads::Threads)
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${CMAKE_PREFIX_PATH}/include)
target_link_libraries(${PROJECT_NAME} SDKCore Threads::Threads)
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${CMAKE_BINARY_DIR}/include)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${WOLKCONNECT_VERSION_STRING} SOVERSION ${WOLKCONNECT_VERSION_MAJOR}.${WOLKCONNECT_VERSION_MINOR}.${WOLKCONNECT_VERSION_PATCH})

if (${BUILD_POCO_HTTP_DOWNLOADER})
target_link_libraries(${PROJECT_NAME} PUBLIC PocoFoundation PocoCrypto PocoJSON PocoNet PocoNetSSL PocoUtil)
add_dependencies(${PROJECT_NAME} libpoco)
endif ()

if (${BUILD_APT_SYSTEMD_FIRMWARE_UPDATER})
target_link_libraries(${PROJECT_NAME} PUBLIC ${GLIB_LIBRARIES} ${GIO_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${GLIB_LIBRARIES} ${GIO_LIBRARIES})
target_include_directories(${PROJECT_NAME} PUBLIC ${GLIB_INCLUDE_DIRS} ${GIO_INCLUDE_DIRS})
endif ()

Expand Down Expand Up @@ -232,9 +218,8 @@ if (${BUILD_TESTS})
enable_testing()
add_executable(${PROJECT_NAME}Tests ${TEST_SOURCE_FILES} ${TEST_HEADER_FILES})
target_link_libraries(${PROJECT_NAME}Tests ${PROJECT_NAME} gtest_main gtest gmock_main gmock)
target_include_directories(${PROJECT_NAME}Tests PRIVATE ${PROJECT_SOURCE_DIR} ${CMAKE_LIBRARY_INCLUDE_DIRECTORY} ${CMAKE_PREFIX_PATH}/include WolkSDK-Cpp)
target_include_directories(${PROJECT_NAME}Tests PRIVATE ${PROJECT_SOURCE_DIR} ${CMAKE_LIBRARY_INCLUDE_DIRECTORY} ${CMAKE_BINARY_DIR}/include WolkSDK-Cpp)
set_target_properties(${PROJECT_NAME}Tests PROPERTIES INSTALL_RPATH "$ORIGIN/../lib")
add_dependencies(${PROJECT_NAME}Tests ${PROJECT_NAME} libgtest)

add_test(NAME "WolkConnect-Cpp_Tests" COMMAND ${PROJECT_NAME}Tests)
endif ()
Expand Down Expand Up @@ -300,6 +285,6 @@ endif ()
# Create the install rule
include(GNUInstallDirs)
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}/lib)
install(DIRECTORY ${CMAKE_BINARY_DIR}/include DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN *.h)
install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
3 changes: 3 additions & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

WolkAbout C++11 Connector library for connecting devices to WolkAbout IoT Platform.

**Version 4.3.0-DEV**
- [IMPROVEMENT] - Using new WolkSDK-Cpp version 3.4.0, the full restructure of the SDK library.

**Version 4.2.0**
- [IMPROVEMENT] - Modernized CMake a little bit to with the `target_include_directories`.

Expand Down
2 changes: 1 addition & 1 deletion WolkSDK-Cpp
Submodule WolkSDK-Cpp updated 224 files
5 changes: 0 additions & 5 deletions debian/changelog

This file was deleted.

1 change: 0 additions & 1 deletion debian/compat

This file was deleted.

12 changes: 0 additions & 12 deletions debian/control

This file was deleted.

13 changes: 0 additions & 13 deletions debian/copyright

This file was deleted.

11 changes: 0 additions & 11 deletions debian/rules

This file was deleted.

2 changes: 1 addition & 1 deletion examples/debian-package-installation/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "wolk/WolkBuilder.h"
#include "wolk/WolkSingle.h"
#include "wolk/service/firmware_update/debian/DebianPackageInstaller.h"
Expand Down
4 changes: 2 additions & 2 deletions examples/full_feature/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

#include "core/persistence/inmemory/InMemoryPersistence.h"
#include "core/utilities/FileSystemUtils.h"
#include "core/utilities/Logger.h"
#include "core/utility/FileSystemUtils.h"
#include "core/utility/Logger.h"
#include "wolk/WolkBuilder.h"
#include "wolk/WolkSingle.h"

Expand Down
2 changes: 1 addition & 1 deletion examples/pull/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "wolk/WolkBuilder.h"
#include "wolk/WolkSingle.h"
#include "wolk/api/ParameterHandler.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/register_feed_and_attribute/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "wolk/WolkBuilder.h"
#include "wolk/WolkSingle.h"

Expand Down
2 changes: 1 addition & 1 deletion examples/simple/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "wolk/WolkBuilder.h"
#include "wolk/WolkSingle.h"

Expand Down
2 changes: 1 addition & 1 deletion examples/subdevices/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "wolk/WolkBuilder.h"
#include "wolk/WolkMulti.h"

Expand Down
9 changes: 0 additions & 9 deletions out/coverage.sh

This file was deleted.

9 changes: 0 additions & 9 deletions out/manage-units.pkla

This file was deleted.

2 changes: 1 addition & 1 deletion tests/DataServiceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "core/Types.h"
#include "core/model/Feed.h"
#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "tests/mocks/ConnectivityServiceMock.h"
#include "tests/mocks/DataProtocolMock.h"
#include "tests/mocks/OutboundMessageHandlerMock.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/ErrorServiceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#undef private
#undef protected

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "tests/mocks/ErrorProtocolMock.h"

#include <gtest/gtest.h>
Expand Down
4 changes: 2 additions & 2 deletions tests/FileManagementServiceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#undef private
#undef protected

#include "core/utilities/FileSystemUtils.h"
#include "core/utilities/Logger.h"
#include "core/utility/FileSystemUtils.h"
#include "core/utility/Logger.h"
#include "tests/mocks/ConnectivityServiceMock.h"
#include "tests/mocks/DataProtocolMock.h"
#include "tests/mocks/DataServiceMock.h"
Expand Down
6 changes: 4 additions & 2 deletions tests/FileTransferSessionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "core/model/messages/FileBinaryResponseMessage.h"
#include "core/model/messages/FileUploadInitiateMessage.h"
#include "core/model/messages/FileUrlDownloadInitMessage.h"
#include "core/utilities/Logger.h"
#include "core/utilities/Timer.h"
#include "core/utility/Logger.h"
#include "core/utility/Timer.h"
#include "tests/mocks/FileDownloaderMock.h"

#include <gtest/gtest.h>
Expand All @@ -46,6 +46,8 @@ class FileTransferSessionTests : public ::testing::Test
fileDownloaderMock = std::make_shared<FileDownloaderMock>();
}

static void TearDownTestCase() { fileDownloaderMock.reset(); }

static std::shared_ptr<FileDownloaderMock> fileDownloaderMock;

const std::string DEVICE_KEY = "DEVICE_KEY";
Expand Down
4 changes: 2 additions & 2 deletions tests/FirmwareUpdateServiceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#undef private
#undef protected

#include "core/utilities/FileSystemUtils.h"
#include "core/utilities/Logger.h"
#include "core/utility/FileSystemUtils.h"
#include "core/utility/Logger.h"
#include "tests/mocks/ConnectivityServiceMock.h"
#include "tests/mocks/DataProtocolMock.h"
#include "tests/mocks/DataServiceMock.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/InboundPlatformMessageHandlerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion tests/PlatformStatusServiceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#undef private
#undef protected

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "tests/mocks/PlatformStatusListenerMock.h"
#include "tests/mocks/PlatformStatusProtocolMock.h"

Expand Down
4 changes: 2 additions & 2 deletions tests/RegistrationServiceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#undef private
#undef protected

#include "core/utilities/Logger.h"
#include "core/utilities/Timer.h"
#include "core/utility/Logger.h"
#include "core/utility/Timer.h"
#include "tests/mocks/ConnectivityServiceMock.h"
#include "tests/mocks/ErrorProtocolMock.h"
#include "tests/mocks/ErrorServiceMock.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/WolkBuilderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#undef private
#undef protected

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "tests/mocks/DataProtocolMock.h"
#include "tests/mocks/ErrorProtocolMock.h"
#include "tests/mocks/FeedUpdateHandlerMock.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/WolkMultiTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#undef private
#undef protected

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "tests/mocks/ConnectivityServiceMock.h"
#include "tests/mocks/DataProtocolMock.h"
#include "tests/mocks/DataServiceMock.h"
Expand Down
2 changes: 1 addition & 1 deletion tests/WolkSingleTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#undef private
#undef protected

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "tests/mocks/ConnectivityServiceMock.h"
#include "tests/mocks/DataProtocolMock.h"
#include "tests/mocks/DataServiceMock.h"
Expand Down
2 changes: 1 addition & 1 deletion wolk/WolkBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "core/protocol/wolkabout/WolkaboutFirmwareUpdateProtocol.h"
#include "core/protocol/wolkabout/WolkaboutPlatformStatusProtocol.h"
#include "core/protocol/wolkabout/WolkaboutRegistrationProtocol.h"
#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "wolk/WolkMulti.h"
#include "wolk/WolkSingle.h"
#include "wolk/service/data/DataService.h"
Expand Down
2 changes: 1 addition & 1 deletion wolk/WolkInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "core/protocol/FirmwareUpdateProtocol.h"
#include "core/protocol/PlatformStatusProtocol.h"
#include "core/protocol/RegistrationProtocol.h"
#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"
#include "wolk/service/data/DataService.h"
#include "wolk/service/file_management/FileManagementService.h"
#include "wolk/service/firmware_update/FirmwareUpdateService.h"
Expand Down
2 changes: 1 addition & 1 deletion wolk/WolkInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define WOLK_INTERFACE_H

#include "core/model/Reading.h"
#include "core/utilities/CommandBuffer.h"
#include "core/utility/CommandBuffer.h"
#include "wolk/WolkInterfaceType.h"
#include "wolk/api/FeedUpdateHandler.h"
#include "wolk/api/ParameterHandler.h"
Expand Down
2 changes: 1 addition & 1 deletion wolk/WolkMulti.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "wolk/WolkMulti.h"

#include "core/utilities/Logger.h"
#include "core/utility/Logger.h"

#include <algorithm>
#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion wolk/WolkMulti.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define WOLK_MULTI_H

#include "core/connectivity/InboundPlatformMessageHandler.h"
#include "core/utilities/StringUtils.h"
#include "core/utility/StringUtils.h"
#include "wolk/WolkBuilder.h"
#include "wolk/WolkInterface.h"

Expand Down
2 changes: 1 addition & 1 deletion wolk/WolkSingle.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "core/connectivity/ConnectivityService.h"
#include "core/model/Device.h"
#include "core/utilities/StringUtils.h"
#include "core/utility/StringUtils.h"
#include "wolk/WolkInterface.h"

#include <algorithm>
Expand Down
Loading