Skip to content
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

Add JSON project #1061

Merged
merged 9 commits into from
Nov 4, 2021
Merged

Add JSON project #1061

merged 9 commits into from
Nov 4, 2021

Conversation

waynelwarren
Copy link
Contributor

Rather than creating gdev.cfg or CMakeLists.txt files to handle the cloning of the nlohmann/json project, I have copied the single file that we actually need. It resides in the directory it would be in if the entire project was there.

We may ultimately want to make this more automatic, but this satisfies our current needs.

I have also copied the licence information from the header into our licenses file.

Copy link
Contributor

@simone-gaia simone-gaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. A minor suggestion about dir structure.

Comment on lines 196 to 197
set(JSON "${GAIA_REPO}/third_party/production/json")
set(JSON_INC "${JSON}/json/single_include/nlohmann")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: My suggestion would be to keep the directory structure simple.

Instead of third_party/production/json/json/single_include/nlohmann/ put the header into third_party/production/json/include/nlohmann

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course that's easy, but I put the header in the spot it will be if we ever clone the entire project. That way nothing else would change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that avoiding a few small changes now for a potential big inclusion later matters much. We already moved the file once, we can move it once more if we want to use more of that project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, the file is in third_party/production/json/json.hpp.

Copy link
Contributor

@simone-gaia simone-gaia Nov 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep the following path: third_party/production/json/include/nlohmann/json.hpp

  • include/ is standard because you don't wanna include the entire directory which contains the gdev file.
  • nlohmann allows understanding what json library we are talking about, so that you can #include <nlohmann/json.hpp>

third_party/production/json/README.md Show resolved Hide resolved
@waynelwarren waynelwarren marked this pull request as ready for review November 4, 2021 16:03
Copy link
Contributor

@LaurentiuCristofor LaurentiuCristofor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. If for some reason you don't get to fix Jack's code as part of this PR, then just make sure that you open a tracking item for that cleanup, so we don't forget to do it.

@waynelwarren
Copy link
Contributor Author

Jack's testing assumes an installed SDK. To eliminate json.hpp from his local source directory will require including json.hpp in the SDK. I'll create a Jira item for that and let others discuss the merits of that.

@waynelwarren waynelwarren merged commit 453a524 into master Nov 4, 2021
@waynelwarren waynelwarren deleted the wayne/add-json-project branch November 4, 2021 19:56
@LaurentiuCristofor
Copy link
Contributor

Jack's testing assumes an installed SDK. To eliminate json.hpp from his local source directory will require including json.hpp in the SDK. I'll create a Jira item for that and let others discuss the merits of that.

I'm a bit confused. If our SDK doesn't require the json header, we should not distribute it in the SDK. If @JackAtGaia 's testing requires the json header, then it should look it up from the 3rd party directory, not expect it to get distributed with the SDK. Anyway, I guess that can be discussed in the JIRA item - can you include a link to it in a reply, so we can easily navigate from this discussion to it?

@simone-gaia
Copy link
Contributor

simone-gaia commented Nov 4, 2021

Jack's testing assumes an installed SDK. To eliminate json.hpp from his local source directory will require including json.hpp in the SDK. I'll create a Jira item for that and let others discuss the merits of that.

I'm a bit confused. If our SDK doesn't require the json header, we should not distribute it in the SDK. If @JackAtGaia 's testing requires the json header, then it should look it up from the 3rd party directory, not expect it to get distributed with the SDK. Anyway, I guess that can be discussed in the JIRA item - can you include a link to it in a reply, so we can easily navigate from this discussion to it?

I think the point is that @JackAtGaia's tests are designed as standalone applications, that do not include/link code from the Gaia source tree, they just happen to be on the same source tree, like our hackathon apps. It makes sense for a standalone app to include whatever it needs.

@LaurentiuCristofor
Copy link
Contributor

. It makes sense for a standalone app to include whatever it needs.

Yes, but it doesn't make sense for the SDK to include that. So the "standalone apps" should leverage existing code instead of duplicating it all over the place.in the same source tree.

What's the JIRA item?

@simone-gaia
Copy link
Contributor

. It makes sense for a standalone app to include whatever it needs.

Yes, but it doesn't make sense for the SDK to include that.

Agree

So the "standalone apps" should leverage existing code instead of duplicating it all over the place.in the same source tree.

Potentially yes.

What's the JIRA item?

There is no JIRA item AFAIK...

@LaurentiuCristofor
Copy link
Contributor

There is no JIRA item AFAIK...

@waynelwarren promised to create one:

I'll create a Jira item for that and let others discuss the merits of that.

@waynelwarren : can you please create the JIRA item and reply here with its link?

@waynelwarren
Copy link
Contributor Author

Here's the item I created yesterday. https://gaiaplatform.atlassian.net/browse/GAIAPLAT-1668

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.

3 participants