From 65ba2b47c8d6c83e37fe772a7b54fd6b7480ce17 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 1 Apr 2020 23:01:02 +0300 Subject: Add support for test-exclude task manifest value Note that the last two commits demonstrate an approach to use for migrating data on the ODB object member type change. --- libbrep/build-package.hxx | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'libbrep/build-package.hxx') diff --git a/libbrep/build-package.hxx b/libbrep/build-package.hxx index ffa9d0b..85d94e6 100644 --- a/libbrep/build-package.hxx +++ b/libbrep/build-package.hxx @@ -68,6 +68,19 @@ namespace brep build_repository (): canonical_name (id.canonical_name) {} }; + // Forward declarations. + // + class build_package; + + // Build package test dependency. + // + #pragma db value + struct build_dependency + { + package_name name; + lazy_shared_ptr package; + }; + // Foreign object that is mapped to a subset of the package object. // #pragma db object table("build_package") pointer(shared_ptr) readonly session @@ -76,8 +89,16 @@ namespace brep public: package_id id; upstream_version version; + + // Mapped to the package object tests, examples, and benchmarks members + // using the PostgreSQL foreign table mechanism. + // + small_vector tests; + small_vector examples; + small_vector benchmarks; + lazy_shared_ptr internal_repository; - bool buildable; + buildable_status buildable; // Mapped to the package object builds member using the PostgreSQL foreign // table mechanism. @@ -89,15 +110,19 @@ namespace brep // build_constraints constraints; + bool + internal () const noexcept {return internal_repository != nullptr;} + // Database mapping. // #pragma db member(id) id column("") #pragma db member(version) set(this.version.init (this.id.version, (?))) + #pragma db member(tests) id_column("") value_column("dep_") + #pragma db member(examples) id_column("") value_column("dep_") + #pragma db member(benchmarks) id_column("") value_column("dep_") #pragma db member(builds) id_column("") value_column("") #pragma db member(constraints) id_column("") value_column("") - #pragma db member(buildable) column("buildable_") - private: friend class odb::access; build_package () = default; @@ -111,7 +136,7 @@ namespace brep #pragma db view \ object(build_package) \ object(build_repository inner: \ - build_package::buildable && \ + build_package::buildable == "buildable" && \ brep::operator== (build_package::internal_repository, \ build_repository::id)) \ object(build_tenant: build_package::id.tenant == build_tenant::id) @@ -130,7 +155,7 @@ namespace brep #pragma db view \ object(build_package) \ object(build_repository inner: \ - build_package::buildable && \ + build_package::buildable == "buildable" && \ brep::operator== (build_package::internal_repository, \ build_repository::id)) \ object(build_tenant: build_package::id.tenant == build_tenant::id) -- cgit v1.1