Skip to content

Conversation

loumalouomega
Copy link

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:

#include "nlohmann-json-schema-validator.hpp"

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:

# Ensure you have amalgamate.py available
# https://bitbucket.org/erikedlund/amalgamate/src/master/
python path/to/amalgamate.py -c config.json -s .

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant