Skip to content

Commit

Permalink
Merge pull request #32 from Kicer86/remove_backward_compatibility
Browse files Browse the repository at this point in the history
Remove deprecated items
  • Loading branch information
Kicer86 authored Dec 4, 2023
2 parents 28f9a9a + 98cd93e commit 934f3f7
Show file tree
Hide file tree
Showing 17 changed files with 16 additions and 325 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux-build-qt5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
build-dir: ${{ runner.workspace }}/build
build-type: Release
configure-options: -DGitHubAPI_Tests=ON -DGitHubAPI_UseQt6=OFF
configure-options: -DCppRestAPI_Tests=ON -DCppRestAPI_UseQt6=OFF
run-test: true

- name: Build Examples
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linux-build-qt6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
build-dir: ${{ runner.workspace }}/build
build-type: Release
configure-options: -DGitHubAPI_Tests=ON -DGitHubAPI_UseQt6=ON
configure-options: -DCppRestAPI_Tests=ON -DCppRestAPI_UseQt6=ON
run-test: true

- name: Build Examples
Expand All @@ -45,4 +45,4 @@ jobs:
source-dir: ${{ github.workspace }}/examples
build-dir: ${{ runner.workspace }}/build-examples
build-type: Release
configure-options: -DGitHubAPI_UseQt6=ON
configure-options: -DCppRestAPI_UseQt6=ON
15 changes: 0 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(GenerateExportHeader)

# For compatibility. TODO: remove
if(GitHubAPI_QtBackend)
set(CppRestAPI_QtBackend ${GitHubAPI_QtBackend})
message(WARNING "GitHubAPI_QtBackend is deprecated, please use CppRestAPI_QtBackend")
endif()
if(GitHubAPI_CurlBackend)
set(CppRestAPI_CurlBackend ${GitHubAPI_CurlBackend})
message(WARNING "GitHubAPI_CurlBackend is deprecated, please use CppRestAPI_CurlBackend")
endif()
if(GitHubAPI_Tests)
set(CppRestAPI_Tests ${GitHubAPI_Tests})
message(WARNING "GitHubAPI_Tests is deprecated, please use CppRestAPI_Tests")
endif()

option(CppRestAPI_QtBackend "Qt backend for GitHubApi" OFF)
option(CppRestAPI_CurlBackend "libcurl backend for GitHubApi" OFF)
option(CppRestAPI_Tests "Enable GitHubApi tests. Forces both CppRestAPI_QtBackend and CppRestAPI_CurlBackend to be ON" OFF)
Expand All @@ -47,7 +33,6 @@ endif()
add_library(cpp_restapi
src/base_connection.cpp
src/header_utils.cpp
src/services/github/github_api_base.cpp
src/services/github/request.cpp
)

Expand Down
19 changes: 3 additions & 16 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,16 @@ if (NOT Qt6_FOUND)
find_package(Qt5 REQUIRED COMPONENTS Network Core)
endif()

set(GitHubAPI_UseQt6 ${Qt6_FOUND})
set(GitHubAPI_QtBackend ON)
set(GitHubAPI_CurlBackend ON)
set(CppRestAPI_UseQt6 ${Qt6_FOUND})
set(CppRestAPI_QtBackend ON)
set(CppRestAPI_CurlBackend ON)
add_subdirectory(.. cpp_restapi_root) #include directory with github_api

add_executable(deprecated_qt_example deprecated_qt_example.cpp)
add_executable(deprecated_curl_example deprecated_curl_example.cpp)
add_executable(qt_example qt_example.cpp)
add_executable(curl_example curl_example.cpp)
add_executable(bare_curl_connection_example bare_curl_connection_example.cpp)
add_executable(bare_qt_connection_example bare_qt_connection_example.cpp)

target_link_libraries(deprecated_qt_example
PRIVATE
github_api
Qt::Network
)

target_link_libraries(deprecated_curl_example
PRIVATE
github_api
)

target_link_libraries(qt_example
PRIVATE
github_api
Expand Down
21 changes: 0 additions & 21 deletions include/cpp_restapi/github/github_api_base.hpp

This file was deleted.

30 changes: 0 additions & 30 deletions include/cpp_restapi/github/github_api_curl.hpp

This file was deleted.

41 changes: 0 additions & 41 deletions include/cpp_restapi/github/github_api_qt.hpp

This file was deleted.

37 changes: 0 additions & 37 deletions include/cpp_restapi/github/igithub_api.hpp

This file was deleted.

5 changes: 0 additions & 5 deletions include/github_api/github_api_curl.hpp

This file was deleted.

5 changes: 0 additions & 5 deletions include/github_api/github_api_qt.hpp

This file was deleted.

3 changes: 0 additions & 3 deletions include/github_api/request.hpp

This file was deleted.

2 changes: 0 additions & 2 deletions src/curl_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ find_package(CURL REQUIRED)

target_sources(cpp_restapi
PRIVATE
${PROJECT_SOURCE_DIR}/include/github_api/github_api_curl.hpp
connection.cpp
github_api.cpp
)

target_link_libraries(cpp_restapi
Expand Down
34 changes: 0 additions & 34 deletions src/curl_backend/github_api.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions src/qt_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@

# For compatibility. TODO: remove
if(GitHubAPI_UseQt6)
set(CppRestAPI_UseQt6 ${GitHubAPI_UseQt6})
message(WARNING "GitHubAPI_UseQt6 is deprecated, please use CppRestAPI_UseQt6")
endif()

if(CppRestAPI_UseQt6)
find_package(Qt6 REQUIRED COMPONENTS Core Network)
else()
find_package(Qt5 5.15 REQUIRED COMPONENTS Core Network)
endif()

target_sources(cpp_restapi PRIVATE
${PROJECT_SOURCE_DIR}/include/github_api/github_api_qt.hpp
connection.cpp
github_api.cpp
)

target_link_libraries(cpp_restapi
Expand Down
27 changes: 0 additions & 27 deletions src/qt_backend/github_api.cpp

This file was deleted.

18 changes: 0 additions & 18 deletions src/services/github/github_api_base.cpp

This file was deleted.

Loading

0 comments on commit 934f3f7

Please sign in to comment.