# -*- mode: python -*-

Import("env")

env = env.Clone()

env.Library(
    target='bucket_catalog',
    source=[
        'bucket.cpp',
        'bucket_catalog.cpp',
        'bucket_catalog_internal.cpp',
        'bucket_catalog_helpers.cpp',
        'bucket_catalog_server_status.cpp',
        'bucket_identifiers.cpp',
        'bucket_metadata.cpp',
        'bucket_state_registry.cpp',
        'closed_bucket.cpp',
        'execution_stats.cpp',
        'flat_bson.cpp',
        'reopening.cpp',
        'measurement_map.cpp',
        'write_batch.cpp',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/bson/util/bson_column',
        '$BUILD_DIR/mongo/db/catalog/collection_catalog',
        '$BUILD_DIR/mongo/db/catalog/database_holder',
        '$BUILD_DIR/mongo/db/commands/server_status_core',
        '$BUILD_DIR/mongo/db/dbdirectclient',
        '$BUILD_DIR/mongo/db/record_id_helpers',
        '$BUILD_DIR/mongo/db/server_base',
        '$BUILD_DIR/mongo/db/storage/storage_options',
        '$BUILD_DIR/mongo/db/timeseries/bucket_compression',
        '$BUILD_DIR/mongo/db/timeseries/bucket_compression_failure',
        '$BUILD_DIR/mongo/db/timeseries/timeseries_metadata',
        '$BUILD_DIR/mongo/db/timeseries/timeseries_options',
        '$BUILD_DIR/mongo/db/views/views',
        '$BUILD_DIR/mongo/util/fail_point',
    ],
)

env.CppUnitTest(
    target='db_bucket_catalog_test',
    source=[
        'bucket_catalog_helpers_test.cpp',
        'bucket_catalog_test.cpp',
        'bucket_state_registry_test.cpp',
        'minmax_test.cpp',
        'measurement_map_test.cpp',
        'schema_test.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/catalog/catalog_test_fixture',
        '$BUILD_DIR/mongo/db/catalog/collection_crud',
        '$BUILD_DIR/mongo/db/dbdirectclient',
        '$BUILD_DIR/mongo/db/shard_role',
        '$BUILD_DIR/mongo/db/timeseries/bucket_compression',
        '$BUILD_DIR/mongo/db/timeseries/timeseries_metadata',
        '$BUILD_DIR/mongo/db/timeseries/timeseries_options',
        'bucket_catalog',
    ],
)

env.CppUnitTest(
    target='timeseries_sizing_test',
    source=[
        'timeseries_sizing_test.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/bson/util/bson_column',
        '$BUILD_DIR/mongo/util/processinfo',
        'bucket_catalog',
    ],
)
