Skip to content

Commit d122ca9

Browse files
committed
[C++ SDK] Refactor version increment (#16426)
1 parent 3a691a1 commit d122ca9

File tree

7 files changed

+19
-7
lines changed

7 files changed

+19
-7
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ set(YDB_SDK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
1616
set(YDB_SDK_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
1717
set(YDB-CPP-SDK_AVAILABLE_COMPONENTS "" CACHE INTERNAL "")
1818
set(YDB-CPP-SDK_COMPONENT_TARGETS "" CACHE INTERNAL "")
19-
file(READ "src/client/resources/ydb_sdk_version.txt" YDB_SDK_VERSION)
19+
file(READ "src/version.h" YDB_SDK_VERSION_FILE_RAW)
20+
string(REGEX MATCH "YDB_SDK_VERSION = \"([0-9]+\\.[0-9]+\\.[0-9]+)\"" _ ${YDB_SDK_VERSION_FILE_RAW})
21+
set(YDB_SDK_VERSION ${CMAKE_MATCH_1})
22+
message(STATUS "YDB С++ SDK version: ${YDB_SDK_VERSION}")
2023

2124
#[=============================================================================[
2225
NOTE: if `ccache` is used with the environment variable `CCACHE_BASEDIR`,

include/ydb-cpp-sdk/type_switcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <string>
44

55
namespace NYdb {
6-
inline namespace Dev {
6+
inline namespace V3 {
77

88
using TStringType = std::string;
99

src/client/resources/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ target_sources(client-resources.global PRIVATE
1919
resources(client-resources.global
2020
${YDB_SDK_BINARY_DIR}/src/client/resources/6ed212bf45019efe2a5e72b6d5ed50fb.cpp
2121
INPUTS
22-
${YDB_SDK_SOURCE_DIR}/src/client/resources/ydb_sdk_version.txt
2322
${YDB_SDK_SOURCE_DIR}/src/client/resources/ydb_root_ca.pem
2423
KEYS
25-
ydb_sdk_version_v3.txt
2624
ydb_root_ca_v3.pem
2725
)
2826

src/client/resources/ydb_ca.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
#include <ydb-cpp-sdk/client/resources/ydb_ca.h>
44

5+
#include <src/version.h>
6+
57
namespace NYdb::inline V3 {
68

79
std::string GetRootCertificate() {
8-
return NResource::Find("ydb_root_ca_dev.pem");
10+
return NResource::Find(YDB_CERTIFICATE_FILE_KEY);
911
}
1012

1113
} // namespace NYdb

src/client/resources/ydb_resources.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include <ydb-cpp-sdk/client/resources/ydb_resources.h>
44

5+
#include <src/version.h>
6+
57
namespace NYdb::inline V3 {
68

79
const char* YDB_AUTH_TICKET_HEADER = "x-ydb-auth-ticket";
@@ -29,7 +31,7 @@ const char* YDB_CLIENT_CAPABILITY_SESSION_BALANCER = "session-balancer";
2931

3032

3133
std::string GetSdkSemver() {
32-
return NResource::Find("ydb_sdk_version_dev.txt");
34+
return YDB_SDK_VERSION;
3335
}
3436

3537
} // namespace NYdb

src/client/resources/ydb_sdk_version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/version.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#pragma once
2+
3+
namespace NYdb {
4+
5+
inline const char* YDB_SDK_VERSION = "3.3.0";
6+
inline const char* YDB_CERTIFICATE_FILE_KEY = "ydb_root_ca_v3.pem";
7+
8+
} // namespace NYdb

0 commit comments

Comments
 (0)