Browse Source

New shape for dependency listings

default_compile_flags
vector-of-bool 4 years ago
parent
commit
c80b8027e5
12 changed files with 1085 additions and 246 deletions
  1. +105
    -105
      catalog.json
  2. +835
    -0
      catalog.old.json
  3. +89
    -88
      src/dds/package/manifest.cpp
  4. +4
    -4
      tests/deps/git-remote/package.json5
  5. +3
    -3
      tests/deps/use-catch2/project/package.json5
  6. +3
    -3
      tests/deps/use-cryptopp/project/package.json5
  7. +3
    -3
      tests/deps/use-libsodium/project/package.json5
  8. +3
    -3
      tests/deps/use-remote/package.json5
  9. +3
    -3
      tests/deps/use-spdlog/project/package.json5
  10. +14
    -22
      tools/ci.py
  11. +21
    -11
      tools/gen-catalog-json.py
  12. +2
    -1
      tools/self_build.py

+ 105
- 105
catalog.json View File

@@ -2,7 +2,7 @@
"packages": {
"ctre": {
"2.7.0": {
"depends": {},
"depends": [],
"description": "A compile-time PCRE (almost) compatible regular expression matcher",
"git": {
"auto-lib": "hanickadot/ctre",
@@ -13,7 +13,7 @@
},
"fmt": {
"0.10.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -22,7 +22,7 @@
}
},
"0.12.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -31,7 +31,7 @@
}
},
"0.8.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -40,7 +40,7 @@
}
},
"0.9.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -49,7 +49,7 @@
}
},
"1.0.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -58,7 +58,7 @@
}
},
"1.1.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -67,7 +67,7 @@
}
},
"2.0.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -76,7 +76,7 @@
}
},
"2.0.1": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -85,7 +85,7 @@
}
},
"2.1.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -94,7 +94,7 @@
}
},
"2.1.1": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -103,7 +103,7 @@
}
},
"3.0.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -112,7 +112,7 @@
}
},
"3.0.1": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -121,7 +121,7 @@
}
},
"3.0.2": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -130,7 +130,7 @@
}
},
"4.0.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -139,7 +139,7 @@
}
},
"4.1.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -148,7 +148,7 @@
}
},
"5.0.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -157,7 +157,7 @@
}
},
"5.1.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -166,7 +166,7 @@
}
},
"5.2.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -175,7 +175,7 @@
}
},
"5.2.1": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -184,7 +184,7 @@
}
},
"5.3.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -193,7 +193,7 @@
}
},
"6.0.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -202,7 +202,7 @@
}
},
"6.1.0": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -211,7 +211,7 @@
}
},
"6.1.1": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -220,7 +220,7 @@
}
},
"6.1.2": {
"depends": {},
"depends": [],
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
@@ -231,7 +231,7 @@
},
"ms-wil": {
"2020.03.16": {
"depends": {},
"depends": [],
"description": "The Windows Implementation Library",
"git": {
"ref": "dds/2020.03.16",
@@ -241,7 +241,7 @@
},
"neo-concepts": {
"0.1.0": {
"depends": {},
"depends": [],
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.1.0",
@@ -249,7 +249,7 @@
}
},
"0.2.0": {
"depends": {},
"depends": [],
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.2.0",
@@ -257,7 +257,7 @@
}
},
"0.2.1": {
"depends": {},
"depends": [],
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.2.1",
@@ -265,7 +265,7 @@
}
},
"0.2.2": {
"depends": {},
"depends": [],
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.2.2",
@@ -273,7 +273,7 @@
}
},
"0.3.0": {
"depends": {},
"depends": [],
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.3.0",
@@ -281,7 +281,7 @@
}
},
"0.3.1": {
"depends": {},
"depends": [],
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.3.1",
@@ -289,7 +289,7 @@
}
},
"0.3.2": {
"depends": {},
"depends": [],
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.3.2",
@@ -299,7 +299,7 @@
},
"neo-fun": {
"0.1.0": {
"depends": {},
"depends": [],
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.1.0",
@@ -307,7 +307,7 @@
}
},
"0.1.1": {
"depends": {},
"depends": [],
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.1.1",
@@ -315,7 +315,7 @@
}
},
"0.2.0": {
"depends": {},
"depends": [],
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.2.0",
@@ -323,7 +323,7 @@
}
},
"0.2.1": {
"depends": {},
"depends": [],
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.2.1",
@@ -331,7 +331,7 @@
}
},
"0.3.0": {
"depends": {},
"depends": [],
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.3.0",
@@ -339,7 +339,7 @@
}
},
"0.3.1": {
"depends": {},
"depends": [],
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.3.1",
@@ -347,7 +347,7 @@
}
},
"0.3.2": {
"depends": {},
"depends": [],
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.3.2",
@@ -357,7 +357,7 @@
},
"neo-sqlite3": {
"0.1.0": {
"depends": {},
"depends": [],
"description": "A modern and low-level C++ SQLite API",
"git": {
"ref": "0.1.0",
@@ -365,7 +365,7 @@
}
},
"0.2.0": {
"depends": {},
"depends": [],
"description": "A modern and low-level C++ SQLite API",
"git": {
"ref": "0.2.0",
@@ -373,7 +373,7 @@
}
},
"0.2.1": {
"depends": {},
"depends": [],
"description": "A modern and low-level C++ SQLite API",
"git": {
"ref": "0.2.1",
@@ -381,7 +381,7 @@
}
},
"0.2.2": {
"depends": {},
"depends": [],
"description": "A modern and low-level C++ SQLite API",
"git": {
"ref": "0.2.2",
@@ -389,7 +389,7 @@
}
},
"0.2.3": {
"depends": {},
"depends": [],
"description": "A modern and low-level C++ SQLite API",
"git": {
"ref": "0.2.3",
@@ -399,7 +399,7 @@
},
"nlohmann-json": {
"3.0.0": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.0.0",
@@ -407,7 +407,7 @@
}
},
"3.0.1": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.0.1",
@@ -415,7 +415,7 @@
}
},
"3.1.0": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.1.0",
@@ -423,7 +423,7 @@
}
},
"3.1.1": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.1.1",
@@ -431,7 +431,7 @@
}
},
"3.1.2": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.1.2",
@@ -439,7 +439,7 @@
}
},
"3.2.0": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.2.0",
@@ -447,7 +447,7 @@
}
},
"3.3.0": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.3.0",
@@ -455,7 +455,7 @@
}
},
"3.4.0": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.4.0",
@@ -463,7 +463,7 @@
}
},
"3.5.0": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.5.0",
@@ -471,7 +471,7 @@
}
},
"3.6.0": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.6.0",
@@ -479,7 +479,7 @@
}
},
"3.6.1": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.6.1",
@@ -487,7 +487,7 @@
}
},
"3.7.0": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.7.0",
@@ -495,7 +495,7 @@
}
},
"3.7.1": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.7.1",
@@ -503,7 +503,7 @@
}
},
"3.7.2": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.7.2",
@@ -511,7 +511,7 @@
}
},
"3.7.3": {
"depends": {},
"depends": [],
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.7.3",
@@ -521,7 +521,7 @@
},
"pubgrub": {
"0.1.2": {
"depends": {},
"depends": [],
"description": "A C++ implementation of the Pubgrub version solving algorithm",
"git": {
"ref": "0.1.2",
@@ -529,7 +529,7 @@
}
},
"0.2.0": {
"depends": {},
"depends": [],
"description": "A C++ implementation of the Pubgrub version solving algorithm",
"git": {
"ref": "0.2.0",
@@ -537,7 +537,7 @@
}
},
"0.2.1": {
"depends": {},
"depends": [],
"description": "A C++ implementation of the Pubgrub version solving algorithm",
"git": {
"ref": "0.2.1",
@@ -547,7 +547,7 @@
},
"range-v3": {
"0.10.0": {
"depends": {},
"depends": [],
"description": "Range library for C++14/17/20, basis for C++20's std::ranges",
"git": {
"auto-lib": "range-v3/range-v3",
@@ -556,7 +556,7 @@
}
},
"0.5.0": {
"depends": {},
"depends": [],
"description": "Range library for C++14/17/20, basis for C++20's std::ranges",
"git": {
"auto-lib": "range-v3/range-v3",
@@ -565,7 +565,7 @@
}
},
"0.9.0": {
"depends": {},
"depends": [],
"description": "Range library for C++14/17/20, basis for C++20's std::ranges",
"git": {
"auto-lib": "range-v3/range-v3",
@@ -574,7 +574,7 @@
}
},
"0.9.1": {
"depends": {},
"depends": [],
"description": "Range library for C++14/17/20, basis for C++20's std::ranges",
"git": {
"auto-lib": "range-v3/range-v3",
@@ -585,7 +585,7 @@
},
"semver": {
"0.2.1": {
"depends": {},
"depends": [],
"description": "A C++ library that implements Semantic Versioning parsing, emitting, types, ordering, and operations. See https://semver.org/",
"git": {
"ref": "0.2.1",
@@ -593,7 +593,7 @@
}
},
"0.2.2": {
"depends": {},
"depends": [],
"description": "A C++ library that implements Semantic Versioning parsing, emitting, types, ordering, and operations. See https://semver.org/",
"git": {
"ref": "0.2.2",
@@ -603,7 +603,7 @@
},
"spdlog": {
"0.10.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -612,7 +612,7 @@
}
},
"0.11.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -621,7 +621,7 @@
}
},
"0.12.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -630,7 +630,7 @@
}
},
"0.13.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -639,7 +639,7 @@
}
},
"0.14.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -648,7 +648,7 @@
}
},
"0.16.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -657,7 +657,7 @@
}
},
"0.16.1": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -666,7 +666,7 @@
}
},
"0.16.2": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -675,7 +675,7 @@
}
},
"0.17.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -684,7 +684,7 @@
}
},
"0.9.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -693,7 +693,7 @@
}
},
"1.0.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -702,7 +702,7 @@
}
},
"1.1.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -711,7 +711,7 @@
}
},
"1.2.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -720,7 +720,7 @@
}
},
"1.2.1": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -729,7 +729,7 @@
}
},
"1.3.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -738,7 +738,7 @@
}
},
"1.3.1": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -747,7 +747,7 @@
}
},
"1.4.0": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -756,7 +756,7 @@
}
},
"1.4.1": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -765,7 +765,7 @@
}
},
"1.4.2": {
"depends": {},
"depends": [],
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
@@ -776,7 +776,7 @@
},
"vob-json5": {
"0.1.5": {
"depends": {},
"depends": [],
"description": "A C++ implementation of a JSON5 parser",
"git": {
"ref": "0.1.5",
@@ -786,10 +786,10 @@
},
"vob-semester": {
"0.1.0": {
"depends": {
"neo-concepts": "^0.2.1",
"neo-fun": "^0.1.0"
},
"depends": [
"neo-fun^0.1.0",
"neo-concepts^0.2.1"
],
"description": "A C++ library to process recursive dynamic data",
"git": {
"ref": "0.1.0",
@@ -797,10 +797,10 @@
}
},
"0.1.1": {
"depends": {
"neo-concepts": "^0.2.2",
"neo-fun": "^0.1.1"
},
"depends": [
"neo-fun^0.1.1",
"neo-concepts^0.2.2"
],
"description": "A C++ library to process recursive dynamic data",
"git": {
"ref": "0.1.1",
@@ -808,10 +808,10 @@
}
},
"0.2.0": {
"depends": {
"neo-concepts": "^0.3.2",
"neo-fun": "^0.3.2"
},
"depends": [
"neo-fun^0.3.2",
"neo-concepts^0.3.2"
],
"description": "A C++ library to process recursive dynamic data",
"git": {
"ref": "0.2.0",
@@ -819,10 +819,10 @@
}
},
"0.2.1": {
"depends": {
"neo-concepts": "^0.3.2",
"neo-fun": "^0.3.2"
},
"depends": [
"neo-fun^0.3.2",
"neo-concepts^0.3.2"
],
"description": "A C++ library to process recursive dynamic data",
"git": {
"ref": "0.2.1",

+ 835
- 0
catalog.old.json View File

@@ -0,0 +1,835 @@
{
"packages": {
"ctre": {
"2.7.0": {
"depends": {},
"description": "A compile-time PCRE (almost) compatible regular expression matcher",
"git": {
"auto-lib": "hanickadot/ctre",
"ref": "v2.7",
"url": "https://github.com/hanickadot/compile-time-regular-expressions.git"
}
}
},
"fmt": {
"0.10.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "0.10.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"0.12.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "0.12.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"0.8.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "0.8.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"0.9.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "0.9.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"1.0.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "1.0.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"1.1.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "1.1.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"2.0.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "2.0.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"2.0.1": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "2.0.1",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"2.1.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "2.1.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"2.1.1": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "2.1.1",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"3.0.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "3.0.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"3.0.1": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "3.0.1",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"3.0.2": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "3.0.2",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"4.0.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "4.0.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"4.1.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "4.1.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"5.0.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "5.0.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"5.1.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "5.1.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"5.2.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "5.2.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"5.2.1": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "5.2.1",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"5.3.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "5.3.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"6.0.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "6.0.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"6.1.0": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "6.1.0",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"6.1.1": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "6.1.1",
"url": "https://github.com/fmtlib/fmt.git"
}
},
"6.1.2": {
"depends": {},
"description": "A modern formatting library : https://fmt.dev/",
"git": {
"auto-lib": "fmt/fmt",
"ref": "6.1.2",
"url": "https://github.com/fmtlib/fmt.git"
}
}
},
"ms-wil": {
"2020.03.16": {
"depends": {},
"description": "The Windows Implementation Library",
"git": {
"ref": "dds/2020.03.16",
"url": "https://github.com/vector-of-bool/wil.git"
}
}
},
"neo-concepts": {
"0.1.0": {
"depends": {},
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.1.0",
"url": "https://github.com/vector-of-bool/neo-concepts.git"
}
},
"0.2.0": {
"depends": {},
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.2.0",
"url": "https://github.com/vector-of-bool/neo-concepts.git"
}
},
"0.2.1": {
"depends": {},
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.2.1",
"url": "https://github.com/vector-of-bool/neo-concepts.git"
}
},
"0.2.2": {
"depends": {},
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.2.2",
"url": "https://github.com/vector-of-bool/neo-concepts.git"
}
},
"0.3.0": {
"depends": {},
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.3.0",
"url": "https://github.com/vector-of-bool/neo-concepts.git"
}
},
"0.3.1": {
"depends": {},
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.3.1",
"url": "https://github.com/vector-of-bool/neo-concepts.git"
}
},
"0.3.2": {
"depends": {},
"description": "Minimal C++ concepts library. Contains many definitions from C++20.",
"git": {
"ref": "0.3.2",
"url": "https://github.com/vector-of-bool/neo-concepts.git"
}
}
},
"neo-fun": {
"0.1.0": {
"depends": {},
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.1.0",
"url": "https://github.com/vector-of-bool/neo-fun.git"
}
},
"0.1.1": {
"depends": {},
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.1.1",
"url": "https://github.com/vector-of-bool/neo-fun.git"
}
},
"0.2.0": {
"depends": {},
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.2.0",
"url": "https://github.com/vector-of-bool/neo-fun.git"
}
},
"0.2.1": {
"depends": {},
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.2.1",
"url": "https://github.com/vector-of-bool/neo-fun.git"
}
},
"0.3.0": {
"depends": {},
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.3.0",
"url": "https://github.com/vector-of-bool/neo-fun.git"
}
},
"0.3.1": {
"depends": {},
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.3.1",
"url": "https://github.com/vector-of-bool/neo-fun.git"
}
},
"0.3.2": {
"depends": {},
"description": "Some library fundamentals that you might find useful",
"git": {
"ref": "0.3.2",
"url": "https://github.com/vector-of-bool/neo-fun.git"
}
}
},
"neo-sqlite3": {
"0.1.0": {
"depends": {},
"description": "A modern and low-level C++ SQLite API",
"git": {
"ref": "0.1.0",
"url": "https://github.com/vector-of-bool/neo-sqlite3.git"
}
},
"0.2.0": {
"depends": {},
"description": "A modern and low-level C++ SQLite API",
"git": {
"ref": "0.2.0",
"url": "https://github.com/vector-of-bool/neo-sqlite3.git"
}
},
"0.2.1": {
"depends": {},
"description": "A modern and low-level C++ SQLite API",
"git": {
"ref": "0.2.1",
"url": "https://github.com/vector-of-bool/neo-sqlite3.git"
}
},
"0.2.2": {
"depends": {},
"description": "A modern and low-level C++ SQLite API",
"git": {
"ref": "0.2.2",
"url": "https://github.com/vector-of-bool/neo-sqlite3.git"
}
},
"0.2.3": {
"depends": {},
"description": "A modern and low-level C++ SQLite API",
"git": {
"ref": "0.2.3",
"url": "https://github.com/vector-of-bool/neo-sqlite3.git"
}
}
},
"nlohmann-json": {
"3.0.0": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.0.0",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.0.1": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.0.1",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.1.0": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.1.0",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.1.1": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.1.1",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.1.2": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.1.2",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.2.0": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.2.0",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.3.0": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.3.0",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.4.0": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.4.0",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.5.0": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.5.0",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.6.0": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.6.0",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.6.1": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.6.1",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.7.0": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.7.0",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.7.1": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.7.1",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.7.2": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.7.2",
"url": "https://github.com/vector-of-bool/json.git"
}
},
"3.7.3": {
"depends": {},
"description": "JSON for Modern C++",
"git": {
"ref": "dds/3.7.3",
"url": "https://github.com/vector-of-bool/json.git"
}
}
},
"pubgrub": {
"0.1.2": {
"depends": {},
"description": "A C++ implementation of the Pubgrub version solving algorithm",
"git": {
"ref": "0.1.2",
"url": "https://github.com/vector-of-bool/pubgrub.git"
}
},
"0.2.0": {
"depends": {},
"description": "A C++ implementation of the Pubgrub version solving algorithm",
"git": {
"ref": "0.2.0",
"url": "https://github.com/vector-of-bool/pubgrub.git"
}
},
"0.2.1": {
"depends": {},
"description": "A C++ implementation of the Pubgrub version solving algorithm",
"git": {
"ref": "0.2.1",
"url": "https://github.com/vector-of-bool/pubgrub.git"
}
}
},
"range-v3": {
"0.10.0": {
"depends": {},
"description": "Range library for C++14/17/20, basis for C++20's std::ranges",
"git": {
"auto-lib": "range-v3/range-v3",
"ref": "0.10.0",
"url": "https://github.com/ericniebler/range-v3.git"
}
},
"0.5.0": {
"depends": {},
"description": "Range library for C++14/17/20, basis for C++20's std::ranges",
"git": {
"auto-lib": "range-v3/range-v3",
"ref": "0.5.0",
"url": "https://github.com/ericniebler/range-v3.git"
}
},
"0.9.0": {
"depends": {},
"description": "Range library for C++14/17/20, basis for C++20's std::ranges",
"git": {
"auto-lib": "range-v3/range-v3",
"ref": "0.9.0",
"url": "https://github.com/ericniebler/range-v3.git"
}
},
"0.9.1": {
"depends": {},
"description": "Range library for C++14/17/20, basis for C++20's std::ranges",
"git": {
"auto-lib": "range-v3/range-v3",
"ref": "0.9.1",
"url": "https://github.com/ericniebler/range-v3.git"
}
}
},
"semver": {
"0.2.1": {
"depends": {},
"description": "A C++ library that implements Semantic Versioning parsing, emitting, types, ordering, and operations. See https://semver.org/",
"git": {
"ref": "0.2.1",
"url": "https://github.com/vector-of-bool/semver.git"
}
},
"0.2.2": {
"depends": {},
"description": "A C++ library that implements Semantic Versioning parsing, emitting, types, ordering, and operations. See https://semver.org/",
"git": {
"ref": "0.2.2",
"url": "https://github.com/vector-of-bool/semver.git"
}
}
},
"spdlog": {
"0.10.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v0.10.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"0.11.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v0.11.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"0.12.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v0.12.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"0.13.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v0.13.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"0.14.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v0.14.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"0.16.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v0.16.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"0.16.1": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v0.16.1",
"url": "https://github.com/gabime/spdlog.git"
}
},
"0.16.2": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v0.16.2",
"url": "https://github.com/gabime/spdlog.git"
}
},
"0.17.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v0.17.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"0.9.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v0.9.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"1.0.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v1.0.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"1.1.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v1.1.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"1.2.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v1.2.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"1.2.1": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v1.2.1",
"url": "https://github.com/gabime/spdlog.git"
}
},
"1.3.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v1.3.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"1.3.1": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v1.3.1",
"url": "https://github.com/gabime/spdlog.git"
}
},
"1.4.0": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v1.4.0",
"url": "https://github.com/gabime/spdlog.git"
}
},
"1.4.1": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v1.4.1",
"url": "https://github.com/gabime/spdlog.git"
}
},
"1.4.2": {
"depends": {},
"description": "Fast C++ logging library",
"git": {
"auto-lib": "spdlog/spdlog",
"ref": "v1.4.2",
"url": "https://github.com/gabime/spdlog.git"
}
}
},
"vob-json5": {
"0.1.5": {
"depends": {},
"description": "A C++ implementation of a JSON5 parser",
"git": {
"ref": "0.1.5",
"url": "https://github.com/vector-of-bool/json5.git"
}
}
},
"vob-semester": {
"0.1.0": {
"depends": {
"neo-concepts": "^0.2.1",
"neo-fun": "^0.1.0"
},
"description": "A C++ library to process recursive dynamic data",
"git": {
"ref": "0.1.0",
"url": "https://github.com/vector-of-bool/semester.git"
}
},
"0.1.1": {
"depends": {
"neo-concepts": "^0.2.2",
"neo-fun": "^0.1.1"
},
"description": "A C++ library to process recursive dynamic data",
"git": {
"ref": "0.1.1",
"url": "https://github.com/vector-of-bool/semester.git"
}
},
"0.2.0": {
"depends": {
"neo-concepts": "^0.3.2",
"neo-fun": "^0.3.2"
},
"description": "A C++ library to process recursive dynamic data",
"git": {
"ref": "0.2.0",
"url": "https://github.com/vector-of-bool/semester.git"
}
},
"0.2.1": {
"depends": {
"neo-concepts": "^0.3.2",
"neo-fun": "^0.3.2"
},
"description": "A C++ library to process recursive dynamic data",
"git": {
"ref": "0.2.1",
"url": "https://github.com/vector-of-bool/semester.git"
}
}
}
},
"version": 1
}

