mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
chore: add current version in OSX's .plist file(s) with a script
Also add a script to update both osx and windows versions.
This commit is contained in:
parent
fb96dd633e
commit
c717f128da
|
@ -17,7 +17,6 @@
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>qTox</string>
|
<string>qTox</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.4.1</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>@SHORT_VERSION@</string>
|
<string>@SHORT_VERSION@</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
|
|
|
@ -212,6 +212,9 @@ update() {
|
||||||
build() {
|
build() {
|
||||||
fcho "------------------------------"
|
fcho "------------------------------"
|
||||||
fcho "Starting build process ..."
|
fcho "Starting build process ..."
|
||||||
|
# update version info
|
||||||
|
./tools/update-versions.sh
|
||||||
|
|
||||||
rm -rf $BUILD_DIR
|
rm -rf $BUILD_DIR
|
||||||
rm -rf $DEPLOY_DIR
|
rm -rf $DEPLOY_DIR
|
||||||
mkdir $BUILD_DIR
|
mkdir $BUILD_DIR
|
||||||
|
|
51
osx/update-plist-version.sh
Executable file
51
osx/update-plist-version.sh
Executable file
|
@ -0,0 +1,51 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright © 2016 The qTox Project Contributors
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
# script to append correct qTox version to `.plist` file from
|
||||||
|
# `git describe`
|
||||||
|
#
|
||||||
|
# NOTE: it checkouts the files before appending a version to them!
|
||||||
|
#
|
||||||
|
# requires:
|
||||||
|
# * correctly formatted `*.plist file(s) in working dir
|
||||||
|
# * git – tags in format `v0.0.0`
|
||||||
|
# * GNU sed
|
||||||
|
|
||||||
|
# usage:
|
||||||
|
#
|
||||||
|
# ./$script
|
||||||
|
|
||||||
|
set -eu -o pipefail
|
||||||
|
|
||||||
|
# uses `get_version()`
|
||||||
|
source "../tools/lib/git.source"
|
||||||
|
|
||||||
|
|
||||||
|
# append version to .plist file(s) after the right line
|
||||||
|
append_version() {
|
||||||
|
local after_line=' <key>CFBundleVersion'
|
||||||
|
local append=" <string>$(get_version)<\/string>"
|
||||||
|
|
||||||
|
for plist in *.plist
|
||||||
|
do
|
||||||
|
git checkout "$plist"
|
||||||
|
sed -i"" -e "/$after_line/a\\
|
||||||
|
$append" "$plist"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
append_version
|
28
tools/lib/git.source
Normal file
28
tools/lib/git.source
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright © 2016 The qTox Project Contributors
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
# source for scripts using git-based functionality
|
||||||
|
|
||||||
|
set -e -o pipefail
|
||||||
|
|
||||||
|
# Get numerical version from git tag, parts of version separated by dots
|
||||||
|
# from e.g. `v123.456.789` get `123.456.789` part
|
||||||
|
get_version() {
|
||||||
|
git describe --abbrev=0 \
|
||||||
|
| sed -e 's/^v//'
|
||||||
|
}
|
55
tools/update-versions.sh
Executable file
55
tools/update-versions.sh
Executable file
|
@ -0,0 +1,55 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright © 2016 The qTox Project Contributors
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
# script to add versions to the files for osx and windows "packages"
|
||||||
|
#
|
||||||
|
# it should be run by the `qTox-Mac-Deployer-ULTIMATE.sh`
|
||||||
|
#
|
||||||
|
# NOTE: it checkouts the files before appending a version to them!
|
||||||
|
#
|
||||||
|
# requires:
|
||||||
|
# * git – tags in format `v0.0.0`
|
||||||
|
# * GNU sed
|
||||||
|
|
||||||
|
# usage:
|
||||||
|
#
|
||||||
|
# ./$script
|
||||||
|
|
||||||
|
|
||||||
|
set -eu -o pipefail
|
||||||
|
|
||||||
|
|
||||||
|
update_windows() {
|
||||||
|
( cd windows
|
||||||
|
./qtox-nsi-version.sh )
|
||||||
|
}
|
||||||
|
|
||||||
|
update_osx() {
|
||||||
|
( cd osx
|
||||||
|
./update-plist-version.sh )
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
update_osx
|
||||||
|
# osx cannot into proper sed
|
||||||
|
if [[ ! "$OSTYPE" == "darwin"* ]]
|
||||||
|
then
|
||||||
|
update_windows
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
main
|
|
@ -18,6 +18,8 @@
|
||||||
# script to append correct qTox version to `.nsi` files from
|
# script to append correct qTox version to `.nsi` files from
|
||||||
# `git describe`
|
# `git describe`
|
||||||
#
|
#
|
||||||
|
# NOTE: it checkouts the files before appending a version to them!
|
||||||
|
#
|
||||||
# requires:
|
# requires:
|
||||||
# * files `qtox.nsi` and `qtox64.nsi` in working dir
|
# * files `qtox.nsi` and `qtox64.nsi` in working dir
|
||||||
# * git – tags in format `v0.0.0`
|
# * git – tags in format `v0.0.0`
|
||||||
|
@ -29,14 +31,8 @@
|
||||||
|
|
||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
|
|
||||||
|
# uses `get_version()`
|
||||||
# from e.g. `v123.456.789-321-asdf` get `123.456.789` part
|
source "../tools/lib/git.source"
|
||||||
get_version() {
|
|
||||||
git describe --tags \
|
|
||||||
| sed -r \
|
|
||||||
-e 's/^v//' \
|
|
||||||
-e 's/^(([[:digit:]]+\.){2}[[:digit:]]+)-.*/\1/'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# append version to .nsi files after a certain line
|
# append version to .nsi files after a certain line
|
||||||
|
@ -46,6 +42,7 @@ append_version() {
|
||||||
|
|
||||||
for nsi in *.nsi
|
for nsi in *.nsi
|
||||||
do
|
do
|
||||||
|
git checkout "$nsi"
|
||||||
sed -i "/$after_line/a\\$append \"$(get_version)\"" "$nsi"
|
sed -i "/$after_line/a\\$append \"$(get_version)\"" "$nsi"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user