Skip to content

Commit

Permalink
Remove BCP-004-01 schemas since they were copied to IS-11
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Nagorny committed Nov 1, 2023
1 parent 0d8f8e4 commit 20b8a7d
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 337 deletions.
75 changes: 0 additions & 75 deletions Development/cmake/NmosCppLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -775,80 +775,6 @@ target_include_directories(nmos_is11_schemas PUBLIC
list(APPEND NMOS_CPP_TARGETS nmos_is11_schemas)
add_library(nmos-cpp::nmos_is11_schemas ALIAS nmos_is11_schemas)

# nmos_bcp00401_schemas library

set(NMOS_BCP00401_SCHEMAS_HEADERS
nmos/bcp00401_schemas/bcp00401_schemas.h
)

set(NMOS_BCP00401_V1_0_TAG v1.0.x)

set(NMOS_BCP00401_V1_0_SCHEMAS_JSON
third_party/bcp-004-01/${NMOS_BCP00401_V1_0_TAG}/APIs/schemas/constraint_set.json
third_party/bcp-004-01/${NMOS_BCP00401_V1_0_TAG}/APIs/schemas/constraint_sets.json
third_party/bcp-004-01/${NMOS_BCP00401_V1_0_TAG}/APIs/schemas/param_constraint_boolean.json
third_party/bcp-004-01/${NMOS_BCP00401_V1_0_TAG}/APIs/schemas/param_constraint_integer.json
third_party/bcp-004-01/${NMOS_BCP00401_V1_0_TAG}/APIs/schemas/param_constraint.json
third_party/bcp-004-01/${NMOS_BCP00401_V1_0_TAG}/APIs/schemas/param_constraint_number.json
third_party/bcp-004-01/${NMOS_BCP00401_V1_0_TAG}/APIs/schemas/param_constraint_rational.json
third_party/bcp-004-01/${NMOS_BCP00401_V1_0_TAG}/APIs/schemas/param_constraint_string.json
third_party/bcp-004-01/${NMOS_BCP00401_V1_0_TAG}/APIs/schemas/receiver_constraint_sets.json
)

set(NMOS_BCP00401_SCHEMAS_JSON_MATCH "third_party/bcp-004-01/([^/]+)/APIs/schemas/([^;]+)\\.json")
set(NMOS_BCP00401_SCHEMAS_SOURCE_REPLACE "${CMAKE_CURRENT_BINARY_DIR_REPLACE}/nmos/bcp00401_schemas/\\1/\\2.cpp")
string(REGEX REPLACE "${NMOS_BCP00401_SCHEMAS_JSON_MATCH}(;|$)" "${NMOS_BCP00401_SCHEMAS_SOURCE_REPLACE}\\3" NMOS_BCP00401_V1_0_SCHEMAS_SOURCES "${NMOS_BCP00401_V1_0_SCHEMAS_JSON}")

foreach(JSON ${NMOS_BCP00401_V1_0_SCHEMAS_JSON})
string(REGEX REPLACE "${NMOS_BCP00401_SCHEMAS_JSON_MATCH}" "${NMOS_BCP00401_SCHEMAS_SOURCE_REPLACE}" SOURCE "${JSON}")
string(REGEX REPLACE "${NMOS_BCP00401_SCHEMAS_JSON_MATCH}" "\\1" NS "${JSON}")
string(REGEX REPLACE "${NMOS_BCP00401_SCHEMAS_JSON_MATCH}" "\\2" VAR "${JSON}")
string(MAKE_C_IDENTIFIER "${NS}" NS)
string(MAKE_C_IDENTIFIER "${VAR}" VAR)

file(WRITE "${SOURCE}.in" "\
// Auto-generated from: ${JSON}\n\
\n\
namespace nmos\n\
{\n\
namespace bcp00401_schemas\n\
{\n\
namespace ${NS}\n\
{\n\
const char* ${VAR} = R\"-auto-generated-(")

file(READ "${JSON}" RAW)
file(APPEND "${SOURCE}.in" "${RAW}")

file(APPEND "${SOURCE}.in" ")-auto-generated-\";\n\
}\n\
}\n\
}\n")

configure_file("${SOURCE}.in" "${SOURCE}" COPYONLY)
endforeach()

add_library(
nmos_bcp00401_schemas STATIC
${NMOS_BCP00401_SCHEMAS_HEADERS}
${NMOS_BCP00401_V1_0_SCHEMAS_SOURCES}
)

source_group("nmos\\bcp00401_schemas\\Header Files" FILES ${NMOS_BCP00401_SCHEMAS_HEADERS})
source_group("nmos\\bcp00401_schemas\\${NMOS_BCP00401_V1_0_TAG}\\Source Files" FILES ${NMOS_BCP00401_V1_0_SCHEMAS_SOURCES})

target_link_libraries(
nmos_bcp00401_schemas PRIVATE
nmos-cpp::compile-settings
)
target_include_directories(nmos_bcp00401_schemas PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${NMOS_CPP_INSTALL_INCLUDEDIR}>
)

list(APPEND NMOS_CPP_TARGETS nmos_bcp00401_schemas)
add_library(nmos-cpp::nmos_bcp00401_schemas ALIAS nmos_bcp00401_schemas)

# nmos-cpp library

set(NMOS_CPP_BST_SOURCES
Expand Down Expand Up @@ -1161,7 +1087,6 @@ target_link_libraries(
nmos-cpp::nmos_is08_schemas
nmos-cpp::nmos_is09_schemas
nmos-cpp::nmos_is11_schemas
nmos-cpp::nmos_bcp00401_schemas
nmos-cpp::mdns
nmos-cpp::slog
nmos-cpp::OpenSSL
Expand Down
25 changes: 0 additions & 25 deletions Development/nmos/bcp00401_schemas/bcp00401_schemas.h

This file was deleted.

36 changes: 0 additions & 36 deletions Development/nmos/json_schema.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "nmos/json_schema.h"

#include "cpprest/basic_utils.h"
#include "nmos/bcp00401_schemas/bcp00401_schemas.h"
#include "nmos/is04_versions.h"
#include "nmos/is04_schemas/is04_schemas.h"
#include "nmos/is05_versions.h"
Expand Down Expand Up @@ -146,21 +145,6 @@ namespace nmos
const web::uri senders_active_constraints_put_request_uri = make_schema_uri(tag, _XPLATSTR("constraints_active.json"));
}
}

namespace bcp00401_schemas
{
web::uri make_schema_uri(const utility::string_t& tag, const utility::string_t& ref = {})
{
return{ _XPLATSTR("https://github.com/AMWA-TV/bcp-004-01/raw/") + tag + _XPLATSTR("/APIs/schemas/") + ref };
}

// See https://github.com/AMWA-TV/bcp-004-01/tree/v1.0.x/APIs/schemas/
namespace v1_0
{
using namespace nmos::bcp00401_schemas::v1_0_x;
const utility::string_t tag(_XPLATSTR("v1.0.x"));
}
}
}

