diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/.drone.yml b/.github/external_ci/.drone.yml similarity index 100% rename from .drone.yml rename to .github/external_ci/.drone.yml diff --git a/appveyor.yml b/.github/external_ci/appveyor.yml similarity index 100% rename from appveyor.yml rename to .github/external_ci/appveyor.yml diff --git a/Makefile b/Makefile index 597c609cb..390e76069 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ doctest: run_benchmarks: rm -fr cmake-build-benchmarks mkdir cmake-build-benchmarks - cd cmake-build-benchmarks ; cmake ../benchmarks -GNinja -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=On + cd cmake-build-benchmarks ; cmake ../test/benchmarks -GNinja -DCMAKE_BUILD_TYPE=Release cd cmake-build-benchmarks ; ninja cd cmake-build-benchmarks ; ./json_benchmarks @@ -170,7 +170,7 @@ amalgamate: $(AMALGAMATED_FILE) # call the amalgamation tool and pretty print $(AMALGAMATED_FILE): $(SRCS) - third_party/amalgamate/amalgamate.py -c third_party/amalgamate/config.json -s . --verbose=yes + tools/amalgamate/amalgamate.py -c tools/amalgamate/config.json -s . --verbose=yes $(MAKE) pretty # check if file single_include/nlohmann/json.hpp has been amalgamated from the nlohmann sources diff --git a/cmake/ci.cmake b/cmake/ci.cmake index 5ae05a9d9..0d29c6159 100644 --- a/cmake/ci.cmake +++ b/cmake/ci.cmake @@ -544,14 +544,14 @@ file(GLOB_RECURSE INDENT_FILES ${PROJECT_SOURCE_DIR}/include/nlohmann/*.hpp ${PROJECT_SOURCE_DIR}/test/src/*.cpp ${PROJECT_SOURCE_DIR}/test/src/*.hpp - ${PROJECT_SOURCE_DIR}/benchmarks/src/benchmarks.cpp + ${PROJECT_SOURCE_DIR}/test/benchmarks/src/benchmarks.cpp ${PROJECT_SOURCE_DIR}/doc/examples/*.cpp ) add_custom_target(ci_test_amalgamation COMMAND rm -fr ${PROJECT_SOURCE_DIR}/single_include/nlohmann/json.hpp~ COMMAND cp ${PROJECT_SOURCE_DIR}/single_include/nlohmann/json.hpp ${PROJECT_SOURCE_DIR}/single_include/nlohmann/json.hpp~ - COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/third_party/amalgamate/amalgamate.py -c ${PROJECT_SOURCE_DIR}/third_party/amalgamate/config.json -s . + COMMAND ${Python3_EXECUTABLE} ../tools/amalgamate/amalgamate.py -c ../tools/amalgamate/config.json -s . COMMAND ${ASTYLE_TOOL} ${ASTYLE_FLAGS} --suffix=none --quiet ${PROJECT_SOURCE_DIR}/single_include/nlohmann/json.hpp COMMAND diff ${PROJECT_SOURCE_DIR}/single_include/nlohmann/json.hpp~ ${PROJECT_SOURCE_DIR}/single_include/nlohmann/json.hpp @@ -559,7 +559,7 @@ add_custom_target(ci_test_amalgamation COMMAND cd ${PROJECT_SOURCE_DIR} && for FILE in `find . -name '*.orig'`\; do false \; done WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - COMMENT "Check amalagamation and indentation" + COMMENT "Check amalgamation and indentation" ) ############################################################################### @@ -605,7 +605,7 @@ add_custom_target(ci_cppcheck ############################################################################### add_custom_target(ci_cpplint - COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/third_party/cpplint/cpplint.py --filter=-whitespace,-legal,-runtime/references,-runtime/explicit,-runtime/indentation_namespace,-readability/casting,-readability/nolint --quiet --recursive ${SRC_FILES} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/cpplint/cpplint.py --filter=-whitespace,-legal,-runtime/references,-runtime/explicit,-runtime/indentation_namespace,-readability/casting,-readability/nolint --quiet --recursive ${SRC_FILES} COMMENT "Check code with cpplint" ) diff --git a/benchmarks/CMakeLists.txt b/test/benchmarks/CMakeLists.txt similarity index 88% rename from benchmarks/CMakeLists.txt rename to test/benchmarks/CMakeLists.txt index 325904d12..92ff0ea7b 100644 --- a/benchmarks/CMakeLists.txt +++ b/test/benchmarks/CMakeLists.txt @@ -23,6 +23,7 @@ if(NOT benchmark_POPULATED) endif() # download test data +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake ${CMAKE_MODULE_PATH}) include(download_test_data) # benchmark binary @@ -30,4 +31,4 @@ add_executable(json_benchmarks src/benchmarks.cpp) target_compile_features(json_benchmarks PRIVATE cxx_std_11) target_link_libraries(json_benchmarks benchmark ${CMAKE_THREAD_LIBS_INIT}) add_dependencies(json_benchmarks download_test_data) -target_include_directories(json_benchmarks PRIVATE ${CMAKE_SOURCE_DIR}/../single_include ${CMAKE_BINARY_DIR}/include) +target_include_directories(json_benchmarks PRIVATE ${CMAKE_SOURCE_DIR}/../../single_include ${CMAKE_BINARY_DIR}/include) diff --git a/benchmarks/src/benchmarks.cpp b/test/benchmarks/src/benchmarks.cpp similarity index 100% rename from benchmarks/src/benchmarks.cpp rename to test/benchmarks/src/benchmarks.cpp diff --git a/third_party/amalgamate/CHANGES.md b/tools/amalgamate/CHANGES.md similarity index 100% rename from third_party/amalgamate/CHANGES.md rename to tools/amalgamate/CHANGES.md diff --git a/third_party/amalgamate/LICENSE.md b/tools/amalgamate/LICENSE.md similarity index 100% rename from third_party/amalgamate/LICENSE.md rename to tools/amalgamate/LICENSE.md diff --git a/third_party/amalgamate/README.md b/tools/amalgamate/README.md similarity index 100% rename from third_party/amalgamate/README.md rename to tools/amalgamate/README.md diff --git a/third_party/amalgamate/amalgamate.py b/tools/amalgamate/amalgamate.py similarity index 100% rename from third_party/amalgamate/amalgamate.py rename to tools/amalgamate/amalgamate.py diff --git a/third_party/amalgamate/config.json b/tools/amalgamate/config.json similarity index 100% rename from third_party/amalgamate/config.json rename to tools/amalgamate/config.json diff --git a/third_party/cpplint/LICENSE b/tools/cpplint/LICENSE similarity index 100% rename from third_party/cpplint/LICENSE rename to tools/cpplint/LICENSE diff --git a/third_party/cpplint/README.rst b/tools/cpplint/README.rst similarity index 100% rename from third_party/cpplint/README.rst rename to tools/cpplint/README.rst diff --git a/third_party/cpplint/cpplint.py b/tools/cpplint/cpplint.py similarity index 99% rename from third_party/cpplint/cpplint.py rename to tools/cpplint/cpplint.py index 6b78b308c..933b1df1d 100755 --- a/third_party/cpplint/cpplint.py +++ b/tools/cpplint/cpplint.py @@ -3629,7 +3629,7 @@ def CheckComment(line, filename, linenum, next_line_start, error): commentpos = line.find('//') if commentpos != -1: # Check if the // may be in quotes. If so, ignore it - if re.sub(r'\\.', '', line[0:commentpos]).count('"') % 2 == 0: + if re.sub(r'', '', line[0:commentpos]).count('"') % 2 == 0: # Allow one space for new scopes, two spaces otherwise: if (not (Match(r'^.*{ *//', line) and next_line_start == commentpos) and ((commentpos >= 1 and diff --git a/third_party/cpplint/update.sh b/tools/cpplint/update.sh similarity index 100% rename from third_party/cpplint/update.sh rename to tools/cpplint/update.sh diff --git a/third_party/gdb_pretty_printer/README.md b/tools/gdb_pretty_printer/README.md similarity index 100% rename from third_party/gdb_pretty_printer/README.md rename to tools/gdb_pretty_printer/README.md diff --git a/third_party/gdb_pretty_printer/nlohmann-json.py b/tools/gdb_pretty_printer/nlohmann-json.py similarity index 100% rename from third_party/gdb_pretty_printer/nlohmann-json.py rename to tools/gdb_pretty_printer/nlohmann-json.py diff --git a/third_party/macro_builder/main.cpp b/tools/macro_builder/main.cpp similarity index 100% rename from third_party/macro_builder/main.cpp rename to tools/macro_builder/main.cpp