mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 13:14:32 +02:00
Merge branch 'bugfix/git_describe' into 'master'
tools: Use git describe --match for filtering out internal names Closes IDF-2410 See merge request espressif/esp-idf!12398
This commit is contained in:
@@ -338,7 +338,7 @@ endif
|
|||||||
|
|
||||||
# If we have `version.txt` then prefer that for extracting IDF version
|
# If we have `version.txt` then prefer that for extracting IDF version
|
||||||
ifeq ("$(wildcard ${IDF_PATH}/version.txt)","")
|
ifeq ("$(wildcard ${IDF_PATH}/version.txt)","")
|
||||||
IDF_VER_T := $(shell cd ${IDF_PATH} && git describe --always --dirty)
|
IDF_VER_T := $(shell cd ${IDF_PATH} && git describe --always --dirty --match v*.*)
|
||||||
else
|
else
|
||||||
IDF_VER_T := $(shell cat ${IDF_PATH}/version.txt)
|
IDF_VER_T := $(shell cat ${IDF_PATH}/version.txt)
|
||||||
endif
|
endif
|
||||||
|
@@ -146,6 +146,22 @@ function run_tests()
|
|||||||
idf.py reconfigure || failure "Failed to use IDF_VERSION_MAJOR in component CMakeLists.txt"
|
idf.py reconfigure || failure "Failed to use IDF_VERSION_MAJOR in component CMakeLists.txt"
|
||||||
git checkout -- main/CMakeLists.txt
|
git checkout -- main/CMakeLists.txt
|
||||||
|
|
||||||
|
print_status "Project is in ESP-IDF which has a custom tag"
|
||||||
|
pushd ${IDF_PATH}/examples/get-started/hello_world
|
||||||
|
git config user.email "noone@espressif.com"
|
||||||
|
git config user.name "No One"
|
||||||
|
git tag mytag -a -m "mytag"
|
||||||
|
idf.py reconfigure &> log.log || failure "Failed to build"
|
||||||
|
str="App \"hello-world\" version: mytag"
|
||||||
|
grep "${str}" log.log || { cat log.log ; failure "Project version should be the custom tag"; }
|
||||||
|
idf_version=$(idf.py --version)
|
||||||
|
if [[ "$idf_version" == *"mytag"* ]]; then
|
||||||
|
failure "IDF version $idf_version should not contain mytag"
|
||||||
|
fi
|
||||||
|
git tag -d mytag
|
||||||
|
rm -rf sdkconfig build
|
||||||
|
popd
|
||||||
|
|
||||||
print_status "Moving BUILD_DIR_BASE out of tree"
|
print_status "Moving BUILD_DIR_BASE out of tree"
|
||||||
clean_build_dir
|
clean_build_dir
|
||||||
OUTOFTREE_BUILD=${TESTDIR}/alt_build
|
OUTOFTREE_BUILD=${TESTDIR}/alt_build
|
||||||
|
@@ -64,7 +64,7 @@ endfunction()
|
|||||||
#
|
#
|
||||||
function(__build_get_idf_git_revision)
|
function(__build_get_idf_git_revision)
|
||||||
idf_build_get_property(idf_path IDF_PATH)
|
idf_build_get_property(idf_path IDF_PATH)
|
||||||
git_describe(idf_ver_git "${idf_path}")
|
git_describe(idf_ver_git "${idf_path}" "--match v*.*")
|
||||||
if(EXISTS "${idf_path}/version.txt")
|
if(EXISTS "${idf_path}/version.txt")
|
||||||
file(STRINGS "${idf_path}/version.txt" idf_ver_t)
|
file(STRINGS "${idf_path}/version.txt" idf_ver_t)
|
||||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${idf_path}/version.txt")
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${idf_path}/version.txt")
|
||||||
|
@@ -55,7 +55,8 @@ def idf_version():
|
|||||||
version = subprocess.check_output([
|
version = subprocess.check_output([
|
||||||
'git',
|
'git',
|
||||||
'--git-dir=%s' % os.path.join(os.environ['IDF_PATH'], '.git'),
|
'--git-dir=%s' % os.path.join(os.environ['IDF_PATH'], '.git'),
|
||||||
'--work-tree=%s' % os.environ['IDF_PATH'], 'describe', '--tags', '--dirty'
|
'--work-tree=%s' % os.environ['IDF_PATH'],
|
||||||
|
'describe', '--tags', '--dirty', '--match', 'v*.*',
|
||||||
]).decode('utf-8', 'ignore').strip()
|
]).decode('utf-8', 'ignore').strip()
|
||||||
except (subprocess.CalledProcessError, UnicodeError):
|
except (subprocess.CalledProcessError, UnicodeError):
|
||||||
# if failed, then try to parse cmake.version file
|
# if failed, then try to parse cmake.version file
|
||||||
|
Reference in New Issue
Block a user