Browse Source

scripts/printversion.sh: accept PRISM source directory as argument

Rather than overriding the default path to the PRISM source directory by
setting the PRISM_SRC_DIR environment variable, do so by supplying an
argument to the script.
accumulation-v4.7
Chris Novakovic 7 years ago
committed by Dave Parker
parent
commit
5326d326fe
  1. 2
      prism/Makefile
  2. 10
      prism/src/scripts/printversion.sh

2
prism/Makefile

@ -550,7 +550,7 @@ clean_doc:
# Set up version, in particular for building releases # Set up version, in particular for building releases
# Unless VERSION has been passed in (as VERSION=xxx), # Unless VERSION has been passed in (as VERSION=xxx),
# extract version number from Java code using printversion # extract version number from Java code using printversion
VERSION = $(shell PRISM_SRC_DIR=$(PRISM_SRC_DIR) $(PRISM_SRC_DIR)/scripts/printversion.sh 2> /dev/null)
VERSION = $(shell $(PRISM_SRC_DIR)/scripts/printversion.sh $(PRISM_SRC_DIR) 2> /dev/null)
# Default branch for building source releases # Default branch for building source releases
BRANCH = master BRANCH = master

10
prism/src/scripts/printversion.sh

@ -4,13 +4,11 @@
# based on extraction of the info from Java files. # based on extraction of the info from Java files.
# Mirrors what is done (in Java) in prism.getVersion(). # Mirrors what is done (in Java) in prism.getVersion().
# If given, PRISM_SRC_DIR is assumed to point to the
# "src" directory in a PRISM source distribution. The
# default is just "src".
# If given, the first argument to the script is assumed
# to point to the "src" directory in a PRISM source
# distribution. The default is just "src".
if [ "$PRISM_SRC_DIR" = "" ]; then
PRISM_SRC_DIR=src;
fi
PRISM_SRC_DIR="${1:-src}"
if [ -f "$PRISM_SRC_DIR"/prism/Version.java ]; then if [ -f "$PRISM_SRC_DIR"/prism/Version.java ]; then
VERSION_NUM=`grep versionString "$PRISM_SRC_DIR"/prism/Version.java | sed -E 's/[^"]+"([^"]+)"[^"]+/\1/'` VERSION_NUM=`grep versionString "$PRISM_SRC_DIR"/prism/Version.java | sed -E 's/[^"]+"([^"]+)"[^"]+/\1/'`

Loading…
Cancel
Save