-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
related: #684 This PR contains below: - Add `"package" = {version = "...", registry = "conan-v1"}` syntax - `"package" = {version = "..."}` and `"package" = {version = "...", registry = "poac"}` is same as `"package" = "..."` - Add conan v1 support - About 10 days ago, conan v2 had been released. **This PR doesn't support that.** See https://github.com/wx257osn2/poac-conan-demo for usage. --------- Co-authored-by: qqiangwu <wqzhiep@gmail.com> Co-authored-by: Ken Matsui <26405363+ken-matsui@users.noreply.github.com>
- Loading branch information
1 parent
175ec07
commit 3052403
Showing
26 changed files
with
667 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
// external | ||
#include <boost/functional/hash.hpp> | ||
|
||
// internal | ||
#include "poac/util/result.hpp" | ||
#include "poac/util/rustify.hpp" | ||
|
||
namespace poac::core::resolver::registry { | ||
|
||
// NOLINTNEXTLINE(bugprone-exception-escape) | ||
struct Registry { | ||
String index; | ||
String type; | ||
}; | ||
|
||
inline Fn operator==(const Registry& lhs, const Registry& rhs)->bool { | ||
return lhs.index == rhs.index && lhs.type == rhs.type; | ||
} | ||
|
||
inline Fn hash_value(const Registry& r)->usize { | ||
usize seed = 0; | ||
boost::hash_combine(seed, r.index); | ||
boost::hash_combine(seed, r.type); | ||
return seed; | ||
} | ||
|
||
using Registries = HashMap<String, Registry>; | ||
|
||
} // namespace poac::core::resolver::registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
// internal | ||
#include "poac/util/result.hpp" | ||
#include "poac/util/rustify.hpp" | ||
|
||
namespace poac::util::file { | ||
|
||
Fn write_file(const Path& p, StringRef content)->Result<void>; | ||
|
||
using WriteFileFailed = Error<"writing `{}` failed", String>; | ||
|
||
} // namespace poac::util::file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
// std | ||
#include <string> | ||
|
||
// external | ||
#include <boost/property_tree/ptree.hpp> | ||
|
||
// internal | ||
#include "poac/util/result.hpp" | ||
#include "poac/util/rustify.hpp" | ||
|
||
namespace poac::util::registry::conan::v1::manifest { | ||
|
||
Fn gather_conan_conf( | ||
const boost::property_tree::ptree& pt, const std::string& field, | ||
const std::string& prefix | ||
) | ||
->Vec<String>; | ||
|
||
struct ConanManifest { | ||
Vec<String> defines; | ||
Vec<String> includes; | ||
Vec<String> libdirs; | ||
Vec<String> libraries; | ||
}; | ||
|
||
Fn gather_conan_deps()->Result<ConanManifest>; | ||
|
||
} // namespace poac::util::registry::conan::v1::manifest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
// internal | ||
#include "poac/core/resolver/resolve.hpp" | ||
#include "poac/util/rustify.hpp" | ||
|
||
namespace poac::util::registry::conan::v1::resolver { | ||
|
||
using ConanNotFound = Error<"conan is not found">; | ||
using ConanIsNotV1 = | ||
Error<"your conan is not v1. conan-v1 registry needs conan v1.">; | ||
|
||
Fn check_conan_command()->Result<void>; | ||
|
||
Fn install_conan_generator()->Result<void>; | ||
|
||
Fn format_conan_requires(const Vec<core::resolver::resolve::Package>& packages) | ||
->String; | ||
|
||
Fn get_conan_config()->String; | ||
|
||
Fn install_conan_packages()->Result<void>; | ||
|
||
Fn fetch_conan_packages(const Vec<core::resolver::resolve::Package>& packages | ||
) noexcept -> Result<void>; | ||
|
||
Fn is_conan(const core::resolver::resolve::Package& package) noexcept -> bool; | ||
|
||
} // namespace poac::util::registry::conan::v1::resolver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.