5 progname=$(basename "${BASH_SOURCE[0]}")
6 script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
7 nnfw_root="$( cd "${script_dir%*/*/*}" && pwd )"
10 echo "Usage: $progname version"
11 echo "Update or show onert version information"
14 echo " -h show this help"
15 echo " -s set onert version"
18 echo " $progname => show current onert version"
19 echo " $progname -s 1.6.0 => set onert version info in all sources"
24 version_line=$(cat ${nnfw_root}/packaging/nnfw.spec | grep "Version:")
25 echo ${version_line#"Version:"}
32 perl -pi -e "s/^release = .*/release = \'$version\'/" ${nnfw_root}/docs/conf.py
33 perl -pi -e "s/^Version: .*/Version: $version/" ${nnfw_root}/packaging/nnfw.spec
35 IFS=. read M m p <<< "$version"
36 hex=$(printf '0x%08x' $(( (($M << 24)) | (($m << 8)) | $p )))
37 perl -pi -e "s/^#define NNFW_VERSION.*/#define NNFW_VERSION $hex/" ${nnfw_root}/runtime/onert/api/include/nnfw_version.h
39 perl -pi -e "s/versionName .*$/versionName \"$version\"/" ${nnfw_root}/runtime/contrib/android/api/build.gradle
46 while getopts "hs:" OPTION; do
49 s) set_version "$OPTARG";;