Index: configure
===================================================================
--- configure (revision 1342)
+++ configure (working copy)
@@ -97,6 +97,20 @@
MAKE=make
fi
+# If the user included the --snapshot argument, mark it down.
+if [[ $1 = "--snapshot" ]]
+then
+ SNAPSHOT=1
+else
+ SNAPSHOT=0
+fi
+
+# Generating the HB_BUILD and HB_VERSION for snapshots requires
+# the build date, working path, and current SVN revision.
+BUILD_DATE=$(date +%Y%m%d)
+FULL_PATH=$(pwd)
+SVN_REV=$(svn info | awk '/^Revision:/ {print $2}')
+
# Generate config.jam
rm -f config.jam
cat << EOF > config.jam
@@ -109,6 +123,10 @@
DEFINES = $DEFINES ;
LINKLIBS = $LINKLIBS ;
MAKE = $MAKE ;
+SNAPSHOT = $SNAPSHOT ;
+BUILD_DATE = $BUILD_DATE ;
+FULL_PATH = $FULL_PATH ;
+SVN_REV = $SVN_REV ;
EOF
echo
Index: Makefile.config
===================================================================
--- Makefile.config (revision 1342)
+++ Makefile.config (working copy)
@@ -1,15 +1,22 @@
-SNAP = $(shell echo $$SNAPSHOT)
-ifeq ($(SNAP), 1)
+# This line needs to be manually bumped for each release.
+HB_VERSION = 0.9.2
+
+# Use the current date for the build number
HB_BUILD = $(shell date "+%Y%m%d")00
-HB_VERSION = 0.9.2s$(shell date "+%d")
-else
-HB_BUILD = $(shell date "+%Y%m%d")00
-HB_VERSION = "0.9.2"
-endif
+
+# Do the same for snapshots but mark as unstable
+SNAP_HB_BUILD = $(shell date "+%Y%m%d")01
+
+# For snapshots add the svn revision number to the HB_VERSION
+SNAP_HB_VERSION = $(HB_VERSION)svn$(shell svn info | awk '/^Revision:/' | sed s/Revision\:\ //)
+
+# The working path is needed for editing the MacGui .plist
+FULL_PATH = $(shell pwd)
+BUILD_DATE = $(shell date "+%Y%m%d")
+
HB_DEFPPC = $(shell uname -a | grep ppc > /dev/null ; echo RES$$?)
ifeq ($(HB_DEFPPC), RES0)
HB_DEFPPC = "-DWORDS_BIGENDIAN"
else
HB_DEFPPC =
endif
-
Index: Jamrules
===================================================================
--- Jamrules (revision 1342)
+++ Jamrules (working copy)
@@ -11,13 +11,30 @@
Exit "Please run ./configure first." ;
}
+# This line needs to be manually bumped for each release.
HB_VERSION = 0.9.2 ;
-HB_BUILD = 2008021900 ;
+
+# If the user configured with the --snapshot argument,
+# generate version and build numbers that include
+# the svn revision and are marked as unstable.
+if $(SNAPSHOT) = 1
+{
+HB_VERSION = "$(HB_VERSION)svn$(SVN_REV)" ;
+HB_BUILD = "$(BUILD_DATE)01" ;
+}
+else
+{
+HB_BUILD = "$(BUILD_DATE)00" ;
+}
+
DEFINES += HB_VERSION=\\\"$(HB_VERSION)\\\" HB_BUILD=$(HB_BUILD) ;
LANGUAGES = fr de it pl ru nl es pt ja ;
RM = rm -rf ;
-# Build HandBrake.app using Xcode
+# Build HandBrake.app using Xcode --
+# Getting the right version and build numbers
+# requires editing the .plist and specifying
+# extra CFLAGs.
rule OSXApp
{
Depends exe : $(<) ;
@@ -27,7 +44,12 @@
actions OSXApp
{
$(RM) $(<) macosx/build/HandBrake.app && \
- ( cd macosx && xcodebuild -target libhb -target HandBrake -target HandBrakeCLI ) && \
+ ( cd macosx && \
+ defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleGetInfoString '"$(HB_VERSION)"' &&\
+ defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleShortVersionString '"$(HB_VERSION)"' &&\
+ defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleVersion '"$(HB_BUILD)"' &&\
+ plutil -convert xml1 "$(FULL_PATH)"/macosx/HandBrake.plist &&\
+ xcodebuild OTHER_CFLAGS_QUOTED_1="-g -HB_BUILD="$(HB_BUILD)" -HB_VERSION=\\\"$(HB_VERSION)\\\" -DHB_BUILD="$(HB_BUILD)" -DHB_VERSION=\\\"$(HB_VERSION)\\\" -CURRENT_PROJECT_VERSION=\\\"$(HB_VERSION)\\\" " -target libhb -target HandBrake -target HandBrakeCLI ) && \
for i in $(LANGUAGES) ; do \
( cd $(<)/Contents/Resources && \
cp -r English.lproj $i.lproj && \
Index: macosx/HandBrake.plist
===================================================================
--- macosx/HandBrake.plist (revision 1342)
+++ macosx/HandBrake.plist (working copy)
@@ -9,7 +9,7 @@
CFBundleExecutable
HandBrake
CFBundleGetInfoString
- 0.9.2
+ 0.9.2svn1341
CFBundleIconFile
HandBrake
CFBundleIdentifier
@@ -21,11 +21,11 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 0.9.2
+ 0.9.2svn1341
CFBundleSignature
HB##
CFBundleVersion
- 2008021900
+ 2008031601
NSHumanReadableCopyright
HandBrake Devs
NSMainNibFile
Index: Makefile
===================================================================
--- Makefile (revision 1342)
+++ Makefile (working copy)
@@ -11,6 +11,8 @@
all: clean app
+snapshot: clean snapshot-app
+
all-chunky: clean app-chunky
test: clean cli
@@ -20,6 +22,9 @@
app:
(./DownloadMacOsXContribBinaries.sh ; cd macosx ; xcodebuild -target libhb -target HandBrake -target HandBrakeCLI -configuration UB OTHER_CFLAGS_QUOTED_1="-DHB_VERSION=\\\"$(HB_VERSION)\\\" -DHB_BUILD=$(HB_BUILD) " build | sed '/^$$/d' )
+snapshot-app:
+ (./DownloadMacOsXContribBinaries.sh ; cd macosx ; defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleGetInfoString '$(SNAP_HB_VERSION)' ; defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleShortVersionString '$(SNAP_HB_VERSION)' ; defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleVersion '"$(SNAP_HB_BUILD)"' ; plutil -convert xml1 "$(FULL_PATH)"/macosx/HandBrake.plist ; xcodebuild -target libhb -target HandBrake -target HandBrakeCLI -configuration UB OTHER_CFLAGS_QUOTED_1="-g -HB_BUILD="$(SNAP_HB_BUILD)" -HB_VERSION=\\\"$(SNAP_HB_VERSION)\\\" -DHB_BUILD="$(SNAP_HB_BUILD)" -DHB_VERSION=\\\"$(SNAP_HB_VERSION)\\\" -CURRENT_PROJECT_VERSION=\\\"$(SNAP_HB_VERSION)\\\" " build | sed '/^$$/d' )
+
app-chunky:
(./DownloadMacOsXContribBinaries.sh ; cd macosx ; xcodebuild -alltargets -configuration UB OTHER_CFLAGS_QUOTED_1="-DHB_VERSION=\\\"$(HB_VERSION)\\\" -DHB_BUILD=$(HB_BUILD) " build | sed '/^$$/d' )
@@ -41,6 +46,12 @@
cli-release:
(rm -rf HandBrake HandBrake*CLI_UB.dmg ; mkdir -p HandBrake/docs ; cp test/BUILDSHARED AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/docs ; cp -rp HandBrakeCLI HandBrake ; hdiutil create -srcfolder HandBrake -format UDZO HandBrake-$(HB_VERSION)-MacOSX.3_CLI_UB.dmg ; rm -rf HandBrake )
+gui-snapshot-release:
+ (rm -rf HandBrake HandBrake*GUI_UB.dmg ; mkdir -p HandBrake/docs ; cp AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/docs ; cp -rp HandBrake.app HandBrake ; hdiutil create -srcfolder HandBrake -format UDBZ HandBrake-$(SNAP_HB_VERSION)-MacOSX.5_GUI_UB.dmg ; rm -rf HandBrake )
+
+cli-snapshot-release:
+ (rm -rf HandBrake HandBrake*CLI_UB.dmg ; mkdir -p HandBrake/docs ; cp test/BUILDSHARED AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/docs ; cp -rp HandBrakeCLI HandBrake ; hdiutil create -srcfolder HandBrake -format UDZO HandBrake-$(SNAP_HB_VERSION)-MacOSX.5_CLI_UB.dmg ; rm -rf HandBrake )
+
endif
#