Enable/disable the okay button based on the presence of text in the To: field for...
[adiumx.git] / Release / Makefile
bloba0c71c112eaed523b85dd3e99e06d655a14eb615
1 ###########
2 # What to do before running this script:
3 # - openUp needs to be installed.
4 # - Set VERSION, BUILD_IN_DEBUG_MODE, and BETA below.
5 # * The Adium plists will automatically updated to match these values.
6 # * BETA should be TRUE for all beta builds and FALSE for all releases.
7 # It primarily affects the appcast used by Adium for detecting updates.
8 # * BUILD_IN_DEBUG_MODE should be set to FALSE for the last beta
9 # in addition to the release itself. If FALSE, debug logging is disabled
10 # and certain space optimizations for nibs and strings are done which
11 # also prevent modification.
13 # How to run this script:
14 # - make all
15 ###########
17 VERSION=1.2b7
18 BUILD_IN_DEBUG_MODE=TRUE
19 BETA=TRUE
21 ###########
22 # To release!
23 # Releasing requires cachefly access and adiumx.com access.
25 # First upload to cachefly. If you don't have access and need to do a release, get with Evan or Chris (tick).
26 # Triggering the version checker once the release is up:
27 # 1) Build Adium
28 # 2) Get the number out of the 'buildnum' file in Adium.app/Contents/Resources
29 # 3) Paste that number into the appropriate place (adium version or adium-beta version, depending on which you're triggering) in the version.plist file in our public_html folder. *** (2) and (3) are to support the old version checker, in Adium 0.8x and earlier ***
30 # 4) Update and commit the appcast.xml file in the adium checkout root
31 # 5) Run the appcast update php script.
32 ###########
34 ###########
35 # No need for changes below this point
36 ###########
38 ###########
39 # Variables
40 ###########
41 SRC_DIR=..
42 BUILD_DIR=build
43 ART_DIR=Artwork
44 ADIUM_DIR=$(BUILD_DIR)/Adium
45 RELEASE_NAME=Adium_$(VERSION)
47 ifeq ($(BUILD_IN_DEBUG_MODE),TRUE)
48 BUILDSTYLE=Deployment-Debug
49 else
50 BUILDSTYLE=Deployment
51 endif
53 BUILDFLAGS="BUILDCONFIGURATION=$(BUILDSTYLE)"
54 ifeq ($(BETA),TRUE)
55 BUILDFLAGS+="ADIUM_CFLAGS=-DBETA_RELEASE"
56 endif
58 PRODUCT_DIR=$(shell defaults read com.apple.Xcode PBXProductDirectory 2> /dev/null)
60 ifeq ($(strip $(PRODUCT_DIR)),)
61 ADIUM_BUILD_DIR=$(SRC_DIR)/build/$(BUILDSTYLE)
62 else
63 TARGET_BUILD_DIR=$(PRODUCT_DIR)/$(BUILDSTYLE)
64 ADIUM_BUILD_DIR=$(TARGET_BUILD_DIR)
65 endif
67 PLIST_DIR=`pwd`/../Plists
68 ADIUM_PLIST=$(PLIST_DIR)/Adium_2
70 ###########
71 # Targets
72 ###########
73 .PHONY: all all-withlocalchanges all-withlocalchanges-noclean update assertnochanges assertnoconflicts version compile clean release source prepare-release-bundle createfolder diskimage
75 all: update assertnochanges version clean compile release
76 all-withlocalchanges: update assertnoconflicts version clean compile release
77 all-withlocalchanges-noclean: update assertnoconflicts version compile release
79 #doesn't bother putting things in a dmg
80 #useful for builds not intended for distribution
81 all-nopackage-noclean: update assertnoconflicts version compile createfolder
83 update:
84 svn update $(SRC_DIR)
86 assertnochanges:
87 if [[ 0 -ne `svn st $(SRC_DIR) | grep --invert-match \? | wc -l` ]]; then \
88 echo 'You have local changes. Please do not build releases from an unclean checkout. You must revert the changes, commit them, or check out another working copy and build from that.' 1>&2; \
89 exit 1; \
91 assertnoconflicts:
92 if [[ 0 -ne `svn st $(SRC_DIR) | egrep '^C' | wc -l` ]]; then \
93 echo 'You have conflicts in your checkout. 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 "svn resolved"; otherwise, svn will still believe the files are conflicted.' 1>&2; \
94 exit 2; \
97 version:
98 @# update the plists
99 defaults write $(ADIUM_PLIST) CFBundleGetInfoString '$(VERSION), Copyright 2001-2007 The Adium Team'
100 defaults write $(ADIUM_PLIST) CFBundleVersion '$(VERSION)'
101 defaults write $(ADIUM_PLIST) CFBundleShortVersionString '$(VERSION)'
102 plutil -convert xml1 $(ADIUM_PLIST).plist
104 compile:
105 $(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)
107 testcompile:
108 $(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)
110 clean:
111 rm -rf $(BUILD_DIR)
112 $(MAKE) $(BUILDFLAGS) -C $(SRC_DIR) clean
114 release: createfolder prepare-release-bundle diskimage
116 prepare-release-bundle:
117 @# Convert all nibs to the smaller binary format
118 @echo Converting nibs to binary format...
119 find $(BUILD_DIR) -name keyedobjects.nib -print0 | xargs -0 plutil -convert binary1
121 @# delete unneeded nib files for non-beta builds
122 @echo Cleaning Adium.app for release
123 ifeq ($(BUILD_IN_DEBUG_MODE),FALSE)
124 find $(BUILD_DIR) \( -name classes.nib -or -name info.nib \) -type f -delete
125 endif
127 @# delete svn and backup files
128 find $(BUILD_DIR) -name ".svn" -type d -exec rm -rf {} \; -prune
129 find $(BUILD_DIR) \( -name "*~" -or -name .DS_Store \) -type f -delete
132 createfolder:
133 @# clean build directory
134 rm -rf $(BUILD_DIR)
135 mkdir $(BUILD_DIR)
137 mkdir $(ADIUM_DIR)
139 @# copy the app
140 cp -R $(ADIUM_BUILD_DIR)/Adium.app $(ADIUM_DIR)
142 @# copy the text files
143 cp $(SRC_DIR)/ChangeLogs/Changes.txt $(ADIUM_DIR)
144 cp $(SRC_DIR)/License.txt $(ADIUM_DIR)
146 @# symlink /Applications
147 ./mkalias -r /Applications $(ADIUM_DIR)/Applications
149 diskimage:
150 rm "$(BUILD_DIR)/$(RELEASE_NAME).dmg" || true
151 @# make Adium disk image
152 mkdir -p $(ADIUM_DIR)/.background
153 cp $(ART_DIR)/dmgBackground.png $(ADIUM_DIR)/.background
155 ./ensureCustomIconsExtracted $(ART_DIR)
156 ./make-diskimage.sh $(BUILD_DIR)/$(RELEASE_NAME).dmg $(ADIUM_DIR) "Adium X $(VERSION)" dmg_adium.scpt $(ART_DIR)
158 @echo Build finished. `md5 $(BUILD_DIR)/$(RELEASE_NAME).dmg`