[Amalgamation] Adding header only nlohmann-json-schema-validator.hpp
#360
+3,559
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a single-header, amalgamated version of the library to simplify distribution and integration for end-users. Consumers can now include the entire library in their project by simply dropping in a single
.hpp
file.Description
Purpose 🎯
The primary goal of this change is to lower the barrier to entry for using this library. Instead of requiring users to manage multiple files, set up include paths, and link source files with their build system, they can now use a single, self-contained header. This "header-only" approach is common for C++ utility libraries and significantly improves the user experience.
Implementation 🛠️
This was achieved by using the
amalgamate.py
script to combine all necessary source and header files into one file.* A
config.json
has been added to define the source files, include paths, and the target output file.* The resulting amalgamated file is located at
dist/nlohmann-json-schema-validator.hpp
.Usage 🚀
To use the library, users can now copy
dist/nlohmann-json-schema-validator.hpp
into their project and include it directly:Next Steps
This generated file is not intended to be edited directly. Future development should continue in the source files within
src/
. The amalgamation process should be re-run before a new release to ensure the distributed header is up-to-date. This process can be integrated into our CI/CD pipeline to automate releases.For Maintainers: How to Update
The single-header file is generated and should not be edited directly. All development must continue in the
src/
directory.To regenerate the amalgamated header after making changes, run the following command from the project root:
Changelog