-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
build2 integration doc update #4587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
@nlohmann Hi! I'm not done at all with this but I would need to see the result somewhere before continuing. Does the ci makes a documentation build? I didnt find it so far. |
You can execute make install_venv serve -C docs/mkdocs and then open http://127.0.0.1:8000/ |
This pull request has been marked as stale because it has had no activity for 30 days. While we won’t close it automatically, we encourage you to update or comment if it is still relevant. Keeping pull requests active and up-to-date helps us review and merge changes more efficiently. Thank you for your contributions! |
Still relevant, just no time to focus on this yet. T_T I'll try this weekend but can't make any promises. |
Please resolve conflicts and sign off your commits (see https://github.com/nlohmann/json/pull/4587/checks?check_run_id=35268369393). |
b3f711e
to
7b12a7b
Compare
I took some time to update this but I'm having some issues:
I'll try to complete this soon, I didnt try to generate the doc yet by lack of time (and no |
@@ -363,7 +363,7 @@ and follow the then displayed descriptions. Please see the vcpkg project for any | |||
```cmake title="CMakeLists.txt" | |||
--8<-- "integration/vcpkg/CMakeLists.txt" | |||
``` | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the whitespace changes in this file.
Nevertheless, after finding the package you want, click on “Install” button and accept confirmation dialogs. | ||
After the package is successfully added to the projects, you should be able to build and execute the project | ||
|
||
Nevertheless, after finding the package you want, just click on “Install” button and accept confirmation dialogs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove "just" - it's never "just".
After the package is successfully added to the projects, you should be able to build and execute the project | ||
|
||
Nevertheless, after finding the package you want, just click on “Install” button and accept confirmation dialogs. | ||
After the package is successfully added to the projects, you should be able to just build and execute the project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove "just".
depends: * bpkg >= 0.16.0 | ||
#depends: libhello ^1.0.0 | ||
|
||
depends: nlohmann-json ^3.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think depending from the latest version makes more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as the last version is 3.x this will acquire the last published version (^
means any version starting with the major version specified). If we really want to specify any last version then I can remove the version constraint, but it's usually not a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we do not release frequently, and releases usually fix a lot of bugs, using the latest version is best practice.
I can bump the version number with a new release.
@@ -0,0 +1,2 @@ | |||
The files in this directory are for documentation only. In the current file/directory configuration they cannot be used as a `build2` project. Use `bdep new` to create a proper project and replace the files where necessary. See [../package_managers.md#build2] for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file and add the documentation on how to build the project to package_managers.md
similar to the other package managers like the following for Bazel:
??? example
1. Create the following files:
```ini title="BUILD"
--8<-- "integration/bazel/BUILD"
```
```ini title="WORKSPACE"
--8<-- "integration/bazel/MODULE.bazel"
```
```cpp title="example.cpp"
--8<-- "integration/bazel/example.cpp"
```
2. Build and run:
```shell
bazel build //:main
bazel run //:main
```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the file and simplified the example to be closer to that example, but note that it's not working the same way for build2
as most of the other tools. I can still simplify it but at the cost of making the example over-simplified.
See https://github.com/nlohmann/json/pull/4587/checks?check_run_id=40451156048. There, a solution is described:
Yes.
Please revert. |
Signed-off-by: Joël Lamotte <mjklaim@gmail.com> Signed-off-by: Klaim (Joël Lamotte) <142265+Klaim@users.noreply.github.com>
Signed-off-by: Joël Lamotte <mjklaim@gmail.com> Signed-off-by: Klaim (Joël Lamotte) <142265+Klaim@users.noreply.github.com>
Signed-off-by: Joël Lamotte <mjklaim@gmail.com> Signed-off-by: Klaim (Joël Lamotte) <142265+Klaim@users.noreply.github.com>
Signed-off-by: Klaim (Joël Lamotte) <142265+Klaim@users.noreply.github.com>
Signed-off-by: Klaim (Joël Lamotte) <142265+Klaim@users.noreply.github.com>
I still have some cleanup to do, but no time left today, will continue soon. 👍🏽 |
This PR adds a more complete description of how to use the
build2
's package ofnlhomann-json
to consume the library inbuild2
projects.Note that
build2
is not only a package-manager but also a build-system and both tools are designed to work together, this impacts the verbosity of this documentation. I might have been too detailed or beginner-friendly in some parts, feel free to point if I should shortcut some of the explanations. In doubt, for the case of exisingbuild2
projects, I opted to use the "detail/summary" markdown/html tags so that people who already know about these steps (experimentedbuild2
users) dont have to read the whole paragraph. The details are for less experimentedbuild2
users.The provided source files do not constitute as provided a valide
build2
project, that involves a specific organisation in particular for projects that use the package-manager. So instead of adding a whole project, I put there the files that will be modified from abdep new
-created project (that command creates a ready-to-work project). The example "from scratch" uses that approach.Because
build2
projects with executables usually usetestscript
, the executable I/O testing tooling provided bybuild2
, I also provided atestscript
for testing the output from the classic output of the example source code.Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filessingle_include/nlohmann/json.hpp
andsingle_include/nlohmann/json_fwd.hpp
. The whole process is described here.Please don't
#ifdef
s or other means.