17 Star 1 Fork 4

openKylin/gpac

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
version.bat 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
周淦清 提交于 2024-04-25 18:54 . Import Upstream version 2.0.0+dfsg1
@echo off
set OLDDIR=%CD%
cd /d %~dp0
IF NOT EXIST .\.git\NUL GOTO not_git
for /f "delims=" %%a in ('git describe --tags --long') do @set VERSION=%%a
for /f "delims=" %%a in ('git describe --tags --abbrev^=0') do @set TAG=%%a-
for /f "delims=" %%a in ('git rev-parse --abbrev-ref HEAD') do @set BRANCH=%%a
REM remove anotated tag from VERSION
setlocal enabledelayedexpansion
call set VERSION=%%VERSION:!TAG!=%%
setlocal disabledelayedexpansion
echo #define GPAC_GIT_REVISION "%VERSION%-%BRANCH%" > test.h
:write_file
if not exist include\gpac\revision.h goto create
ECHO n|COMP test.h include\gpac\revision.h > nul
if errorlevel 1 goto create
DEL test.h
goto done
:create
MOVE /Y test.h include\gpac\revision.h
goto done
:not_git
echo "not a git dir"
find /c "-DEV" include\gpac\version.h >nul
if %errorlevel% equ 1 goto rel_tag
echo "unknwon tag"
@echo off
echo #define GPAC_GIT_REVISION "UNKNOWN_REV" > test.h
goto write_file
:rel_tag
echo "release tag"
@echo off
echo #define GPAC_GIT_REVISION "release" > test.h
goto write_file
:done
cd /d %OLDDIR%
exit/b
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openkylin/gpac.git
git@gitee.com:openkylin/gpac.git
openkylin
gpac
gpac
tmp

搜索帮助