spiegel-keyman/mac/is_same_version.sh
Marc Durdin f394245636 maint(common): consolidate builder scripts
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.

Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh

Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
  android/build.sh.
* Renames functions in builder-basic.inc.sh

More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.

Fixes: #14065
Build-bot: build all
Test-bot: skip
2025-08-02 08:11:24 +10:00

55 lines
1.4 KiB
Bash
Executable file

#!/usr/bin/env bash
# compares the version of this branch (in ../VERSION.md) to the
# version in the Xcode project file of the subproject named in $1
# returns zero if they are the same, non-zero if not the same or a problem occurs
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../resources/build/builder-basic.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE
#TODO:
exit 0
if [ $# -eq 1 ]
then
echo the argument is $1
ls -l ./$1/$1.xcodeproj/project.pbxproj || exit 1
else
echo there must be exactly one argument, e.g. Keyman4MacIM
exit 1;
fi
# priming PRODUCT_VERSION to -99.9
PRODUCT_VERSION=-99.9
# grepping for PRODUCT_VERSION
PROJ_PROD_VERSION_LINE=`grep "PRODUCT_VERSION = " ./$1/$1.xcodeproj/project.pbxproj | head -1`
# the grepped line is
# $PROJ_PROD_VERSION_LINE
# writing the line to PROJ_VERSION.md with exact spacing
echo $PROJ_PROD_VERSION_LINE | sed /\ /s///g > ./PROJ_VERSION.md
# the exact line is now
# cat PROJ_VERSION.md
# executing the modified line
. ./PROJ_VERSION.md
echo Product version in the project file PRODUCT_VERSION is $PRODUCT_VERSION
echo Keyman version VERSION is $KEYMAN_VERSION
if [ x$KEYMAN_VERSION = x$PRODUCT_VERSION ]
then
echo the versions are the same, all is well.
# clean up
rm ./PROJ_VERSION.md
exit 0
else
echo the version $KEYMAN_VERSION and $PRODUCT_VERSION are NOT the same!
exit 1
fi