William Bowling is sharing code with you
Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.
Don't show this again1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | ###########
# What to do before running this script:
# - openUp needs to be installed.
# - Set VERSION, BUILD_IN_DEBUG_MODE, BETA, and OFFICIAL_BUILD below.
# * The Adium plists will automatically updated to match these values.
# * BETA should be TRUE for all beta builds and FALSE for all releases.
# It primarily affects the appcast used by Adium for detecting updates.
# * BUILD_IN_DEBUG_MODE should be set to FALSE for the last beta
# in addition to the release itself. If FALSE, debug logging is disabled
# and certain space optimizations for nibs and strings are done which
# also prevent modification.
# * OFFICIAL_BUILD is TRUE for the benefit of our Adium build machine, which signs
# official release builds. When building a release yourself, set this to FALSE,
# since you don't have the Adium certificate on your machine.
#
# How to run this script:
# - make all
###########
VERSION=1.5hg
BUILD_IN_DEBUG_MODE?=TRUE
BETA?=TRUE
OFFICIAL_BUILD?=TRUE
# Always builds in debug mode.
NIGHTLY?=FALSE
###########
# To release!
# Releasing requires cachefly access and adiumx.com access.
#
# First upload to cachefly. If you don't have access and need to do a release, get with Evan or Chris (tick).
# Triggering the version checker once the release is up:
# 1) Build Adium
# 2) Get the number out of the 'buildnum' file in Adium.app/Contents/Resources
# 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 ***
# 4) Update and commit the appcast.xml file in the adium checkout root
# 5) Run the appcast update php script.
###########
###########
# No need for changes below this point
###########
###########
# Variables
###########
SRC_DIR=..
BUILD_DIR=build
ART_DIR=Artwork
ADIUM_DIR=$(BUILD_DIR)/Adium
RELEASE_NAME=Adium_$(VERSION)
VERSION_ESCAPED=$(VERSION)
RELEASE_NAME_ESCAPED=Adium_$(VERSION_ESCAPED)
TARBALL_DIR=adium-$(VERSION)
REVISION = r$(shell hg parent --template {rev})
ifeq ($(NIGHTLY),TRUE)
BETA=FALSE
ADIUM_DIR:=$(ADIUM_DIR)\ $(REVISION)
VERSION_ESCAPED:=$(VERSION_ESCAPED)\ $(REVISION)
VERSION:=$(VERSION)$(REVISION)
BUILD_IN_DEBUG_MODE=TRUE
BUILDFLAGS+="ADIUM_CFLAGS=-DNIGHTLY_RELEASE"
endif
ifeq ($(BUILD_IN_DEBUG_MODE),TRUE)
BUILDSTYLE=Release-Debug
else
BUILDSTYLE=Release
endif
BUILDFLAGS+="BUILDCONFIGURATION=$(BUILDSTYLE)"
ifeq ($(BETA),TRUE)
BUILDFLAGS+="ADIUM_CFLAGS=-DBETA_RELEASE"
endif
PRODUCT_DIR=$(shell defaults read com.apple.Xcode PBXApplicationwideBuildSettings 2> /dev/null > XcodeBuildSettings.plist && defaults read $PWD/XcodeBuildSettings SYMROOT 2> /dev/null; rm XcodeBuildSettings.plist)
ifeq ($(strip $(PRODUCT_DIR)),)
ADIUM_BUILD_DIR=$(SRC_DIR)/build/$(BUILDSTYLE)
else
TARGET_BUILD_DIR=$(PRODUCT_DIR)/$(BUILDSTYLE)
ADIUM_BUILD_DIR=$(TARGET_BUILD_DIR)
endif
PLIST_DIR=`pwd`/../Plists
ADIUM_PLIST=$(PLIST_DIR)/Info
###########
# Targets
###########
.PHONY: all all-withlocalchanges all-withlocalchanges-noclean all-nopackage-noclean all-nightly update assertnochanges assertnoconflicts version compile clean release source prepare-release-bundle createfolder diskimage nightly tarball
all: update assertnochanges version clean compile release
all-withlocalchanges: update assertnoconflicts version clean compile release
all-withlocalchanges-noclean: update assertnoconflicts version compile release
#doesn't bother putting things in a dmg
#useful for builds not intended for distribution
all-nopackage-noclean: update assertnoconflicts version compile createfolder prepare-release-bundle
update:
hg pull -uf
assertnochanges: assertnoconflicts
if [[ 0 -ne `hg st $(SRC_DIR) | egrep --invert-match '\?|Info\.plist' | wc -l` ]]; then \
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; \
exit 1; \
fi
assertnoconflicts:
if [[ 0 -ne `hg st $(SRC_DIR) | egrep '^C' | wc -l` ]]; then \
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 "hg resolve"; otherwise, hg will still believe the files are conflicted.' 1>&2; \
exit 2; \
fi
version:
@# update the plists
defaults write $(ADIUM_PLIST) CFBundleGetInfoString "$(VERSION), Copyright 2001-2009 The Adium Team"
defaults write $(ADIUM_PLIST) CFBundleVersion "$(VERSION)"
defaults write $(ADIUM_PLIST) CFBundleShortVersionString "$(VERSION)"
plutil -convert xml1 $(ADIUM_PLIST).plist
compile:
$(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)
testcompile:
$(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)
clean:
rm -rf $(BUILD_DIR)
$(MAKE) $(BUILDFLAGS) -C $(SRC_DIR) clean
release: createfolder prepare-release-bundle diskimage
prepare-release-bundle:
@# Convert all nibs to the smaller binary format
@echo Converting nibs to binary format...
find $(BUILD_DIR) -name keyedobjects.nib -print0 | xargs -0 plutil -convert binary1
@# delete unneeded nib files for non-beta builds
@echo Cleaning Adium.app for release
ifeq ($(BUILD_IN_DEBUG_MODE),FALSE)
find $(BUILD_DIR) \( -name classes.nib -or -name info.nib \) -type f -delete
endif
@# delete backup files
find $(BUILD_DIR) \( -name "*~" -or -name .DS_Store \) -type f -delete
@# delete header files
find $(BUILD_DIR) \( -name "*.h" \) -type f -delete
@# sign the executable
ifeq ($(OFFICIAL_BUILD),TRUE)
if [ -e ~/adium-password ]; then \
security unlock-keychain -p `cat ~/adium-password`; \
fi
codesign -v -s Adium $(ADIUM_DIR)/Adium.app/Contents/MacOS/Adium
endif
createfolder:
@# clean build directory
rm -rf $(BUILD_DIR)
mkdir $(BUILD_DIR)
mkdir $(ADIUM_DIR)
@# copy the app
cp -R "$(ADIUM_BUILD_DIR)/Adium.app" $(ADIUM_DIR)
@# copy the text files
cp $(SRC_DIR)/ChangeLogs/Changes.txt $(ADIUM_DIR)
cp $(SRC_DIR)/License.txt $(ADIUM_DIR)
@# symlink /Applications
./mkalias -r /Applications $(ADIUM_DIR)/Applications
diskimage:
rm "$(BUILD_DIR)/$(RELEASE_NAME).dmg" || true
@# make Adium disk image
mkdir -p $(ADIUM_DIR)/.background
cp $(ART_DIR)/dmgBackground.png $(ADIUM_DIR)/.background
./ensureCustomIconsExtracted $(ART_DIR)
./make-diskimage.sh $(BUILD_DIR)/$(RELEASE_NAME).dmg $(ADIUM_DIR) "Adium $(VERSION)" dmg_adium.scpt $(ART_DIR)
ifeq ($(OFFICIAL_BUILD),TRUE)
@echo DSA for Sparkle: `ruby sign_update.rb $(BUILD_DIR)/$(RELEASE_NAME_ESCAPED).dmg ~/adium-dsa-sign/dsa_priv.pem`
endif
@echo Build finished. `md5 $(BUILD_DIR)/$(RELEASE_NAME_ESCAPED).dmg`
#This is what nightly builds use. Does not update because buildbot does.
nightly: version clean compile createfolder prepare-release-bundle diskimage
echo $(RELEASE_NAME) > $(BUILD_DIR)/latest.info
echo $(REVISION) >> $(BUILD_DIR)/latest.info
md5 -q $(BUILD_DIR)/$(RELEASE_NAME).dmg >> $(BUILD_DIR)/latest.info
md5 -q $(BUILD_DIR)/$(RELEASE_NAME).dmg >> $(BUILD_DIR)/$(RELEASE_NAME).dmg.md5
ls -l $(BUILD_DIR)/$(RELEASE_NAME).dmg | awk '{print $$5}' >>$(BUILD_DIR)/latest.info
echo $(VERSION) >> $(BUILD_DIR)/latest.info
ifeq ($(OFFICIAL_BUILD),TRUE)
ruby sign_update.rb $(BUILD_DIR)/$(RELEASE_NAME).dmg ~/adium-dsa-sign/dsa_priv.pem >> $(BUILD_DIR)/latest.info
endif
tarballapp:
rm $(BUILD_DIR)/$(RELEASE_NAME).tgz || true
cd $(BUILD_DIR) && tar zcf $(RELEASE_NAME).tgz Adium*/ && cd ..
tarball:
hg archive -t tgz ($TARBALL_DIR).tgz
|