Skip to content

Commit

Permalink
Added OPENSCAD_COMMIT define to show which git commit a binary actual…
Browse files Browse the repository at this point in the history
…ly 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
  • Loading branch information
kintel committed Jan 14, 2012
1 parent 0e9274a commit 2217eff
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
9 changes: 7 additions & 2 deletions scripts/publish-macosx.sh
@@ -1,15 +1,20 @@
#!/bin/sh #!/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 #VERSION=2011.12


if test -z "$VERSION"; then
VERSION=`date "+%Y.%m.%d"`
COMMIT=-c
fi

# Turn off ccache, just for safety # Turn off ccache, just for safety
PATH=${PATH//\/opt\/local\/libexec\/ccache:} PATH=${PATH//\/opt\/local\/libexec\/ccache:}


# This is the same location as DEPLOYDIR in macosx-build-dependencies.sh # This is the same location as DEPLOYDIR in macosx-build-dependencies.sh
export OPENSCAD_LIBRARIES=$PWD/../libraries/install export OPENSCAD_LIBRARIES=$PWD/../libraries/install


`dirname $0`/release-common.sh -v $VERSION `dirname $0`/release-common.sh -v $VERSION $COMMIT
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
exit 1 exit 1
fi fi
Expand Down
14 changes: 9 additions & 5 deletions scripts/release-common.sh
Expand Up @@ -7,16 +7,19 @@
# The script will create a file called openscad-<versionstring>.zip # The script will create a file called openscad-<versionstring>.zip
# in the current directory. # 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) # -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 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 # 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() printUsage()
{ {
echo "Usage: $0 -v <versionstring> echo "Usage: $0 -v <versionstring> -c
echo echo
echo " Example: $0 -v 2010.01 echo " Example: $0 -v 2010.01
} }
Expand All @@ -29,10 +32,11 @@ fi


echo "Detected OS: $OS" echo "Detected OS: $OS"


while getopts 'v:' c while getopts 'v:c' c
do do
case $c in case $c in
v) VERSION=$OPTARG;; v) VERSION=$OPTARG;;
c) OPENSCAD_COMMIT=`git log -1 --pretty=format:"%h"`
esac esac
done done


Expand Down Expand Up @@ -66,10 +70,10 @@ esac


case $OS in case $OS in
LINXWIN) 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 esac


Expand Down
6 changes: 5 additions & 1 deletion src/mainwin.cc
Expand Up @@ -101,7 +101,11 @@ unsigned int GuiLocker::gui_locked = 0;
#define QUOTED(x__) QUOTE(x__) #define QUOTED(x__) QUOTE(x__)


static char helptitle[] = 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[] = static char copyrighttext[] =
"Copyright (C) 2009-2011 Marius Kintel <marius@kintel.net> and Clifford Wolf <clifford@clifford.at>\n" "Copyright (C) 2009-2011 Marius Kintel <marius@kintel.net> and Clifford Wolf <clifford@clifford.at>\n"
"\n" "\n"
Expand Down
4 changes: 4 additions & 0 deletions version.pri
Expand Up @@ -66,3 +66,7 @@ VERSION_DAY=$${VERSION_DAY}.0


DEFINES += OPENSCAD_VERSION=$$VERSION OPENSCAD_YEAR=$$VERSION_YEAR OPENSCAD_MONTH=$$VERSION_MONTH DEFINES += OPENSCAD_VERSION=$$VERSION OPENSCAD_YEAR=$$VERSION_YEAR OPENSCAD_MONTH=$$VERSION_MONTH
!isEmpty(VERSION_DAY): DEFINES += OPENSCAD_DAY=$$VERSION_DAY !isEmpty(VERSION_DAY): DEFINES += OPENSCAD_DAY=$$VERSION_DAY

!isEmpty(OPENSCAD_COMMIT) {
DEFINES += OPENSCAD_COMMIT=$$OPENSCAD_COMMIT
}

0 comments on commit 2217eff

Please sign in to comment.