1 Star 0 Fork 1

樱庭初雪/linux-rga

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
genversion.sh 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
Yu Qiaowei 提交于 2021-04-27 15:08 . Delete debug print.
#!/bin/bash
CURRENTDIR=`dirname $0`
cd $CURRENTDIR
rm -f $CURRENTDIR/version.h
commit_ts=`git log -1 --format="%ct"`
commit_time=`date -d@$commit_ts +"%Y-%m-%d %H:%M:%S"`
current_time=`date +"%Y-%m-%d %H:%M:%S"`
git_version=`git log -1 --format="%h"`
current_product=$TARGET_PRODUCT
VERSION_TARGET="$(cat version.h.template | sed -e 's/\$GIT_BUILD_VERSION/'"$git_version build: $current_time"'/g' -e 's/\$PRODUCT_BASE/'"$current_product"'/g' version.h.template)"
#Only when compiling with CMAKE in linux, will the current directory generate version.h.
if [ $TARGET_PRODUCT ];then
if [ "$1" = "Android.mk" ];then
echo RGA is compiling with Android.mk
echo "${VERSION_TARGET}" > version.h
elif [ "$1" = "Android.bp" ];then
echo RGA is compiling with Android.bp
echo "${VERSION_TARGET}" > version.h
#echo "${VERSION_TARGET}"
else
echo $TARGET_PRODUCT requires subcommands!
exit 1
fi
elif [ "$1" = "meson" ];then
echo RGA is compiling with meson
echo "${VERSION_TARGET}"
elif [ "$1" = "cmake" ];then
echo RGA is compiling with cmake
echo "${VERSION_TARGET}" > version.h
else
echo Requires subcommands!
exit 2
fi
echo "Generated version.h"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yichuxue/linux-rga.git
git@gitee.com:yichuxue/linux-rga.git
yichuxue
linux-rga
linux-rga
im2d

搜索帮助