The Release Makefile now creates a third product: a tarball of the dSYM bundles. This will make it easy for anyone to download the dSYM bundles for a past release, enabling them to symbolicate crash logs.
1 ##########################
3 ### * Set VERSION and BETA below. BETA should be TRUE or FALSE.
4 ### * Update the version struct in Core/Source/GrowlApplicationController.m
5 ### (needed for proper version checking)
6 ### * Update the version string in Extras/growlnotify/main.m
12 #########################
14 # No changes should be needed below this line
16 #########################
17 RELEASE_FILENAME=Growl-$(VERSION)
18 RELEASE_NAME="Growl-$(VERSION)"
19 RELEASE_SDK_NAME="Growl $(VERSION) SDK"
23 GROWL_DIR=$(BUILD_DIR)/Growl
24 SDK_DIR=$(BUILD_DIR)/SDK
26 BUILDFLAGS="BUILDCONFIGURATION=$(BUILDSTYLE)"
27 PRODUCT_DIR=$(shell defaults read com.apple.Xcode PBXApplicationwideBuildSettings 2> /dev/null | cat > XcodeBuildSettings.plist && defaults read $PWD/XcodeBuildSettings SYMROOT 2> /dev/null)
28 ifeq ($(strip $(PRODUCT_DIR)),)
29 GROWL_BUILD_DIR=$(SRC_DIR)/build/$(BUILDSTYLE)
30 GROWLNOTIFY_BUILD_DIR=$(SRC_DIR)/Extras/growlnotify/build/$(BUILDSTYLE)
31 GROWLTUNES_BUILD_DIR=$(SRC_DIR)/Extras/GrowlTunes/build/$(BUILDSTYLE)
32 HARDWAREGROWLER_BUILD_DIR=$(SRC_DIR)/Extras/HardwareGrowler/build/$(BUILDSTYLE)
33 GROWLMAIL_BUILD_DIR=$(SRC_DIR)/Extras/GrowlMail/build/$(BUILDSTYLE)
34 GROWLSAFARI_BUILD_DIR=$(SRC_DIR)/Extras/GrowlSafari/build/$(BUILDSTYLE)
36 TARGET_BUILD_DIR=$(PRODUCT_DIR)/$(BUILDSTYLE)
37 GROWL_BUILD_DIR=$(TARGET_BUILD_DIR)
38 GROWLNOTIFY_BUILD_DIR=$(TARGET_BUILD_DIR)
39 GROWLTUNES_BUILD_DIR=$(TARGET_BUILD_DIR)
40 HARDWAREGROWLER_BUILD_DIR=$(TARGET_BUILD_DIR)
41 GROWLMAIL_BUILD_DIR=$(TARGET_BUILD_DIR)
42 GROWLSAFARI_BUILD_DIR=$(TARGET_BUILD_DIR)
44 DSYM_DIR=$(BUILD_DIR)/Growl-dSYM-$(VERSION)
45 PACKAGE_MAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
48 #########################
50 .PHONY: all assertnochanges assertnoconflicts compile clean release source version
52 all: assertnochanges version compile release
53 all-withlocalchanges: assertnoconflicts version compile release
56 if [[ 0 -ne `hg st | wc -l` ]]; then \
57 echo 'You have local changes. Please do not build releases from an unclean working copy. You must revert the changes, commit them, or clone your repository and build from that.' 1>&2; \
61 if [[ 0 -ne `hg resolve --list | grep -E '^U' | wc -l` ]]; then \
62 echo 'You have conflicts in your working copy. You will not be able to build until these are resolved. Also, remember that even after you have fixed all conflict marks, you must use "hg resolve" to re-try your last update or merge; otherwise, hg will still believe the files are conflicted.' 1>&2; \
67 @# update the CFBundleVersion
68 defaults write $(SRC_DIR)/Core/Resources/GrowlHelperApp-Info CFBundleVersion '$(VERSION)'
69 defaults write $(SRC_DIR)/Framework/Resources/Growl-WithInstaller.framework-Info CFBundleVersion '$(VERSION)'
70 defaults write $(SRC_DIR)/Framework/Resources/Growl.framework-Info CFBundleVersion '$(VERSION)'
71 defaults write $(SRC_DIR)/Core/Resources/Info CFBundleVersion '$(VERSION)'
72 defaults write $(SRC_DIR)/Extras/GrowlCode/Info CFBundleVersion '$(VERSION)'
73 defaults write $(SRC_DIR)/Extras/GrowlMail/Info CFBundleVersion '$(VERSION)'
74 defaults write $(SRC_DIR)/Extras/GrowlSafari/Info CFBundleVersion '$(VERSION)'
75 defaults write $(SRC_DIR)/Extras/GrowlTunes/Info CFBundleVersion '$(VERSION)'
76 defaults write $(SRC_DIR)/Extras/HardwareGrowler/Info CFBundleVersion '$(VERSION)'
77 defaults write $(SRC_DIR)/StatusItem/Resources/MenuExtra-Info CFBundleVersion '$(VERSION)'
79 @# update the CFBundleShortVersionString
80 defaults write $(SRC_DIR)/Core/Resources/GrowlHelperApp-Info CFBundleShortVersionString '$(VERSION)'
81 defaults write $(SRC_DIR)/Framework/Resources/Growl-WithInstaller.framework-Info CFBundleShortVersionString '$(VERSION)'
82 defaults write $(SRC_DIR)/Framework/Resources/Growl.framework-Info CFBundleShortVersionString '$(VERSION)'
83 defaults write $(SRC_DIR)/Core/Resources/Info CFBundleShortVersionString '$(VERSION)'
84 defaults write $(SRC_DIR)/Extras/GrowlCode/Info CFBundleShortVersionString '$(VERSION)'
85 defaults write $(SRC_DIR)/Extras/GrowlMail/Info CFBundleShortVersionString '$(VERSION)'
86 defaults write $(SRC_DIR)/Extras/GrowlSafari/Info CFBundleShortVersionString '$(VERSION)'
87 defaults write $(SRC_DIR)/Extras/GrowlTunes/Info CFBundleShortVersionString '$(VERSION)'
88 defaults write $(SRC_DIR)/Extras/HardwareGrowler/Info CFBundleShortVersionString '$(VERSION)'
89 defaults write $(SRC_DIR)/StatusItem/Resources/MenuExtra-Info CFBundleShortVersionString '$(VERSION)'
91 @# Convert back to XML plist, since defaults creates binary plists
92 plutil -convert xml1 $(SRC_DIR)/Core/Resources/GrowlHelperApp-Info.plist
93 plutil -convert xml1 $(SRC_DIR)/Framework/Resources/Growl-WithInstaller.framework-Info.plist
94 plutil -convert xml1 $(SRC_DIR)/Framework/Resources/Growl.framework-Info.plist
95 plutil -convert xml1 $(SRC_DIR)/Core/Resources/Info.plist
96 plutil -convert xml1 $(SRC_DIR)/Extras/GrowlCode/Info.plist
97 plutil -convert xml1 $(SRC_DIR)/Extras/GrowlMail/Info.plist
98 plutil -convert xml1 $(SRC_DIR)/Extras/GrowlSafari/Info.plist
99 plutil -convert xml1 $(SRC_DIR)/Extras/GrowlTunes/Info.plist
100 plutil -convert xml1 $(SRC_DIR)/Extras/HardwareGrowler/Info.plist
101 plutil -convert xml1 $(SRC_DIR)/StatusItem/Resources/MenuExtra-Info.plist
104 $(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)
105 $(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)/Extras/GrowlMail
106 $(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)/Extras/GrowlSafari
107 $(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)/Extras/growlnotify
108 $(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)/Extras/HardwareGrowler
109 $(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)/Extras/GrowlTunes
118 @# clean build directory
123 @# Archive dSYM bundles.
125 mv $(GROWL_BUILD_DIR)/*.dSYM $(DSYM_DIR)
126 mv $(GROWLNOTIFY_BUILD_DIR)/*.dSYM $(DSYM_DIR)
127 mv $(GROWLTUNES_BUILD_DIR)/*.dSYM $(DSYM_DIR)
128 mv $(HARDWAREGROWLER_BUILD_DIR)/*.dSYM $(DSYM_DIR)
129 mv $(GROWLMAIL_BUILD_DIR)/*.dSYM $(DSYM_DIR)
130 mv $(GROWLSAFARI_BUILD_DIR)/*.dSYM $(DSYM_DIR)
131 @# Note: -C only applies to the input names, not -f, so it is correct to use notdir on the directory name and leave it off of the tarball name.
132 tar -C $(dir $(DSYM_DIR)) -cjf $(DSYM_DIR).tbz $(notdir $(DSYM_DIR))
135 cp -R "Uninstall Growl.app" $(GROWL_DIR)
136 /Developer/Tools/SetFile -a E $(GROWL_DIR)/Uninstall\ Growl.app
139 cp "Growl Documentation.webloc" "Growl version history.webloc" "Get more styles.webloc" $(GROWL_DIR)
141 @# hide extensions of webloc files
142 /Developer/Tools/SetFile -a E $(GROWL_DIR)/*.webloc
144 @# build the prefpane package
145 $(PACKAGE_MAKER) --doc Growl/Growl\ Installer.pmdoc --out $(GROWL_DIR)/Growl.mpkg --version $(VERSION) --id com.growl.growl.mpkg -v
148 mkdir $(GROWL_DIR)/Extras
149 mkdir $(GROWL_DIR)/Extras/growlnotify
150 cp $(GROWLNOTIFY_BUILD_DIR)/growlnotify $(GROWL_DIR)/Extras/growlnotify
151 cp $(SRC_DIR)/Extras/growlnotify/growlnotify.1 $(GROWL_DIR)/Extras/growlnotify
152 cp $(SRC_DIR)/Extras/growlnotify/install.sh $(GROWL_DIR)/Extras/growlnotify
153 cp $(SRC_DIR)/Extras/growlnotify/*.txt $(GROWL_DIR)/Extras/growlnotify
154 mkdir $(GROWL_DIR)/Extras/GrowlTunes
155 cp -R $(GROWLTUNES_BUILD_DIR)/GrowlTunes.app $(GROWL_DIR)/Extras/GrowlTunes
156 cp -R $(SRC_DIR)/Extras/GrowlTunes/*.rtfd $(GROWL_DIR)/Extras/GrowlTunes
157 mkdir $(GROWL_DIR)/Extras/HardwareGrowler
158 cp -R $(HARDWAREGROWLER_BUILD_DIR)/HardwareGrowler.app $(GROWL_DIR)/Extras/HardwareGrowler
159 cp $(SRC_DIR)/Extras/HardwareGrowler/*.txt $(GROWL_DIR)/Extras/HardwareGrowler
161 @# build GrowlMail package
162 mkdir $(GROWL_DIR)/Extras/GrowlMail
163 $(PACKAGE_MAKER) --doc GrowlMail/GrowlMail\ Installer.pmdoc --out $(GROWL_DIR)/Extras/GrowlMail/GrowlMail.mpkg --version $(VERSION) --id com.growl.growlmail.mpkg -v
164 cp $(SRC_DIR)/Extras/GrowlMail/*.rtf $(GROWL_DIR)/Extras/GrowlMail
166 @# build GrowlSafari package
167 mkdir $(GROWL_DIR)/Extras/GrowlSafari
168 @# Set its ownership to root:admin and permissions to rwxr-xr-x so that Mac OS X 10.5.3 will load it.
169 chmod -R go-w $(GROWLSAFARI_BUILD_DIR)/GrowlSafari
171 @echo '*** IMPORTANT: If you want to build Growl as a regular (non-admin) user, hit CTRL-D here without entering a password. (Ctrl-C will stop the build.) Note that the GrowlSafari on the disk image will not be usable on Leopard and later if you do this.'
172 -(sudo chown -R root:admin $(GROWLSAFARI_BUILD_DIR)/GrowlSafari) || echo "WARNING: GrowlSafari will not work on Leopard and later from this disk image" > /dev/stderr
173 $(PACKAGE_MAKER) --doc GrowlSafari/GrowlSafari\ Installer.pmdoc --out $(GROWL_DIR)/Extras/GrowlSafari/GrowlSafari.pkg --version $(VERSION) --id com.growl.growlsafari.pkg -v
174 @# PackageMaker fails at obeying the permissions that we've set forth in the document. Specifically, it sets g+w on everything, in both the BOM and the archive, in direct contravention of what the document says (go-w).
175 @# Our workaround, then, is to create the BOM and archive ourselves, replacing the full-of-fail ones that PackageMaker creates.
176 mkbom $(GROWLSAFARI_BUILD_DIR)/GrowlSafari $(GROWL_DIR)/Extras/GrowlSafari/GrowlSafari.pkg/Contents/Archive.bom
177 (cd $(GROWLSAFARI_BUILD_DIR)/GrowlSafari && pax -w -x cpio -z .) > $(GROWL_DIR)/Extras/GrowlSafari/GrowlSafari.pkg/Contents/Archive.pax.gz
182 @# copy the webloc files
183 cp "Growl Developer Documentation.webloc" "Growl version history for developers.webloc" $(SDK_DIR)
185 @# hide extensions of webloc files
186 /Developer/Tools/SetFile -a E $(SDK_DIR)/*.webloc
189 #cp -R $(SRC_DIR)/Scripts $(GROWL_DIR)
191 @# copy over relevant files to compile directly into app
192 mkdir $(SDK_DIR)/Built-In
193 cp $(SRC_DIR)/Framework/Source/GrowlApplicationBridge.h $(SDK_DIR)/Built-In
194 cp $(SRC_DIR)/Framework/Source/GrowlApplicationBridge.m $(SDK_DIR)/Built-In
195 cp $(SRC_DIR)/Common/Source/GrowlDefines.h $(SDK_DIR)/Built-In
196 cp $(SRC_DIR)/Common/Source/GrowlDefinesInternal.h $(SDK_DIR)/Built-In
197 cp $(SRC_DIR)/Common/Source/GrowlPathUtilities.h $(SDK_DIR)/Built-In
198 cp $(SRC_DIR)/Common/Source/GrowlPathUtilities.m $(SDK_DIR)/Built-In
199 cp $(SRC_DIR)/Common/Source/CFGrowlAdditions.h $(SDK_DIR)/Built-In
200 cp $(SRC_DIR)/Common/Source/CFGrowlAdditions.c $(SDK_DIR)/Built-In
201 cp $(SRC_DIR)/Common/Source/CFGrowlDefines.h $(SDK_DIR)/Built-In
202 cp $(SRC_DIR)/Common/Source/CFURLAdditions.h $(SDK_DIR)/Built-In
203 cp $(SRC_DIR)/Common/Source/CFURLAdditions.c $(SDK_DIR)/Built-In
204 cp $(SRC_DIR)/Common/Source/CFMutableDictionaryAdditions.h $(SDK_DIR)/Built-In
205 cp $(SRC_DIR)/Common/Source/CFMutableDictionaryAdditions.c $(SDK_DIR)/Built-In
206 cp $(SRC_DIR)/Core/Source/GrowlPreferencesController.h $(SDK_DIR)/Built-In
207 cp $(SRC_DIR)/Core/Source/GrowlTicketController.h $(SDK_DIR)/Built-In
209 @# copy the frameworks
210 mkdir $(SDK_DIR)/Frameworks
211 cp -R $(GROWL_BUILD_DIR)/Growl.framework $(GROWL_BUILD_DIR)/Growl-WithInstaller.framework $(SDK_DIR)/Frameworks
214 cp -R $(SRC_DIR)/Bindings $(SDK_DIR)
215 @# remove the AppleScript binding
216 rm -rf $(SDK_DIR)/Bindings/applescript
218 @# remove some symlinks
219 rm $(SDK_DIR)/Bindings/tcl/GrowlDefines.h
220 rm $(SDK_DIR)/Bindings/tcl/GrowlApplicationBridge.h
221 rm $(SDK_DIR)/Bindings/tcl/GrowlApplicationBridge.m
223 @# delete svn and backup files
224 find $(BUILD_DIR) -name ".svn" -type d -exec rm -rf {} \; -prune
225 find $(BUILD_DIR) \( -name "*~" -or -name .DS_Store \) -type f -delete
227 @# make Growl disk image
228 mkdir $(GROWL_DIR)/.background
229 cp $(SRC_DIR)/images/dmg/growlDMGBackground.png $(GROWL_DIR)/.background
230 ./ensureCustomIconsExtracted $(ART_DIR)
231 ./make-diskimage.sh $(BUILD_DIR)/$(RELEASE_FILENAME).dmg $(GROWL_DIR) $(RELEASE_NAME) dmg_growl.applescript $(ART_DIR)
233 @# make SDK disk image
234 mkdir $(SDK_DIR)/.background
235 cp $(SRC_DIR)/images/dmg/growlSDK.png $(SDK_DIR)/.background
236 ./make-diskimage.sh $(BUILD_DIR)/$(RELEASE_FILENAME)-SDK.dmg $(SDK_DIR) $(RELEASE_SDK_NAME) dmg_sdk.applescript
239 -growlnotify -n 'Growl Release Makefile' 'Growl disk image built successfully' -m $(RELEASE_FILENAME).dmg --iconpath $(BUILD_DIR)/$(RELEASE_FILENAME).dmg