Skip to content

Commit

Permalink
Add Xcode and Makefile targets to build a Sparkle release package.
Browse files Browse the repository at this point in the history
Use `make release` to build Sparkle and create a Sparkle-VERSION.zip,
ready for upload.
  • Loading branch information
jakepetroules committed Jun 30, 2014
1 parent 5d0fa33 commit 72d8e4e
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 29 deletions.
18 changes: 18 additions & 0 deletions Configurations/make-release-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -e

if [ "$ACTION" = "" ] ; then
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
rm -f "Sparkle-$CURRENT_PROJECT_VERSION.zip"

mkdir -p "$CONFIGURATION_BUILD_DIR/staging"
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging"
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging"

cd "$CONFIGURATION_BUILD_DIR/staging"
zip --symlinks -r "../Sparkle-$CURRENT_PROJECT_VERSION.zip" .
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
fi
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
.PHONY: all localizable-strings

builddir := $(shell mktemp -d "$(TMPDIR)/Sparkle.XXXXXX")

localizable-strings:
rm Sparkle/en.lproj/Sparkle.strings || TRUE
genstrings -o Sparkle/en.lproj -s SULocalizedString Sparkle/*.m Sparkle/*.h
iconv -f UTF-16 -t UTF-8 < Sparkle/en.lproj/Localizable.strings > Sparkle/en.lproj/Sparkle.strings
rm Sparkle/en.lproj/Localizable.strings

release:
xcodebuild -scheme Distribution -configuration Release -derivedDataPath "$(builddir)"
open -R "$(builddir)/Build/Products/Release/Sparkle-"*.zip
56 changes: 28 additions & 28 deletions Resources/SampleAppcast.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Your Great App's Changelog</title>
<link>http://you.com/app/appcast.xml</link>
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Your Great App's Changelog</title>
<link>http://you.com/app/appcast.xml</link>
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Version 2.0 (2 bugs fixed; 3 new features)</title>
<sparkle:releaseNotesLink>
http://you.com/app/2.0.html
</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink>
http://you.com/app/2.0.html
</sparkle:releaseNotesLink>
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
<enclosure url="http://you.com/app/Your Great App 2.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream" sparkle:dsaSignature="BAFJW4B6B1K1JyW30nbkBwainOzrN6EQuAh" />
<enclosure url="http://you.com/app/Your%20Great%20App%202.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream" sparkle:dsaSignature="BAFJW4B6B1K1JyW30nbkBwainOzrN6EQuAh" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
</item>
</item>

<item>
<item>
<title>Version 1.5 (8 bugs fixed; 2 new features)</title>
<sparkle:releaseNotesLink>
http://you.com/app/1.5.html
</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink>
http://you.com/app/1.5.html
</sparkle:releaseNotesLink>
<pubDate>Wed, 01 Jan 2006 12:20:11 +0000</pubDate>
<enclosure url="http://you.com/app/Your Great App 1.5.zip" sparkle:version="1.5" length="1472893" type="application/octet-stream" sparkle:dsaSignature="234818feCa1JyW30nbkBwainOzrN6EQuAh" />
<enclosure url="http://you.com/app/Your%20Great%20App%201.5.zip" sparkle:version="1.5" length="1472893" type="application/octet-stream" sparkle:dsaSignature="234818feCa1JyW30nbkBwainOzrN6EQuAh" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
</item>
</item>

<!-- Now here's an example of a version with a weird internal version number (like an SVN revision) but a human-readable external one. -->
<item>
<title>Version 1.4 (5 bugs fixed; 2 new features)</title>
<sparkle:releaseNotesLink>
http://you.com/app/1.4.html
</sparkle:releaseNotesLink>
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
<enclosure url="http://you.com/app/Your Great App 1.4.zip" sparkle:version="241" sparkle:shortVersionString="1.4" sparkle:dsaSignature="MC0CFBfeCa1JyW30nbkBwainOzrN6EQuAh=" length="1472349" type="application/octet-stream" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
<!-- Now here's an example of a version with a weird internal version number (like an SVN revision) but a human-readable external one. -->
<item>
<title>Version 1.4 (5 bugs fixed; 2 new features)</title>
<sparkle:releaseNotesLink>
http://you.com/app/1.4.html
</sparkle:releaseNotesLink>
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
<enclosure url="http://you.com/app/Your%20Great%20App%201.4.zip" sparkle:version="241" sparkle:shortVersionString="1.4" sparkle:dsaSignature="MC0CFBfeCa1JyW30nbkBwainOzrN6EQuAh=" length="1472349" type="application/octet-stream" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
</item>
</channel>
</channel>
</rss>
79 changes: 78 additions & 1 deletion Sparkle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,20 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
14732BCA1960F73500593899 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
remoteInfo = Sparkle;
};
14732BCE1960F73500593899 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5D06E8CF0FD68C7C005AE3F6;
remoteInfo = BinaryDelta;
};
14950063195FB8A600BC5B5B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
Expand Down Expand Up @@ -250,9 +264,10 @@
14732BBC1960EFB500593899 /* README.markdown */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.markdown; sourceTree = SOURCE_ROOT; };
14732BBE1960F0A600593899 /* dsa_priv.pem */ = {isa = PBXFileReference; lastKnownFileType = text; path = dsa_priv.pem; sourceTree = "<group>"; };
14732BBF1960F0AC00593899 /* dsa_pub.pem */ = {isa = PBXFileReference; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = "<group>"; };
14732BC11960F3B200593899 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = SOURCE_ROOT; };
14732BC11960F3B200593899 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = SOURCE_ROOT; usesTabs = 1; };
14732BC31960F3FF00593899 /* generate_keys.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = generate_keys.sh; sourceTree = "<group>"; };
14732BC41960F3FF00593899 /* sign_update.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = sign_update.sh; sourceTree = "<group>"; };
14732BC91960F70A00593899 /* make-release-package.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "make-release-package.sh"; sourceTree = "<group>"; };
14950074195FDF5900BC5B5B /* SUUpdaterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUUpdaterTest.m; path = Tests/SUUpdaterTest.m; sourceTree = "<group>"; };
3772FEA813DE0B6B00F79537 /* SUVersionDisplayProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUVersionDisplayProtocol.h; sourceTree = "<group>"; };
4607BEA21948443800EF8DA4 /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/Sparkle.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -856,6 +871,7 @@
FA3AAF3B1050B273004B3130 /* ConfigUnitTest.xcconfig */,
FA3AAF3A1050B273004B3130 /* ConfigUnitTestDebug.xcconfig */,
FA3AAF391050B273004B3130 /* ConfigUnitTestRelease.xcconfig */,
14732BC91960F70A00593899 /* make-release-package.sh */,
);
path = Configurations;
sourceTree = "<group>";
Expand Down Expand Up @@ -911,6 +927,25 @@
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXLegacyTarget section */
14732BC51960F69300593899 /* Distribution */ = {
isa = PBXLegacyTarget;
buildArgumentsString = "$(SRCROOT)/Configurations/make-release-package.sh $(ACTION)";
buildConfigurationList = 14732BC61960F69300593899 /* Build configuration list for PBXLegacyTarget "Distribution" */;
buildPhases = (
);
buildToolPath = bash;
buildWorkingDirectory = "";
dependencies = (
14732BCB1960F73500593899 /* PBXTargetDependency */,
14732BCF1960F73500593899 /* PBXTargetDependency */,
);
name = Distribution;
passBuildSettingsInEnvironment = 1;
productName = Distribution;
};
/* End PBXLegacyTarget section */

