aboutsummaryrefslogtreecommitdiff
path: root/libbrep
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-10-25 23:33:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-10-31 19:21:38 +0300
commit8e257991d80277950915a77857ea7e724001b195 (patch)
tree179129af74b06570a59054e9cc59a1b743b7cecc /libbrep
parent6f42144f6b0258cb46dc796c9251f57c72b23ee8 (diff)
Add support for tests, examples, and benchmark package manifest values
Diffstat (limited to 'libbrep')
-rw-r--r--libbrep/package.cxx6
-rw-r--r--libbrep/package.hxx23
-rw-r--r--libbrep/package.xml258
3 files changed, 283 insertions, 4 deletions
diff --git a/libbrep/package.cxx b/libbrep/package.cxx
index fe216d2..e6c543d 100644
--- a/libbrep/package.cxx
+++ b/libbrep/package.cxx
@@ -73,6 +73,9 @@ namespace brep
optional<email_type> bee,
dependencies_type dp,
requirements_type rq,
+ small_vector<dependency, 1> ts,
+ small_vector<dependency, 1> es,
+ small_vector<dependency, 1> bms,
build_class_exprs bs,
build_constraints_type bc,
optional<path> lc,
@@ -104,6 +107,9 @@ namespace brep
build_error_email (move (bee)),
dependencies (move (dp)),
requirements (move (rq)),
+ tests (move (ts)),
+ examples (move (es)),
+ benchmarks (move (bms)),
builds (move (bs)),
build_constraints (!stub () ? move (bc) : build_constraints_type ()),
internal_repository (move (rp)),
diff --git a/libbrep/package.hxx b/libbrep/package.hxx
index 9733374..b9a7c00 100644
--- a/libbrep/package.hxx
+++ b/libbrep/package.hxx
@@ -21,7 +21,7 @@
//
#define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 14
-#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 16, closed)
+#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 17, closed)
namespace brep
{
@@ -86,9 +86,9 @@ namespace brep
// dependencies
//
- using bpkg::dependency_constraint;
+ using bpkg::version_constraint;
- #pragma db value(dependency_constraint) definition
+ #pragma db value(version_constraint) definition
// Notes:
//
@@ -139,7 +139,7 @@ namespace brep
using package_type = brep::package;
package_name name;
- optional<dependency_constraint> constraint;
+ optional<version_constraint> constraint;
// Resolved dependency package. NULL if the repository load was shallow
// and so the package dependencies are not resolved.
@@ -389,6 +389,9 @@ namespace brep
optional<email_type> build_error_email,
dependencies_type,
requirements_type,
+ small_vector<dependency, 1> tests,
+ small_vector<dependency, 1> examples,
+ small_vector<dependency, 1> benchmarks,
build_class_exprs,
build_constraints_type,
optional<path> location,
@@ -449,6 +452,9 @@ namespace brep
optional<email_type> build_error_email;
dependencies_type dependencies;
requirements_type requirements;
+ small_vector<dependency, 1> tests;
+ small_vector<dependency, 1> examples;
+ small_vector<dependency, 1> benchmarks;
build_class_exprs builds; // Note: foreign-mapped in build.
build_constraints_type build_constraints; // Note: foreign-mapped in build.
@@ -552,6 +558,15 @@ namespace brep
set(odb::nested_set (this.requirements, std::move (?))) \
id_column("") key_column("") value_column("id")
+ // tests, examples, benchmarks
+ //
+ // Seeing that these reuse the dependency types, we are also going to
+ // have identical database mapping.
+ //
+ #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_")
+
// builds
//
#pragma db member(builds) id_column("") value_column("") \
diff --git a/libbrep/package.xml b/libbrep/package.xml
index 2acba62..170ba7c 100644
--- a/libbrep/package.xml
+++ b/libbrep/package.xml
@@ -1,4 +1,262 @@
<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" schema-name="package" version="1">
+ <changeset version="17">
+ <add-table name="package_tests" kind="container">
+ <column name="tenant" type="TEXT" null="false"/>
+ <column name="name" type="CITEXT" null="false"/>
+ <column name="version_epoch" type="INTEGER" null="false"/>
+ <column name="version_canonical_upstream" type="TEXT" null="false"/>
+ <column name="version_canonical_release" type="TEXT" null="false" options="COLLATE &quot;C&quot;"/>
+ <column name="version_revision" type="INTEGER" null="false"/>
+ <column name="index" type="BIGINT" null="false"/>
+ <column name="dep_name" type="CITEXT" null="false"/>
+ <column name="dep_min_version_epoch" type="INTEGER" null="true"/>
+ <column name="dep_min_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="dep_min_version_canonical_release" type="TEXT" null="true"/>
+ <column name="dep_min_version_revision" type="INTEGER" null="true"/>
+ <column name="dep_min_version_upstream" type="TEXT" null="true"/>
+ <column name="dep_min_version_release" type="TEXT" null="true"/>
+ <column name="dep_max_version_epoch" type="INTEGER" null="true"/>
+ <column name="dep_max_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="dep_max_version_canonical_release" type="TEXT" null="true"/>
+ <column name="dep_max_version_revision" type="INTEGER" null="true"/>
+ <column name="dep_max_version_upstream" type="TEXT" null="true"/>
+ <column name="dep_max_version_release" type="TEXT" null="true"/>
+ <column name="dep_min_open" type="BOOLEAN" null="true"/>
+ <column name="dep_max_open" type="BOOLEAN" null="true"/>
+ <column name="dep_package_tenant" type="TEXT" null="true"/>
+ <column name="dep_package_name" type="CITEXT" null="true"/>
+ <column name="dep_package_version_epoch" type="INTEGER" null="true"/>
+ <column name="dep_package_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="dep_package_version_canonical_release" type="TEXT" null="true" options="COLLATE &quot;C&quot;"/>
+ <column name="dep_package_version_revision" type="INTEGER" null="true"/>
+ <foreign-key name="tenant_fk" deferrable="DEFERRED">
+ <column name="tenant"/>
+ <references table="tenant">
+ <column name="id"/>
+ </references>
+ </foreign-key>
+ <foreign-key name="object_id_fk" on-delete="CASCADE">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ <references table="package">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ </references>
+ </foreign-key>
+ <index name="package_tests_object_id_i">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ </index>
+ <index name="package_tests_index_i">
+ <column name="index"/>
+ </index>
+ <foreign-key name="dep_package_tenant_fk" deferrable="DEFERRED">
+ <column name="dep_package_tenant"/>
+ <references table="tenant">
+ <column name="id"/>
+ </references>
+ </foreign-key>
+ <foreign-key name="dep_package_fk" deferrable="DEFERRED">
+ <column name="dep_package_tenant"/>
+ <column name="dep_package_name"/>
+ <column name="dep_package_version_epoch"/>
+ <column name="dep_package_version_canonical_upstream"/>
+ <column name="dep_package_version_canonical_release"/>
+ <column name="dep_package_version_revision"/>
+ <references table="package">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ </references>
+ </foreign-key>
+ </add-table>
+ <add-table name="package_examples" kind="container">
+ <column name="tenant" type="TEXT" null="false"/>
+ <column name="name" type="CITEXT" null="false"/>
+ <column name="version_epoch" type="INTEGER" null="false"/>
+ <column name="version_canonical_upstream" type="TEXT" null="false"/>
+ <column name="version_canonical_release" type="TEXT" null="false" options="COLLATE &quot;C&quot;"/>
+ <column name="version_revision" type="INTEGER" null="false"/>
+ <column name="index" type="BIGINT" null="false"/>
+ <column name="dep_name" type="CITEXT" null="false"/>
+ <column name="dep_min_version_epoch" type="INTEGER" null="true"/>
+ <column name="dep_min_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="dep_min_version_canonical_release" type="TEXT" null="true"/>
+ <column name="dep_min_version_revision" type="INTEGER" null="true"/>
+ <column name="dep_min_version_upstream" type="TEXT" null="true"/>
+ <column name="dep_min_version_release" type="TEXT" null="true"/>
+ <column name="dep_max_version_epoch" type="INTEGER" null="true"/>
+ <column name="dep_max_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="dep_max_version_canonical_release" type="TEXT" null="true"/>
+ <column name="dep_max_version_revision" type="INTEGER" null="true"/>
+ <column name="dep_max_version_upstream" type="TEXT" null="true"/>
+ <column name="dep_max_version_release" type="TEXT" null="true"/>
+ <column name="dep_min_open" type="BOOLEAN" null="true"/>
+ <column name="dep_max_open" type="BOOLEAN" null="true"/>
+ <column name="dep_package_tenant" type="TEXT" null="true"/>
+ <column name="dep_package_name" type="CITEXT" null="true"/>
+ <column name="dep_package_version_epoch" type="INTEGER" null="true"/>
+ <column name="dep_package_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="dep_package_version_canonical_release" type="TEXT" null="true" options="COLLATE &quot;C&quot;"/>
+ <column name="dep_package_version_revision" type="INTEGER" null="true"/>
+ <foreign-key name="tenant_fk" deferrable="DEFERRED">
+ <column name="tenant"/>
+ <references table="tenant">
+ <column name="id"/>
+ </references>
+ </foreign-key>
+ <foreign-key name="object_id_fk" on-delete="CASCADE">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ <references table="package">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ </references>
+ </foreign-key>
+ <index name="package_examples_object_id_i">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ </index>
+ <index name="package_examples_index_i">
+ <column name="index"/>
+ </index>
+ <foreign-key name="dep_package_tenant_fk" deferrable="DEFERRED">
+ <column name="dep_package_tenant"/>
+ <references table="tenant">
+ <column name="id"/>
+ </references>
+ </foreign-key>
+ <foreign-key name="dep_package_fk" deferrable="DEFERRED">
+ <column name="dep_package_tenant"/>
+ <column name="dep_package_name"/>
+ <column name="dep_package_version_epoch"/>
+ <column name="dep_package_version_canonical_upstream"/>
+ <column name="dep_package_version_canonical_release"/>
+ <column name="dep_package_version_revision"/>
+ <references table="package">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ </references>
+ </foreign-key>
+ </add-table>
+ <add-table name="package_benchmarks" kind="container">
+ <column name="tenant" type="TEXT" null="false"/>
+ <column name="name" type="CITEXT" null="false"/>
+ <column name="version_epoch" type="INTEGER" null="false"/>
+ <column name="version_canonical_upstream" type="TEXT" null="false"/>
+ <column name="version_canonical_release" type="TEXT" null="false" options="COLLATE &quot;C&quot;"/>
+ <column name="version_revision" type="INTEGER" null="false"/>
+ <column name="index" type="BIGINT" null="false"/>
+ <column name="dep_name" type="CITEXT" null="false"/>
+ <column name="dep_min_version_epoch" type="INTEGER" null="true"/>
+ <column name="dep_min_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="dep_min_version_canonical_release" type="TEXT" null="true"/>
+ <column name="dep_min_version_revision" type="INTEGER" null="true"/>
+ <column name="dep_min_version_upstream" type="TEXT" null="true"/>
+ <column name="dep_min_version_release" type="TEXT" null="true"/>
+ <column name="dep_max_version_epoch" type="INTEGER" null="true"/>
+ <column name="dep_max_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="dep_max_version_canonical_release" type="TEXT" null="true"/>
+ <column name="dep_max_version_revision" type="INTEGER" null="true"/>
+ <column name="dep_max_version_upstream" type="TEXT" null="true"/>
+ <column name="dep_max_version_release" type="TEXT" null="true"/>
+ <column name="dep_min_open" type="BOOLEAN" null="true"/>
+ <column name="dep_max_open" type="BOOLEAN" null="true"/>
+ <column name="dep_package_tenant" type="TEXT" null="true"/>
+ <column name="dep_package_name" type="CITEXT" null="true"/>
+ <column name="dep_package_version_epoch" type="INTEGER" null="true"/>
+ <column name="dep_package_version_canonical_upstream" type="TEXT" null="true"/>
+ <column name="dep_package_version_canonical_release" type="TEXT" null="true" options="COLLATE &quot;C&quot;"/>
+ <column name="dep_package_version_revision" type="INTEGER" null="true"/>
+ <foreign-key name="tenant_fk" deferrable="DEFERRED">
+ <column name="tenant"/>
+ <references table="tenant">
+ <column name="id"/>
+ </references>
+ </foreign-key>
+ <foreign-key name="object_id_fk" on-delete="CASCADE">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ <references table="package">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ </references>
+ </foreign-key>
+ <index name="package_benchmarks_object_id_i">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ </index>
+ <index name="package_benchmarks_index_i">
+ <column name="index"/>
+ </index>
+ <foreign-key name="dep_package_tenant_fk" deferrable="DEFERRED">
+ <column name="dep_package_tenant"/>
+ <references table="tenant">
+ <column name="id"/>
+ </references>
+ </foreign-key>
+ <foreign-key name="dep_package_fk" deferrable="DEFERRED">
+ <column name="dep_package_tenant"/>
+ <column name="dep_package_name"/>
+ <column name="dep_package_version_epoch"/>
+ <column name="dep_package_version_canonical_upstream"/>
+ <column name="dep_package_version_canonical_release"/>
+ <column name="dep_package_version_revision"/>
+ <references table="package">
+ <column name="tenant"/>
+ <column name="name"/>
+ <column name="version_epoch"/>
+ <column name="version_canonical_upstream"/>
+ <column name="version_canonical_release"/>
+ <column name="version_revision"/>
+ </references>
+ </foreign-key>
+ </add-table>
+ </changeset>
+
<changeset version="16"/>
<changeset version="15">