summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-01-14 16:37:34 (GMT)
committerMarius Kintel <marius@kintel.net>2012-01-14 16:37:34 (GMT)
commit2217eff627443bcedb14441c9ae58fb62a4b52d5 (patch)
treebc129ba9ff93b595747be23ce1e236453bd2d78e
parent0e9274a1daddc5cfd1fd095eea3cc9ff8732d325 (diff)
Added OPENSCAD_COMMIT define to show which git commit a binary actually is built from in the about box. Pass -c to release_common.sh to turn this on. Please use this for development builds, see publish-macosx.sh for how development vs. release is handled
-rwxr-xr-xscripts/publish-macosx.sh9
-rwxr-xr-xscripts/release-common.sh14
-rw-r--r--src/mainwin.cc6
-rw-r--r--version.pri4
4 files changed, 25 insertions, 8 deletions
diff --git a/scripts/publish-macosx.sh b/scripts/publish-macosx.sh
index a2451fa..a2ded8a 100755
--- a/scripts/publish-macosx.sh
+++ b/scripts/publish-macosx.sh
@@ -1,15 +1,20 @@
#!/bin/sh
-VERSION=`date "+%Y.%m.%d"`
+# Set this if we're doing a release build. Comment it out for development builds
#VERSION=2011.12
+if test -z "$VERSION"; then
+ VERSION=`date "+%Y.%m.%d"`
+ COMMIT=-c
+fi
+
# Turn off ccache, just for safety
PATH=${PATH//\/opt\/local\/libexec\/ccache:}
# This is the same location as DEPLOYDIR in macosx-build-dependencies.sh
export OPENSCAD_LIBRARIES=$PWD/../libraries/install
-`dirname $0`/release-common.sh -v $VERSION
+`dirname $0`/release-common.sh -v $VERSION $COMMIT
if [[ $? != 0 ]]; then
exit 1
fi
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
index 9f03ee5..296c14a 100755
--- a/scripts/release-common.sh
+++ b/scripts/release-common.sh
@@ -7,16 +7,19 @@
# The script will create a file called openscad-<versionstring>.zip
# in the current directory.
#
-# Usage: release-common.sh [-v <versionstring>]
+# Usage: release-common.sh [-v <versionstring>] [-c]
# -v Version string (e.g. -v 2010.01)
+# -c Build with commit info
#
# If no version string is given, todays date will be used (YYYY-MM-DD)
# If no make target is given, release will be used on Windows, none one Mac OS X
#
+# The commit info will extracted from git and be passed to qmake as OPENSCAD_COMMIT
+# to identify a build in the about box.
printUsage()
{
- echo "Usage: $0 -v <versionstring>
+ echo "Usage: $0 -v <versionstring> -c
echo
echo " Example: $0 -v 2010.01
}
@@ -29,10 +32,11 @@ fi
echo "Detected OS: $OS"
-while getopts 'v:' c
+while getopts 'v:c' c
do
case $c in
v) VERSION=$OPTARG;;
+ c) OPENSCAD_COMMIT=`git log -1 --pretty=format:"%h"`
esac
done
@@ -66,10 +70,10 @@ esac
case $OS in
LINXWIN)
- i686-pc-mingw32-qmake VERSION=$VERSION CONFIG+=$CONFIG CONFIG+=mingw-cross-env CONFIG-=debug openscad.pro
+ i686-pc-mingw32-qmake VERSION=$VERSION OPENSCAD_COMMIT=$OPENSCAD_COMMIT CONFIG+=$CONFIG CONFIG+=mingw-cross-env CONFIG-=debug openscad.pro
;;
*)
- qmake VERSION=$VERSION CONFIG+=$CONFIG CONFIG-=debug openscad.pro
+ qmake VERSION=$VERSION OPENSCAD_COMMIT=$OPENSCAD_COMMIT CONFIG+=$CONFIG CONFIG-=debug openscad.pro
;;
esac
diff --git a/src/mainwin.cc b/src/mainwin.cc
index a8507c0..cbfa46a 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -101,7 +101,11 @@ unsigned int GuiLocker::gui_locked = 0;
#define QUOTED(x__) QUOTE(x__)
static char helptitle[] =
- "OpenSCAD " QUOTED(OPENSCAD_VERSION) " (www.openscad.org)\n\n";
+ "OpenSCAD " QUOTED(OPENSCAD_VERSION)
+#ifdef OPENSCAD_COMMIT
+ " (git " QUOTED(OPENSCAD_COMMIT) ")"
+#endif
+ "\nhttp://www.openscad.org\n\n";
static char copyrighttext[] =
"Copyright (C) 2009-2011 Marius Kintel <marius@kintel.net> and Clifford Wolf <clifford@clifford.at>\n"
"\n"
diff --git a/version.pri b/version.pri
index 6b91ecd..e490d7d 100644
--- a/version.pri
+++ b/version.pri
@@ -66,3 +66,7 @@ VERSION_DAY=$${VERSION_DAY}.0
DEFINES += OPENSCAD_VERSION=$$VERSION OPENSCAD_YEAR=$$VERSION_YEAR OPENSCAD_MONTH=$$VERSION_MONTH
!isEmpty(VERSION_DAY): DEFINES += OPENSCAD_DAY=$$VERSION_DAY
+
+!isEmpty(OPENSCAD_COMMIT) {
+ DEFINES += OPENSCAD_COMMIT=$$OPENSCAD_COMMIT
+}
contact: Jan Huwald // Impressum