namespace nmos
Expand Down Expand Up @@ -363,25 +347,6 @@ namespace nmos
};
}

static std::map<web::uri, web::json::value> make_bcp00401_schemas()
{
using namespace nmos::bcp00401_schemas;

return
{
// v1.0
{ make_schema_uri(v1_0::tag, _XPLATSTR("constraint_set.json")), make_schema(v1_0::constraint_set) },
{ make_schema_uri(v1_0::tag, _XPLATSTR("constraint_sets.json")), make_schema(v1_0::constraint_sets) },
{ make_schema_uri(v1_0::tag, _XPLATSTR("param_constraint_boolean.json")), make_schema(v1_0::param_constraint_boolean) },
{ make_schema_uri(v1_0::tag, _XPLATSTR("param_constraint_integer.json")), make_schema(v1_0::param_constraint_integer) },
{ make_schema_uri(v1_0::tag, _XPLATSTR("param_constraint.json")), make_schema(v1_0::param_constraint) },
{ make_schema_uri(v1_0::tag, _XPLATSTR("param_constraint_number.json")), make_schema(v1_0::param_constraint_number) },
{ make_schema_uri(v1_0::tag, _XPLATSTR("param_constraint_rational.json")), make_schema(v1_0::param_constraint_rational) },
{ make_schema_uri(v1_0::tag, _XPLATSTR("param_constraint_string.json")), make_schema(v1_0::param_constraint_string) },
{ make_schema_uri(v1_0::tag, _XPLATSTR("receiver_constraint_sets.json")), make_schema(v1_0::receiver_constraint_sets) },
};
}

inline void merge(std::map<web::uri, web::json::value>& to, std::map<web::uri, web::json::value>&& from)
{
to.insert(from.begin(), from.end()); // std::map::merge in C++17
Expand All @@ -394,7 +359,6 @@ namespace nmos
merge(result, make_is08_schemas());
merge(result, make_is09_schemas());
merge(result, make_is11_schemas());
merge(result, make_bcp00401_schemas());
return result;
}

Expand Down
8 changes: 0 additions & 8 deletions Development/third_party/bcp-004-01/README.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 20b8a7d

Please sign in to comment.