+ 89
- 88
src/dds/package/manifest.cpp View File

@@ -7,107 +7,108 @@
#include <range/v3/view/split.hpp>
#include <range/v3/view/split_when.hpp>
#include <range/v3/view/transform.hpp>
#include <semester/decomp.hpp>
#include <semester/walk.hpp>
#include <spdlog/spdlog.h>

#include <json5/parse_data.hpp>

using namespace dds;

package_manifest package_manifest::load_from_file(const fs::path& fpath) {
auto content = slurp_file(fpath);
auto data = json5::parse_data(content);
namespace {

if (!data.is_object()) {
throw_user_error<errc::invalid_pkg_manifest>("Root value must be an object");
}
using require_obj = semester::require_type<json5::data::mapping_type>;
using require_array = semester::require_type<json5::data::array_type>;
using require_str = semester::require_type<std::string>;

package_manifest parse_json(const json5::data& data, std::string_view fpath) {
package_manifest ret;
using namespace semester::decompose_ops;
auto res = semester::decompose( //
data,
try_seq{
require_type<json5::data::mapping_type>{
"The root of a package manifest must be an object (mapping)"},
mapping{
if_key{"$schema", just_accept},
if_key{
"name",
require_type<std::string>{"`name` must be a string"},
put_into{ret.pkg_id.name},
},
if_key{
"namespace",
require_type<std::string>{"`namespace` must be a string"},
put_into{ret.namespace_},
},
if_key{
"version",
require_type<std::string>{"`version` must be a string"},
[&](auto&& version_str_) {
auto& version = version_str_.as_string();
ret.pkg_id.version = semver::version::parse(version);
return semester::dc_accept;
},
},
if_key{
"depends",
require_type<json5::data::mapping_type>{
"`depends` must be a mapping between package names and version ranges"},
mapping{[&](auto pkg_name, auto&& range_str_) {
if (!range_str_.is_string()) {
throw_user_error<errc::invalid_pkg_manifest>(
"Dependency for '{}' must be a range string", pkg_name);
}
try {
auto rng = semver::range::parse_restricted(range_str_.as_string());
dependency dep{std::string(pkg_name), {rng.low(), rng.high()}};
ret.dependencies.push_back(std::move(dep));
} catch (const semver::invalid_range&) {
throw_user_error<errc::invalid_version_range_string>(
"Invalid version range string '{}' in dependency declaration for "
"'{}'",
range_str_.as_string(),
pkg_name);

using namespace semester::walk_ops;
auto push_depends_obj_kv = [&](std::string key, auto&& dat) {
dependency pending_dep;
if (!dat.is_string()) {
return walk.reject("Dependency object values should be strings");
}
try {
auto rng = semver::range::parse_restricted(dat.as_string());
dependency dep{std::move(key), {rng.low(), rng.high()}};
ret.dependencies.push_back(std::move(dep));
} catch (const semver::invalid_range&) {
throw_user_error<errc::invalid_version_range_string>(
"Invalid version range string '{}' in dependency declaration for "
"'{}'",
dat.as_string(),
key);
}
return walk.accept;
};

walk(data,
require_obj{"Root of package manifest should be a JSON object"},
mapping{
if_key{"$schema", just_accept},
required_key{"name",
"A string 'name' is required",
require_str{"'name' must be a string"},
put_into{ret.pkg_id.name}},
required_key{"namespace",
"A string 'namespace' is a required ",
require_str{"'namespace' must be a string"},
put_into{ret.namespace_}},
required_key{"version",
"A 'version' string is requried",
require_str{"'version' must be a string"},
put_into{ret.pkg_id.version,
[](std::string s) { return semver::version::parse(s); }}},
if_key{"depends",
[&](auto&& dat) {
if (dat.is_object()) {
spdlog::warn(
"{}: Using a JSON object for 'depends' is deprecated. Use an"
"array of strings instead.",
fpath);
return mapping{push_depends_obj_kv}(dat);
} else if (dat.is_array()) {
return for_each{put_into{std::back_inserter(ret.dependencies),
[](const std::string& depstr) {
return dependency::parse_depends_string(
depstr);
}}}(dat);
} else {
return walk.reject(
"'depends' should be an array of dependency strings");
}
return semester::dc_accept;
}},
},
if_key{"test_driver",
require_type<std::string>{"`test_driver` must be a string"},
[&](auto&& test_driver_str_) {
auto& test_driver = test_driver_str_.as_string();
if (test_driver == "Catch-Main") {
ret.test_driver = test_lib::catch_main;
} else if (test_driver == "Catch") {
ret.test_driver = test_lib::catch_;
} else {
auto dym = *did_you_mean(test_driver, {"Catch-Main", "Catch"});
throw_user_error<errc::unknown_test_driver>(
"Unknown 'test_driver' '{}' (Did you mean '{}'?)",
test_driver,
dym);
}
return semester::dc_accept;
}},
[&](auto key, auto&&) {
return semester::dc_reject_t{
fmt::format("Unknown key `{}` in package manifest", key)};
}}});
auto rej = std::get_if<semester::dc_reject_t>(&res);
if (rej) {
throw_user_error<errc::invalid_pkg_manifest>(rej->message);
}
if_key{"test_driver",
require_str{"'test_driver' must be a string"},
put_into{ret.test_driver,
[](std::string const& td_str) {
if (td_str == "Catch-Main") {
return test_lib::catch_main;
} else if (td_str == "Catch") {
return test_lib::catch_;
} else {
auto dym = *did_you_mean(td_str, {"Catch-Main", "Catch"});
throw_user_error<errc::unknown_test_driver>(
"Unknown 'test_driver' '{}' (Did you mean '{}'?)",
td_str,
dym);
}
}}},
});
return ret;
}

if (ret.pkg_id.name.empty()) {
throw_user_error<errc::invalid_pkg_manifest>("The 'name' field is required.");
}
} // namespace

if (ret.namespace_.empty()) {
throw_user_error<errc::invalid_pkg_manifest>("The 'namespace'` field is required.");
package_manifest package_manifest::load_from_file(const fs::path& fpath) {
auto content = slurp_file(fpath);
auto data = json5::parse_data(content);
try {
return parse_json(data, fpath.string());
} catch (const semester::walk_error& e) {
throw_user_error<errc::invalid_pkg_manifest>(e.what());
}

return ret;
}

std::optional<fs::path> package_manifest::find_in_directory(path_ref dirpath) {
@@ -132,4 +133,4 @@ std::optional<package_manifest> package_manifest::load_from_directory(path_ref d
return std::nullopt;
}
return load_from_file(*found);
}
}

+ 4
- 4
tests/deps/git-remote/package.json5 View File

@@ -2,8 +2,8 @@
name: 'deps-test',
"namespace": "test",
version: '0.0.0',
depends: {
'neo-fun': '0.3.2',
'range-v3': '0.9.1',
}
depends: [
'neo-fun@0.3.2',
'range-v3@0.9.1',
]
}

+ 3
- 3
tests/deps/use-catch2/project/package.json5 View File

@@ -2,7 +2,7 @@
name: 'use-catch2',
version: '1.0.0',
namespace: 'test',
depends: {
'catch2': '2.12.4'
}
depends: [
'catch2@2.12.4'
]
}

+ 3
- 3
tests/deps/use-cryptopp/project/package.json5 View File

@@ -2,7 +2,7 @@
name: 'use-cryptopp',
version: '1.0.0',
namespace: 'test',
depends: {
'cryptopp': '8.2.0'
}
depends: [
'cryptopp@8.2.0'
]
}

+ 3
- 3
tests/deps/use-libsodium/project/package.json5 View File

@@ -2,7 +2,7 @@
name: 'use-libsodium',
version: '1.0.0',
namespace: 'test',
depends: {
'libsodium': '1.0.18'
}
depends: [
'libsodium@1.0.18'
]
}

