Skip to content

Commit

Permalink
Implement Remote Logging in C Test Server (#92)
Browse files Browse the repository at this point in the history
* Implemented Remote Logging in C Test Server using IXWebSocket library.
* Refactored the code that handles logging.
* Refactored the code related newSession API and made TestServer owns SessionManager and CBLManager object.
* Update XCode project.
* Updated Android project and its CMakeList.txt.
  • Loading branch information
pasin authored Nov 14, 2024
1 parent 2856362 commit 6971d38
Show file tree
Hide file tree
Showing 30 changed files with 1,082 additions and 436 deletions.
12 changes: 9 additions & 3 deletions servers/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_subdirectory(vendor)
get_directory_property(civetweb_SOURCE_DIR DIRECTORY vendor DEFINITION civetweb_SOURCE_DIR)

message(STATUS ${CMAKE_LIBRARY_ARCHITECTURE})
find_package(CouchbaseLite 3.1.0 REQUIRED PATHS lib/libcblite)
find_package(CouchbaseLite 3.2.1 REQUIRED PATHS lib/libcblite)

if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path")
Expand All @@ -27,6 +27,7 @@ set(SOURCE_FILES
src/main.cpp
src/Dispatcher.cpp
src/Request.cpp
src/SessionManager.cpp
src/TestServer.cpp
src/cbl/CBLManager.cpp
src/cbl/CBLReplicationConflictResolver.cpp
Expand All @@ -48,11 +49,13 @@ set(SOURCE_FILES
src/dispatcher/PostStopReplicator.cpp
src/dispatcher/PostUpdateDatabase.cpp
src/dispatcher/PostVerifyDocuments.cpp
src/log/Log.cpp
src/log/RemoteLogger.cpp
src/support/Error.cpp
src/support/Log.cpp
src/support/StringUtil.cpp
src/support/UUID.cpp
src/support/ZipUtil.cpp)
src/support/ZipUtil.cpp
)

add_executable(testserver ${SOURCE_FILES})

Expand All @@ -76,15 +79,18 @@ target_link_libraries(
nlohmann_json::nlohmann_json
cblite
zip
ixwebsocket
)

target_include_directories(
testserver PRIVATE
src
src/cbl
src/dispatcher
src/log
src/support
src/support/ext
src/support/ws
${civetweb_SOURCE_DIR}/include
)

Expand Down
9 changes: 7 additions & 2 deletions servers/c/platforms/android/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set(SHARED_SRC_DIR ${PROJECT_SOURCE_DIR}/shared)
set(SHARED_SRC
${SHARED_SRC_DIR}/Dispatcher.cpp
${SHARED_SRC_DIR}/Request.cpp
${SHARED_SRC_DIR}/SessionManager.cpp
${SHARED_SRC_DIR}/TestServer.cpp
${SHARED_SRC_DIR}/cbl/CBLManager.cpp
${SHARED_SRC_DIR}/cbl/CBLReplicationConflictResolver.cpp
Expand All @@ -32,13 +33,15 @@ set(SHARED_SRC
${SHARED_SRC_DIR}/dispatcher/PostRunQuery.cpp
${SHARED_SRC_DIR}/dispatcher/PostSnapshotDocuments.cpp
${SHARED_SRC_DIR}/dispatcher/PostStartReplicator.cpp
${SHARED_SRC_DIR}/dispatcher/PostStopReplicator.cpp
${SHARED_SRC_DIR}/dispatcher/PostUpdateDatabase.cpp
${SHARED_SRC_DIR}/dispatcher/PostVerifyDocuments.cpp
${SHARED_SRC_DIR}/log/Log.cpp
${SHARED_SRC_DIR}/log/RemoteLogger.cpp
${SHARED_SRC_DIR}/support/Android.cpp
${SHARED_SRC_DIR}/support/Device.cpp
${SHARED_SRC_DIR}/support/Error.cpp
${SHARED_SRC_DIR}/support/Files.cpp
${SHARED_SRC_DIR}/support/Log.cpp
${SHARED_SRC_DIR}/support/StringUtil.cpp
${SHARED_SRC_DIR}/support/UUID.cpp
${SHARED_SRC_DIR}/support/ZipUtil.cpp)
Expand Down Expand Up @@ -68,13 +71,15 @@ target_link_libraries(testserver
civetweb-c-library
nlohmann_json::nlohmann_json
cblite
zip)
zip
ixwebsocket)

target_include_directories(
testserver PRIVATE
${SHARED_SRC_DIR}
${SHARED_SRC_DIR}/cbl
${SHARED_SRC_DIR}/dispatcher
${SHARED_SRC_DIR}/log
${SHARED_SRC_DIR}/support
${SHARED_SRC_DIR}/support/ext
${civetweb_SOURCE_DIR}/include)
Expand Down
Binary file modified servers/c/platforms/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Fri Jun 23 12:35:47 PDT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 6971d38

Please sign in to comment.