diff --git a/BUILD.md b/BUILD.md index 7579ed487..3959e420c 100644 --- a/BUILD.md +++ b/BUILD.md @@ -327,7 +327,7 @@ to select only specific tests for the purpose of the coverage report, by setting the `coverage_test` variable in `cmake` The default coverage report format is `html-details`, but the user -can override it to any of the formats listed in `Builds/CMake/CodeCoverage.cmake` +can override it to any of the formats listed in `cmake/CodeCoverage.cmake` by setting the `coverage_format` variable in `cmake`. It is also possible to generate more than one format at a time by setting the `coverage_extra_args` variable in `cmake`. The specific command line used to run the `gcovr` tool will be diff --git a/CMakeLists.txt b/CMakeLists.txt index d02d73111..86d26588c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,8 +51,8 @@ if(CMAKE_TOOLCHAIN_FILE) endif() if (NOT USE_CONAN) - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake") - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/deps") + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/deps") endif() include (CheckCXXCompilerFlag) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 29c4297df..61d94424e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,12 +57,12 @@ Ensure that your code compiles according to the build instructions in the [`documentation`](https://docs.xahau.network/infrastructure/building-xahau). If you create new source files, they must go under `src/ripple`. You will need to add them to one of the -[source lists](./Builds/CMake/RippledCore.cmake) in CMake. +[source lists](./cmake/RippledCore.cmake) in CMake. Please write tests for your code. If you create new test source files, they must go under `src/test`. You will need to add them to one of the -[source lists](./Builds/CMake/RippledCore.cmake) in CMake. +[source lists](./cmake/RippledCore.cmake) in CMake. If your test can be run offline, in under 60 seconds, then it can be an automatic test run by `rippled --unittest`. Otherwise, it must be a manual test. diff --git a/build-core.sh b/build-core.sh index 4345b4f74..8f7af3d26 100755 --- a/build-core.sh +++ b/build-core.sh @@ -27,8 +27,8 @@ if [[ "$?" -ne "0" ]]; then exit 127 fi -perl -i -pe "s/^(\\s*)-DBUILD_SHARED_LIBS=OFF/\\1-DBUILD_SHARED_LIBS=OFF\\n\\1-DROCKSDB_BUILD_SHARED=OFF/g" Builds/CMake/deps/Rocksdb.cmake && -mv Builds/CMake/deps/WasmEdge.cmake Builds/CMake/deps/WasmEdge.old && +perl -i -pe "s/^(\\s*)-DBUILD_SHARED_LIBS=OFF/\\1-DBUILD_SHARED_LIBS=OFF\\n\\1-DROCKSDB_BUILD_SHARED=OFF/g" cmake/deps/Rocksdb.cmake && +mv cmake/deps/WasmEdge.cmake cmake/deps/WasmEdge.old && echo "find_package(LLVM REQUIRED CONFIG) message(STATUS \"Found LLVM \${LLVM_PACKAGE_VERSION}\") message(STATUS \"Using LLVMConfig.cmake in: \${LLVM_DIR}\") @@ -37,7 +37,7 @@ set_target_properties(wasmedge PROPERTIES IMPORTED_LOCATION \${WasmEdge_LIB}) target_link_libraries (ripple_libs INTERFACE wasmedge) add_library (wasmedge::wasmedge ALIAS wasmedge) message(\"WasmEdge DONE\") -" > Builds/CMake/deps/WasmEdge.cmake && +" > cmake/deps/WasmEdge.cmake && git checkout src/ripple/protocol/impl/BuildInfo.cpp && sed -i s/\"0.0.0\"/\"$(date +%Y).$(date +%-m).$(date +%-d)-$(git rev-parse --abbrev-ref HEAD)+$4\"/g src/ripple/protocol/impl/BuildInfo.cpp && cd release-build && @@ -69,8 +69,8 @@ fi cd ..; mv src/ripple/net/impl/RegisterSSLCerts.cpp.old src/ripple/net/impl/RegisterSSLCerts.cpp; -mv Builds/CMake/deps/Rocksdb.cmake.old Builds/CMake/deps/Rocksdb.cmake; -mv Builds/CMake/deps/WasmEdge.old Builds/CMake/deps/WasmEdge.cmake; +mv cmake/deps/Rocksdb.cmake.old cmake/deps/Rocksdb.cmake; +mv cmake/deps/WasmEdge.old cmake/deps/WasmEdge.cmake; echo "END INSIDE CONTAINER - CORE" diff --git a/build-full.sh b/build-full.sh index 643adfb13..73bafdf5d 100644 --- a/build-full.sh +++ b/build-full.sh @@ -155,7 +155,7 @@ cp -r include/api/wasmedge /usr/include/ && cd /io/ && echo "-- Build Rippled --" && pwd && -cp Builds/CMake/deps/Rocksdb.cmake Builds/CMake/deps/Rocksdb.cmake.old && +cp cmake/deps/Rocksdb.cmake cmake/deps/Rocksdb.cmake.old && echo "MOVING TO [ build-core.sh ]" cd /io; diff --git a/cmake/deps/Rocksdb.cmake b/cmake/deps/Rocksdb.cmake index 2c832c593..4b1607b3d 100644 --- a/cmake/deps/Rocksdb.cmake +++ b/cmake/deps/Rocksdb.cmake @@ -64,13 +64,13 @@ if (local_rocksdb) PATCH_COMMAND # only used by windows build ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/rocks_thirdparty.inc + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/rocks_thirdparty.inc /thirdparty.inc COMMAND # fixup their build version file to keep the values # from changing always ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/rocksdb_build_version.cc.in + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/rocksdb_build_version.cc.in /util/build_version.cc.in CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} diff --git a/cmake/deps/Soci.cmake b/cmake/deps/Soci.cmake index d165d6e1f..44c3ca7cf 100644 --- a/cmake/deps/Soci.cmake +++ b/cmake/deps/Soci.cmake @@ -52,7 +52,7 @@ else() # whenever we update the GIT_TAG above. PATCH_COMMAND ${CMAKE_COMMAND} -D RIPPLED_SOURCE=${CMAKE_CURRENT_SOURCE_DIR} - -P ${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/soci_patch.cmake + -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/soci_patch.cmake CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} @@ -61,7 +61,7 @@ else() $<$:-DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}> $<$:-DCMAKE_UNITY_BUILD=ON}> -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/sqlite3 - -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake + -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake -DCMAKE_INCLUDE_PATH=$,::> -DCMAKE_LIBRARY_PATH=${sqlite_BINARY_DIR} -DCMAKE_DEBUG_POSTFIX=_d diff --git a/cmake/deps/Sqlite.cmake b/cmake/deps/Sqlite.cmake index 7b34c1121..7036b5dd7 100644 --- a/cmake/deps/Sqlite.cmake +++ b/cmake/deps/Sqlite.cmake @@ -37,7 +37,7 @@ else() # for the single amalgamation source file. PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake/CMake_sqlite3.txt + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMake_sqlite3.txt /CMakeLists.txt CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} diff --git a/cmake/soci_patch.cmake b/cmake/soci_patch.cmake index 0c2a75c0d..543c210d5 100644 --- a/cmake/soci_patch.cmake +++ b/cmake/soci_patch.cmake @@ -8,7 +8,7 @@ # those warnings. if (RIPPLED_SOURCE) execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${RIPPLED_SOURCE}/Builds/CMake/SociConfig.cmake.patched + ${RIPPLED_SOURCE}/cmake/SociConfig.cmake.patched cmake/SociConfig.cmake ) endif () diff --git a/src/xrpld/app/hook/Enum.h b/include/xrpl/hook/Enum.h similarity index 100% rename from src/xrpld/app/hook/Enum.h rename to include/xrpl/hook/Enum.h diff --git a/src/xrpld/app/hook/Guard.h b/include/xrpl/hook/Guard.h similarity index 100% rename from src/xrpld/app/hook/Guard.h rename to include/xrpl/hook/Guard.h diff --git a/src/xrpld/app/hook/Macro.h b/include/xrpl/hook/Macro.h similarity index 100% rename from src/xrpld/app/hook/Macro.h rename to include/xrpl/hook/Macro.h diff --git a/src/xrpld/app/hook/Misc.h b/include/xrpl/hook/Misc.h similarity index 100% rename from src/xrpld/app/hook/Misc.h rename to include/xrpl/hook/Misc.h diff --git a/src/xrpld/app/hook/guard_checker.cpp b/include/xrpl/hook/guard_checker.cpp similarity index 100% rename from src/xrpld/app/hook/guard_checker.cpp rename to include/xrpl/hook/guard_checker.cpp diff --git a/src/xrpld/app/hook/makefile b/include/xrpl/hook/makefile similarity index 100% rename from src/xrpld/app/hook/makefile rename to include/xrpl/hook/makefile diff --git a/src/xrpld/app/hook/xahau.h b/include/xrpl/hook/xahau.h similarity index 100% rename from src/xrpld/app/hook/xahau.h rename to include/xrpl/hook/xahau.h diff --git a/include/xrpl/protocol/Import.h b/include/xrpl/protocol/Import.h index 26f5b7463..795493b48 100644 --- a/include/xrpl/protocol/Import.h +++ b/include/xrpl/protocol/Import.h @@ -21,7 +21,7 @@ #define RIPPLE_PROTOCOL_IMPORT_H_INCLUDED // #include -#include +#include #include #include #include diff --git a/include/xrpl/server/UDPDoor.h b/include/xrpl/server/detail/UDPDoor.h similarity index 100% rename from include/xrpl/server/UDPDoor.h rename to include/xrpl/server/detail/UDPDoor.h diff --git a/src/libxrpl/protocol/STTx.cpp b/src/libxrpl/protocol/STTx.cpp index daef1a0af..30fb4a168 100644 --- a/src/libxrpl/protocol/STTx.cpp +++ b/src/libxrpl/protocol/STTx.cpp @@ -17,13 +17,12 @@ */ //============================================================================== -#include #include #include #include #include +#include #include -#include #include #include #include diff --git a/src/test/app/SetHookTSH_test.cpp b/src/test/app/SetHookTSH_test.cpp index 9fc7d435d..a03cde0f5 100644 --- a/src/test/app/SetHookTSH_test.cpp +++ b/src/test/app/SetHookTSH_test.cpp @@ -21,10 +21,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include diff --git a/src/test/app/SetHook_test.cpp b/src/test/app/SetHook_test.cpp index d00317f8b..9093a1ae9 100644 --- a/src/test/app/SetHook_test.cpp +++ b/src/test/app/SetHook_test.cpp @@ -20,9 +20,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/src/test/app/Touch_test.cpp b/src/test/app/Touch_test.cpp index 269c898f2..cbec4d458 100644 --- a/src/test/app/Touch_test.cpp +++ b/src/test/app/Touch_test.cpp @@ -21,9 +21,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/src/test/jtx/impl/hook.cpp b/src/test/jtx/impl/hook.cpp index 3b4ad33eb..e39af2eb7 100644 --- a/src/test/jtx/impl/hook.cpp +++ b/src/test/jtx/impl/hook.cpp @@ -18,8 +18,8 @@ //============================================================================== #include -#include #include +#include #include #include diff --git a/src/test/rpc/AccountObjects_test.cpp b/src/test/rpc/AccountObjects_test.cpp index dc26c871b..d97859613 100644 --- a/src/test/rpc/AccountObjects_test.cpp +++ b/src/test/rpc/AccountObjects_test.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/test/rpc/AccountTx_test.cpp b/src/test/rpc/AccountTx_test.cpp index 6633875ae..79aa17ecf 100644 --- a/src/test/rpc/AccountTx_test.cpp +++ b/src/test/rpc/AccountTx_test.cpp @@ -18,9 +18,9 @@ //============================================================================== #include -#include #include #include +#include #include #include diff --git a/src/test/rpc/LedgerRPC_test.cpp b/src/test/rpc/LedgerRPC_test.cpp index 47f30d374..e0481e619 100644 --- a/src/test/rpc/LedgerRPC_test.cpp +++ b/src/test/rpc/LedgerRPC_test.cpp @@ -23,11 +23,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/src/test/unit_test/FileDirGuard.h b/src/test/unit_test/FileDirGuard.h index 246ac2623..94676ce6d 100644 --- a/src/test/unit_test/FileDirGuard.h +++ b/src/test/unit_test/FileDirGuard.h @@ -23,6 +23,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include +#include namespace ripple { namespace test { diff --git a/src/xrpld/app/hook/applyHook.h b/src/xrpld/app/hook/applyHook.h index f219757c8..a64852891 100644 --- a/src/xrpld/app/hook/applyHook.h +++ b/src/xrpld/app/hook/applyHook.h @@ -1,12 +1,12 @@ #ifndef APPLY_HOOK_INCLUDED #define APPLY_HOOK_INCLUDED 1 -#include -#include -#include #include #include #include #include +#include +#include +#include #include #include #include diff --git a/src/xrpld/app/tx/detail/Change.cpp b/src/xrpld/app/tx/detail/Change.cpp index f2387f179..d7fa1edaa 100644 --- a/src/xrpld/app/tx/detail/Change.cpp +++ b/src/xrpld/app/tx/detail/Change.cpp @@ -17,7 +17,6 @@ */ //============================================================================== -#include #include #include #include @@ -28,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/tx/detail/SetHook.cpp b/src/xrpld/app/tx/detail/SetHook.cpp index a83684df3..13b39290a 100644 --- a/src/xrpld/app/tx/detail/SetHook.cpp +++ b/src/xrpld/app/tx/detail/SetHook.cpp @@ -19,14 +19,14 @@ #include -#include -#include #include #include #include #include #include #include +#include +#include #include #include #include diff --git a/src/xrpld/app/tx/detail/SetHook.h b/src/xrpld/app/tx/detail/SetHook.h index 42dde5f98..979968e29 100644 --- a/src/xrpld/app/tx/detail/SetHook.h +++ b/src/xrpld/app/tx/detail/SetHook.h @@ -20,7 +20,6 @@ #ifndef RIPPLE_TX_SETHOOK_H_INCLUDED #define RIPPLE_TX_SETHOOK_H_INCLUDED -#include #include #include #include @@ -28,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/tx/detail/Transactor.cpp b/src/xrpld/app/tx/detail/Transactor.cpp index f06c0a496..323233f65 100644 --- a/src/xrpld/app/tx/detail/Transactor.cpp +++ b/src/xrpld/app/tx/detail/Transactor.cpp @@ -17,7 +17,6 @@ */ //============================================================================== -#include #include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/tx/detail/XahauGenesis.h b/src/xrpld/app/tx/detail/XahauGenesis.h index 79973fb67..5ff91ec08 100644 --- a/src/xrpld/app/tx/detail/XahauGenesis.h +++ b/src/xrpld/app/tx/detail/XahauGenesis.h @@ -1,7 +1,7 @@ namespace XahauGenesis { // the wasm bytecode is loaded from this file as vec GovernanceHook and // RewardHook -#include +#include using namespace ripple;