+ 3
- 3
tests/deps/use-remote/package.json5 View File

@@ -2,7 +2,7 @@
"name": "json-test",
"version": "0.0.0",
"namespace": "test",
"depends": {
"nlohmann-json": "3.7.1"
}
"depends": [
"nlohmann-json@3.7.1"
]
}

+ 3
- 3
tests/deps/use-spdlog/project/package.json5 View File

@@ -2,7 +2,7 @@
name: 'test',
version: '0.0.0',
"namespace": "test",
depends: {
'spdlog': '1.4.2',
},
depends: [
'spdlog@1.4.2',
],
}

+ 14
- 22
tools/ci.py View File

@@ -4,6 +4,7 @@ import sys
import pytest
from pathlib import Path
from typing import Sequence, NamedTuple
import multiprocessing
import subprocess
import urllib.request
import shutil
@@ -91,21 +92,16 @@ def main(argv: Sequence[str]) -> int:
if old_cat_path.is_file():
old_cat_path.unlink()

ci_repo_dir = paths.PREBUILT_DIR / '_ci-repo'
ci_repo_dir = paths.PREBUILT_DIR / 'ci-repo'
if ci_repo_dir.exists():
shutil.rmtree(ci_repo_dir)

proc.check_run([
self_build(
paths.PREBUILT_DDS,
'catalog',
'import',
('--catalog', old_cat_path),
('--json', paths.PROJECT_ROOT / 'catalog.json'),
])
self_build(paths.PREBUILT_DDS,
toolchain=opts.toolchain,
cat_path=old_cat_path,
dds_flags=[('--repo-dir', ci_repo_dir)])
toolchain=opts.toolchain,
cat_path=old_cat_path,
cat_json_path=Path('catalog.old.json'),
dds_flags=[('--repo-dir', ci_repo_dir)])
print('Main build PASSED!')
print(f'A `dds` executable has been generated: {paths.CUR_BUILT_DDS}')

