代码拉取完成,页面将自动刷新
#!/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"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。