Skip to content

Commit

Permalink
feat build: move the sources from 'shared' to 'universal' directory
Browse files Browse the repository at this point in the history
Tests: протестировано CI
  • Loading branch information
apolukhin committed Jul 7, 2023
1 parent 4fea138 commit 3e9d8f7
Show file tree
Hide file tree
Showing 436 changed files with 10 additions and 23 deletions.
4 changes: 2 additions & 2 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ set_property(

target_include_directories(${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../shared/src/
${CMAKE_CURRENT_SOURCE_DIR}/../universal/src/
${CMAKE_CURRENT_SOURCE_DIR}/src/
${CMAKE_CURRENT_BINARY_DIR}
)
Expand All @@ -194,7 +194,7 @@ if (USERVER_IS_THE_ROOT_PROJECT OR USERVER_FEATURE_UTEST)
target_include_directories(userver-core-internal PUBLIC
$<TARGET_PROPERTY:${PROJECT_NAME},INCLUDE_DIRECTORIES>
${CMAKE_CURRENT_SOURCE_DIR}/internal/include
${CMAKE_CURRENT_SOURCE_DIR}/../shared/internal/include
${CMAKE_CURRENT_SOURCE_DIR}/../universal/internal/include
)
target_link_libraries(userver-core-internal
PUBLIC
Expand Down
5 changes: 2 additions & 3 deletions core/src/logging/log_message_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ TEST_F(LoggingTest, LogFormat) {
utils::regex_match(GetStreamString(), utils::regex(kExpectedPattern)))
<< GetStreamString();

EXPECT_TRUE(GetStreamString().find(" ( /") == std::string::npos)
<< "Path shortening for logs stopped working. The log: "
<< GetStreamString();
EXPECT_THAT(GetStreamString(), testing::Not(testing::HasSubstr(" ( /")))
<< "Path shortening for logs stopped working.";
}

TEST_F(LoggingTest, FloatingPoint) {
Expand Down
5 changes: 0 additions & 5 deletions shared/README.md

This file was deleted.

12 changes: 3 additions & 9 deletions universal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,19 @@ if (TARGET userver-core)
endif()

file(GLOB_RECURSE SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/../shared/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../shared/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
)

file(GLOB_RECURSE UNIT_TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/../shared/*_test.cpp
${CMAKE_CURRENT_SOURCE_DIR}/*_test.cpp
)
file(GLOB_RECURSE BENCH_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/../shared/*_benchmark.cpp
${CMAKE_CURRENT_SOURCE_DIR}/*_benchmark.cpp
)
file(GLOB_RECURSE INTERNAL_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/../shared/internal/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../shared/internal/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/internal/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/internal/*.hpp
)
list(REMOVE_ITEM SOURCES ${UNIT_TEST_SOURCES} ${BENCH_SOURCES} ${INTERNAL_SOURCES})

Expand Down Expand Up @@ -141,11 +137,9 @@ endif()

target_include_directories(${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../shared/include
${CMAKE_CURRENT_SOURCE_DIR}/include
${USERVER_THIRD_PARTY_DIRS}/date/include
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../shared/src/
${CMAKE_CURRENT_SOURCE_DIR}/src/
${CMAKE_CURRENT_BINARY_DIR}
)
Expand Down Expand Up @@ -191,7 +185,7 @@ if (USERVER_IS_THE_ROOT_PROJECT)
target_compile_definitions(${PROJECT_NAME}-internal PUBLIC $<TARGET_PROPERTY:${PROJECT_NAME},COMPILE_DEFINITIONS>)
target_include_directories(${PROJECT_NAME}-internal PUBLIC
$<TARGET_PROPERTY:${PROJECT_NAME},INCLUDE_DIRECTORIES>
${CMAKE_CURRENT_SOURCE_DIR}/../shared/internal/include
${CMAKE_CURRENT_SOURCE_DIR}/internal/include
)
target_link_libraries(${PROJECT_NAME}-internal
PUBLIC
Expand Down
7 changes: 3 additions & 4 deletions universal/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# userver: Universal Functionality

This folder takes `../shared` and creates a separate CMake target out of it.

`userver-universal` target can be used by projects that want to reuse some
userver utils without including the asynchronous engine.
userver utils without including the asynchronous engine and coroutines.

It should NOT be used alongside `../core`.
All the functions and types that do not depend on asynchronous engine
should go here.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3e9d8f7

Please sign in to comment.