@@ -115,25 +111,21 @@ def main(argv: Sequence[str]) -> int:
)
return 0

print('Bootstrapping myself:')
new_cat_path = paths.BUILD_DIR / 'catalog.db'
proc.check_run([
self_build(
paths.CUR_BUILT_DDS,
'catalog',
'import',
('--catalog', new_cat_path),
('--json', paths.PROJECT_ROOT / 'catalog.json'),
])
self_build(paths.CUR_BUILT_DDS,
toolchain=opts.toolchain,
cat_path=new_cat_path,
dds_flags=[f'--repo-dir={ci_repo_dir}'])
toolchain=opts.toolchain,
cat_path=new_cat_path,
dds_flags=[f'--repo-dir={ci_repo_dir}'])
print('Bootstrap test PASSED!')

return pytest.main([
'-v',
'--durations=10',
f'--basetemp={paths.BUILD_DIR / "_tmp"}',
'-n4',
'-n',
str(multiprocessing.cpu_count() + 2),
'tests/',
])


+ 21
- 11
tools/gen-catalog-json.py View File

@@ -1,3 +1,4 @@
import argparse
import json
from typing import NamedTuple, Tuple, List, Sequence, Union, Optional, Mapping
import sys
@@ -28,11 +29,14 @@ class Version(NamedTuple):
depends: Mapping[str, str] = {}
description: str = '(No description provided)'

