Przeglądaj źródła

Libman generation code is gone (for now)

default_compile_flags
vector-of-bool 5 lat temu
rodzic
commit
a245f306d5
2 zmienionych plików z 0 dodań i 79 usunięć
  1. +0
    -67
      src/dds/deps.cpp
  2. +0
    -12
      src/dds/deps.hpp

+ 0
- 67
src/dds/deps.cpp Wyświetl plik

@@ -41,70 +41,3 @@ dependency dependency::parse_depends_string(std::string_view str) {
str));
}
}

namespace {

fs::path generate_lml(const library_plan& lib, path_ref libdir, const build_env& env) {
auto fname = lib.name() + ".lml";
auto lml_path = libdir / fname;

std::vector<lm::pair> kvs;
kvs.emplace_back("Type", "Library");
kvs.emplace_back("Name", lib.name());
if (lib.create_archive()) {
kvs.emplace_back("Path",
fs::relative(lib.create_archive()->calc_archive_file_path(env),
lml_path.parent_path())
.string());
}
auto pub_inc_dir = lib.source_root() / "include";
auto src_dir = lib.source_root() / "src";
if (!fs::exists(pub_inc_dir)) {
pub_inc_dir = src_dir;
}
kvs.emplace_back("Include-Path", pub_inc_dir.string());

// TODO: Uses, Preprocessor-Define, and Special-Uses

fs::create_directories(lml_path.parent_path());
lm::write_pairs(lml_path, kvs);
return lml_path;
}

fs::path generate_lmp(const package_plan& pkg, path_ref basedir, const build_env& env) {
auto fname = pkg.name() + ".lmp";
auto lmp_path = basedir / fname;

std::vector<lm::pair> kvs;
kvs.emplace_back("Type", "Package");
kvs.emplace_back("Name", pkg.name());
kvs.emplace_back("Namespace", pkg.namespace_());

for (auto&& lib : pkg.libraries()) {
auto lml = generate_lml(lib, basedir / pkg.name(), env);
kvs.emplace_back("Library", fs::relative(lml, lmp_path.parent_path()).string());
}

// TODO: `Requires` for transitive package imports

fs::create_directories(lmp_path.parent_path());
lm::write_pairs(lmp_path, kvs);
return lmp_path;
}

} // namespace

void dds::write_libman_index(path_ref out_filepath, const build_plan& plan, const build_env& env) {
fs::create_directories(out_filepath.parent_path());
auto lm_items_dir = out_filepath.parent_path() / "_libman";
std::vector<lm::pair> kvs;
kvs.emplace_back("Type", "Index");
for (const package_plan& pkg : plan.packages()) {
auto pkg_lmp = generate_lmp(pkg, lm_items_dir, env);
kvs.emplace_back("Package",
fmt::format("{}; {}",
pkg.name(),
fs::relative(pkg_lmp, out_filepath.parent_path()).string()));
}
lm::write_pairs(out_filepath, kvs);
}

+ 0
- 12
src/dds/deps.hpp Wyświetl plik

@@ -10,16 +10,6 @@

namespace dds {

struct sdist;
class repository;

enum class version_strength {
exact,
patch,
minor,
major,
};

using version_range_set = pubgrub::interval_set<semver::version>;

struct dependency {
@@ -29,6 +19,4 @@ struct dependency {
static dependency parse_depends_string(std::string_view str);
};

void write_libman_index(path_ref where, const build_plan& plan, const build_env& env);

} // namespace dds

Ładowanie…
Anuluj
Zapisz