/* Begin PBXNativeTarget section */
55C14BB6136EEF1500649790 /* Autoupdate */ = {
isa = PBXNativeTarget;
Expand Down Expand Up @@ -1017,6 +1052,11 @@
CLASSPREFIX = SU;
LastUpgradeCheck = 0510;
ORGANIZATIONNAME = "Sparkle Project";
TargetAttributes = {
612279D80DB5470200AB99EA = {
TestTargetID = 8DC2EF4F0486A6940098B216;
};
};
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Sparkle" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -1074,6 +1114,7 @@
612279D80DB5470200AB99EA /* Sparkle Unit Tests */,
5D06E8CF0FD68C7C005AE3F6 /* BinaryDelta */,
55C14BB6136EEF1500649790 /* Autoupdate */,
14732BC51960F69300593899 /* Distribution */,
1495005F195FB89400BC5B5B /* All */,
);
};
Expand Down Expand Up @@ -1296,6 +1337,16 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
14732BCB1960F73500593899 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8DC2EF4F0486A6940098B216 /* Sparkle */;
targetProxy = 14732BCA1960F73500593899 /* PBXContainerItemProxy */;
};
14732BCF1960F73500593899 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 5D06E8CF0FD68C7C005AE3F6 /* BinaryDelta */;
targetProxy = 14732BCE1960F73500593899 /* PBXContainerItemProxy */;
};
14950064195FB8A600BC5B5B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8DC2EF4F0486A6940098B216 /* Sparkle */;
Expand Down Expand Up @@ -1495,6 +1546,18 @@
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
14732BC71960F69300593899 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Debug;
};
14732BC81960F69300593899 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Release;
};
14950061195FB89500BC5B5B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -1527,6 +1590,7 @@
};
1DEB91B208733DA50010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = FA1941D00D94A70100DD942E /* ConfigCommon.xcconfig */;
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
Expand All @@ -1536,6 +1600,7 @@
};
1DEB91B308733DA50010E9CD /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = FA1941D00D94A70100DD942E /* ConfigCommon.xcconfig */;
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 10.7;
SDKROOT = macosx;
Expand Down Expand Up @@ -1602,8 +1667,10 @@
isa = XCBuildConfiguration;
baseConfigurationReference = FA3AAF3A1050B273004B3130 /* ConfigUnitTestDebug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Sparkle.framework/Versions/A/Sparkle";
COMBINE_HIDPI_IMAGES = YES;
SDKROOT = macosx;
TEST_HOST = "$(BUNDLE_LOADER)";
WARNING_CFLAGS = (
"-Wall",
"-Weverything",
Expand All @@ -1621,8 +1688,10 @@
isa = XCBuildConfiguration;
baseConfigurationReference = FA3AAF391050B273004B3130 /* ConfigUnitTestRelease.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Sparkle.framework/Versions/A/Sparkle";
COMBINE_HIDPI_IMAGES = YES;
SDKROOT = macosx;
TEST_HOST = "$(BUNDLE_LOADER)";
WARNING_CFLAGS = (
"-Wall",
"-Weverything",
Expand Down Expand Up @@ -1655,6 +1724,14 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
14732BC61960F69300593899 /* Build configuration list for PBXLegacyTarget "Distribution" */ = {
isa = XCConfigurationList;
buildConfigurations = (
14732BC71960F69300593899 /* Debug */,
14732BC81960F69300593899 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
14950060195FB89500BC5B5B /* Build configuration list for PBXAggregateTarget "All" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down

0 comments on commit 72d8e4e

Please sign in to comment.