def to_dict(self) -> dict:
def to_dict(self, new=False) -> dict:
ret: dict = {
'description': self.description,
}
ret['depends'] = self.depends
if new:
ret['depends'] = [k + v for k, v in self.depends.items()]
else:
ret['depends'] = self.depends
if isinstance(self.remote, Git):
ret['git'] = self.remote.to_dict()
return ret
@@ -60,7 +64,7 @@ def many_versions(name: str,
])


packages = [
PACKAGES = [
many_versions(
'range-v3',
(
@@ -289,13 +293,19 @@ packages = [
),
]

data = {
'version': 1,
'packages': {
pkg.name: {ver.version: ver.to_dict()
for ver in pkg.versions}
for pkg in packages
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--new', action='store_true')
args = parser.parse_args()

data = {
'version': 1,
'packages': {
pkg.name:
{ver.version: ver.to_dict(new=args.new)
for ver in pkg.versions}
for pkg in PACKAGES
}
}
}

print(json.dumps(data, indent=2, sort_keys=True))
print(json.dumps(data, indent=2, sort_keys=True))

+ 2
- 1
tools/self_build.py View File

@@ -16,6 +16,7 @@ def self_build(exe: Path,
toolchain: str,
lmi_path: Path = None,
cat_path: Path = Path('_build/catalog.db'),
cat_json_path: Path = Path('catalog.json'),
dds_flags: proc.CommandLine = ()):
# Copy the exe to another location, as windows refuses to let a binary be
# replaced while it is executing
@@ -27,7 +28,7 @@ def self_build(exe: Path,
'catalog',
'import',
f'--catalog={cat_path}',
f'--json=catalog.json',
f'--json={cat_json_path}',
)
proc.check_run(
new_exe,

Loading…
Cancel
Save