From 76a4ce41251662ab99cf7e264a499a46f2ef2c59 Mon Sep 17 00:00:00 2001 From: Liu Hancheng Date: Thu, 1 Dec 2022 16:44:31 +0800 Subject: [PATCH 1/3] Refactor: move VERSION to src/folder --- CMakeLists.txt | 2 +- VERSION => src/VERSION | 0 x.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename VERSION => src/VERSION (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 348d7aa3d1e..189e9683ba6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,7 +147,7 @@ list(APPEND EXTERNAL_LIBS Threads::Threads) # Add git sha to version.h find_package(Git REQUIRED) -execute_process(COMMAND sh -c "cat VERSION" +execute_process(COMMAND sh -c "cat src/VERSION" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE PROJECT_VERSION) execute_process(COMMAND git rev-parse --short HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GIT_SHA) diff --git a/VERSION b/src/VERSION similarity index 100% rename from VERSION rename to src/VERSION diff --git a/x.py b/x.py index 5aecb8541ea..c44db1d589a 100755 --- a/x.py +++ b/x.py @@ -212,7 +212,7 @@ def write_version(release_version: str) -> str: if SEMVER_REGEX.match(version) is None: raise RuntimeError(f"Kvrocks version should follow semver spec, got: {version}") - with open('VERSION', 'w+') as f: + with open('src/VERSION', 'w+') as f: f.write(version) return version From b312f97b68c1933dcf2f3213b4c27a1104665efb Mon Sep 17 00:00:00 2001 From: Liu Hancheng Date: Thu, 1 Dec 2022 19:15:57 +0800 Subject: [PATCH 2/3] try to fix failed test --- CMakeLists.txt | 2 +- src/{VERSION => .VERSION} | 0 x.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/{VERSION => .VERSION} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 189e9683ba6..0066f5ae63d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,7 +147,7 @@ list(APPEND EXTERNAL_LIBS Threads::Threads) # Add git sha to version.h find_package(Git REQUIRED) -execute_process(COMMAND sh -c "cat src/VERSION" +execute_process(COMMAND sh -c "cat src/.VERSION" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE PROJECT_VERSION) execute_process(COMMAND git rev-parse --short HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GIT_SHA) diff --git a/src/VERSION b/src/.VERSION similarity index 100% rename from src/VERSION rename to src/.VERSION diff --git a/x.py b/x.py index c44db1d589a..aeed6a9a591 100755 --- a/x.py +++ b/x.py @@ -212,7 +212,7 @@ def write_version(release_version: str) -> str: if SEMVER_REGEX.match(version) is None: raise RuntimeError(f"Kvrocks version should follow semver spec, got: {version}") - with open('src/VERSION', 'w+') as f: + with open('src/.VERSION', 'w+') as f: f.write(version) return version From 3ab8b1f1c6eecb665ad8e73d6c8968ff95fc04c3 Mon Sep 17 00:00:00 2001 From: Liu Hancheng Date: Thu, 1 Dec 2022 21:59:36 +0800 Subject: [PATCH 3/3] refactor: change .version to version.txt --- CMakeLists.txt | 2 +- src/{.VERSION => VERSION.txt} | 0 x.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/{.VERSION => VERSION.txt} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0066f5ae63d..406306a1b26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,7 +147,7 @@ list(APPEND EXTERNAL_LIBS Threads::Threads) # Add git sha to version.h find_package(Git REQUIRED) -execute_process(COMMAND sh -c "cat src/.VERSION" +execute_process(COMMAND sh -c "cat src/VERSION.txt" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE PROJECT_VERSION) execute_process(COMMAND git rev-parse --short HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GIT_SHA) diff --git a/src/.VERSION b/src/VERSION.txt similarity index 100% rename from src/.VERSION rename to src/VERSION.txt diff --git a/x.py b/x.py index aeed6a9a591..09a69d4cc17 100755 --- a/x.py +++ b/x.py @@ -212,7 +212,7 @@ def write_version(release_version: str) -> str: if SEMVER_REGEX.match(version) is None: raise RuntimeError(f"Kvrocks version should follow semver spec, got: {version}") - with open('src/.VERSION', 'w+') as f: + with open('src/VERSION.txt', 'w+') as f: f.write(version) return version