From b09e002d0fec35298d6df6117a8034b6dd3bfae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kozubal?= Date: Mon, 17 Apr 2023 22:46:20 +0200 Subject: [PATCH 1/6] Create library.json for PlatformIO --- library.json | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 library.json diff --git a/library.json b/library.json new file mode 100644 index 000000000..29296db75 --- /dev/null +++ b/library.json @@ -0,0 +1,33 @@ +{ + "name": "nlohmann-json", + "version": "3.11.2", + "description": "JSON for Modern C++", + "keywords": [ + "json", + "serialization", + "deserialization", + "parser", + "generator", + "C++" + ], + "authors": [ + { + "name": "Niels Lohmann", + "email": "mail@nlohmann.me", + "url": "https://github.com/nlohmann" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/nlohmann/json.git" + }, + "homepage": "https://nlohmann.github.io/json/", + "license": "MIT", + "dependencies": [], + "frameworks": "*", + "platforms": "*", + "examples": [ + "https://github.com/nlohmann/json/tree/develop/docs/examples" + ], + "include": "single_include/nlohmann/json.hpp" +} From 7544d44c4e112a2b33dbe1d1c3d27139ed1214e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kozubal?= Date: Mon, 17 Apr 2023 22:58:13 +0200 Subject: [PATCH 2/6] Update library.json to exclude all source files --- library.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library.json b/library.json index 29296db75..64a0ebd76 100644 --- a/library.json +++ b/library.json @@ -29,5 +29,9 @@ "examples": [ "https://github.com/nlohmann/json/tree/develop/docs/examples" ], - "include": "single_include/nlohmann/json.hpp" + "include": "single_include/nlohmann/json.hpp", + "build": { + "flags": ["-std=c++11"], + "srcFilter": ["-<**/*>"] + } } From 07f8285937d8a52f2f1eba0ac343dab086a324cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kozubal?= Date: Mon, 17 Apr 2023 23:06:04 +0200 Subject: [PATCH 3/6] Update library.json to use proper includeDir --- library.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index 64a0ebd76..ce245e64a 100644 --- a/library.json +++ b/library.json @@ -29,9 +29,9 @@ "examples": [ "https://github.com/nlohmann/json/tree/develop/docs/examples" ], - "include": "single_include/nlohmann/json.hpp", "build": { "flags": ["-std=c++11"], - "srcFilter": ["-<**/*>"] + "srcFilter": ["-<**/*>"], + "includeDir": "single_include" } } From 368af84ab23199eaf8317ed35ff07cd414442246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kozubal?= Date: Mon, 17 Apr 2023 23:07:48 +0200 Subject: [PATCH 4/6] Update library.json - general housekeeping --- library.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library.json b/library.json index ce245e64a..37629c070 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,5 @@ { "name": "nlohmann-json", - "version": "3.11.2", "description": "JSON for Modern C++", "keywords": [ "json", @@ -8,7 +7,8 @@ "deserialization", "parser", "generator", - "C++" + "C++", + "modern" ], "authors": [ { @@ -30,7 +30,6 @@ "https://github.com/nlohmann/json/tree/develop/docs/examples" ], "build": { - "flags": ["-std=c++11"], "srcFilter": ["-<**/*>"], "includeDir": "single_include" } From 614be938b046090521acb57cd4d3dfe5b4a74f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kozubal?= Date: Mon, 17 Apr 2023 23:16:01 +0200 Subject: [PATCH 5/6] Update README.md to mention PlatformIO --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index acc16eace..78ac7ec2a 100644 --- a/README.md +++ b/README.md @@ -1359,6 +1359,27 @@ CPMAddPackage( VERSION 3.9.1) ``` +If you are using [PlatformIO](https://platformio.org/) you can add this repo directly to your `platformio.ini` like this: + +```ini +[env:your_env_name] +lib_deps = + nlohmann-json=https://github.com/nlohmann/json.git +``` + +or you can include it as a dependency in your `library.json` like this: + +```json +… + "dependencies": [ + { + "name": "nlohmann-json", + "version": "https://github.com/pidpawel/json.git" + } + ] + … +``` + ### Pkg-config If you are using bare Makefiles, you can use `pkg-config` to generate the include flags that point to where the library is installed: From 0f2457edfd1f2cb4b8df5beceff0bb8965469dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kozubal?= Date: Mon, 17 Apr 2023 23:30:01 +0200 Subject: [PATCH 6/6] Update README.md - fix the repo URL after testing --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78ac7ec2a..df74e2056 100644 --- a/README.md +++ b/README.md @@ -1374,7 +1374,7 @@ or you can include it as a dependency in your `library.json` like this: "dependencies": [ { "name": "nlohmann-json", - "version": "https://github.com/pidpawel/json.git" + "version": "https://github.com/nlohmann/json.git" } ] …