Skip to content

Commit

Permalink
Move make_diskimage and sparkle_sign to new target
Browse files Browse the repository at this point in the history
The scripts `make_diskimage.bash` and `sparkle_sign.bash` were run
before swift libraries were copied into the app and so the deployed
app would crash when you ran it because of the missing swift libraries.

This commit adds a new target Package whose only job is to run
`make_diskimage.bash` and `sparkle_sign.bash` after the full app has
been built.
  • Loading branch information
griff committed Mar 9, 2020
1 parent bb06790 commit f563669
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -9,7 +9,7 @@ install:
- gem install xcpretty-travis-formatter
script:
- xcodebuild -version
- xcodebuild
- xcodebuild -target Package
before_deploy:
- source Scripts/tag-beta.bash
- mkdir Upload
Expand Down
107 changes: 87 additions & 20 deletions MetaZ.xcodeproj/project.pbxproj
Expand Up @@ -18,6 +18,19 @@
name = "Plist Marcos";
productName = "Plist Macos";
};
1B76F8E32415C09F00CB8810 /* Package */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 1B76F8E42415C0A000CB8810 /* Build configuration list for PBXAggregateTarget "Package" */;
buildPhases = (
1B76F8EA2415C0C400CB8810 /* Make Disk image */,
1B76F8EB2415C2AE00CB8810 /* Sparkle Sign */,
);
dependencies = (
1B76F8E92415C0A700CB8810 /* PBXTargetDependency */,
);
name = Package;
productName = Package;
};
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -355,6 +368,13 @@
remoteGlobalIDString = 1B4F53B3116E9F44003221B1;
remoteInfo = TheTVDB;
};
1B76F8E82415C0A700CB8810 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8D1107260486CEB800E47090;
remoteInfo = MetaZ;
};
1B7B1034240603930018DB18 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
Expand Down Expand Up @@ -2069,8 +2089,6 @@
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
1B56A4BB17065FC300BDE79D /* Copy document types from plugins */,
1B8262A710B39DE400DF101B /* Make Disk Image */,
1BB6BF3B1050ED38001D3D1D /* Sparkle Sign */,
);
buildRules = (
);
Expand Down Expand Up @@ -2099,6 +2117,9 @@
attributes = {
LastUpgradeCheck = 1010;
TargetAttributes = {
1B76F8E32415C09F00CB8810 = {
CreatedOnToolsVersion = 10.1;
};
1BA325C310545ACA00276F57 = {
LastSwiftMigration = 1010;
};
Expand Down Expand Up @@ -2147,6 +2168,7 @@
1B3185A01841E9D6001EDE79 /* OSXNotificationPlugin */,
1B7FF3E324047EE3001457CE /* TheTVDB3 */,
1B7B1032240603930018DB18 /* TheMovieDbNG */,
1B76F8E32415C09F00CB8810 /* Package */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -2314,62 +2336,68 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -o errexit\nbash $SRCROOT/Scripts/document_types.bash";
shellScript = "set -o errexit\nbash $SRCROOT/Scripts/document_types.bash\n";
};
1B8262A710B39DE400DF101B /* Make Disk Image */ = {
1B76F8EA2415C0C400CB8810 /* Make Disk image */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(SRCROOT)/Release/template.dmg.zip",
"$(SRCROOT)/Thanks.txt",
"$(SRCROOT)/License.txt",
"$(BUILT_PRODUCTS_DIR)/$(PROJECT_NAME).app",
);
name = "Make Disk Image";
name = "Make Disk image";
outputFileListPaths = (
);
outputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(PROJECT_NAME)-$(VERSION).dmg",
"$(CONFIGURATION_TEMP_DIR)/wc.dmg",
"$(BUILT_PRODUCTS_DIR)/$(PROJECT_NAME)-$(VERSION).zip",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -o errexit\nbash $SRCROOT/Scripts/make_diskimage.bash";
showEnvVarsInLog = 0;
shellScript = "set -o errexit\nbash $SRCROOT/Scripts/make_diskimage.bash\n";
};
1BA9B57B2089550F00DDC17F /* carthage copy-frameworks */ = {
1B76F8EB2415C2AE00CB8810 /* Sparkle Sign */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(SRCROOT)/Carthage/Build/Mac/Sparkle.framework",
"$(BUILT_PRODUCTS_DIR)/$(PROJECT_NAME)-$(VERSION).zip",
);
name = "Sparkle Sign";
outputFileListPaths = (
);
name = "carthage copy-frameworks";
outputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Sparkle.framework",
"$(BUILT_PRODUCTS_DIR)/$(PROJECT_NAME)-$(VERSION).xml",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "PATH=${PATH}:/usr/local/bin:/opt/local/bin\ncarthage copy-frameworks\n";
shellScript = "set -o errexit\nbash $SRCROOT/Scripts/sparkle_sign.bash\n";
};
1BB6BF3B1050ED38001D3D1D /* Sparkle Sign */ = {
1BA9B57B2089550F00DDC17F /* carthage copy-frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 12;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(PROJECT_NAME)-$(VERSION).zip",
"$(SRCROOT)/Carthage/Build/Mac/Sparkle.framework",
);
name = "Sparkle Sign ";
name = "carthage copy-frameworks";
outputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(PROJECT_NAME)-$(VERSION).xml",
"$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Sparkle.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "set -o errexit\nbash $SRCROOT/Scripts/sparkle_sign.bash\n";
showEnvVarsInLog = 0;
shellPath = /bin/sh;
shellScript = "PATH=${PATH}:/usr/local/bin:/opt/local/bin\ncarthage copy-frameworks\n";
};
1BEA6D70106EA6D1004B1A7F /* Build Documentation */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -2648,6 +2676,11 @@
target = 1B4F53B3116E9F44003221B1 /* TheTVDB */;
targetProxy = 1B4F53D1116EA0B7003221B1 /* PBXContainerItemProxy */;
};
1B76F8E92415C0A700CB8810 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8D1107260486CEB800E47090 /* MetaZ */;
targetProxy = 1B76F8E82415C0A700CB8810 /* PBXContainerItemProxy */;
};
1B7B1033240603930018DB18 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 1BA325C310545ACA00276F57 /* MetaZKit */;
Expand Down Expand Up @@ -3254,6 +3287,30 @@
};
name = Release;
};
1B76F8E52415C0A000CB8810 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
1B76F8E62415C0A000CB8810 /* Remote Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = "Remote Debug";
};
1B76F8E72415C0A000CB8810 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
1B7B103E240603930018DB18 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -3948,6 +4005,16 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1B76F8E42415C0A000CB8810 /* Build configuration list for PBXAggregateTarget "Package" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1B76F8E52415C0A000CB8810 /* Debug */,
1B76F8E62415C0A000CB8810 /* Remote Debug */,
1B76F8E72415C0A000CB8810 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1B7B103D240603930018DB18 /* Build configuration list for PBXNativeTarget "TheMovieDbNG" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
10 changes: 4 additions & 6 deletions Scripts/make_diskimage.bash
@@ -1,15 +1,15 @@
PATH=$PATH:/usr/local/bin:/usr/bin:/sw/bin:/opt/local/bin
set -o errexit
#set -x
set -x

if [ "${CONFIGURATION}" != "Release" ]; then exit; fi

rm -f "$BUILT_PRODUCTS_DIR/$PROJECT_NAME"*.dmg

VERSION=$(/usr/libexec/PlistBuddy -c "print :CFBundleShortVersionString" "$BUILT_PRODUCTS_DIR/$PROJECT_NAME.app/Contents/Info.plist")
SOURCE_FILES=($CODESIGNING_FOLDER_PATH Thanks.txt License.txt)
SOURCE_FILES=($BUILT_PRODUCTS_DIR/${PROJECT_NAME}.app Thanks.txt License.txt)
TEMPLATE_DMG=$SRCROOT/Release/template.dmg
MASTER_DMG=$BUILT_PRODUCTS_DIR/$PROJECT_NAME-${VERSION}.dmg
MASTER_DMG=$BUILT_PRODUCTS_DIR/${PROJECT_NAME}-${VERSION}.dmg
WC_DMG=$CONFIGURATION_TEMP_DIR/wc.dmg
WC_DIR=$CONFIGURATION_TEMP_DIR/wc
ARCHIVE_FILENAME="$PROJECT_NAME-$VERSION.zip"
Expand Down Expand Up @@ -54,7 +54,7 @@ if [ ! -z "${EULA_RSRC}" -a "${EULA_RSRC}" != "-null-" ]; then
fi

app=`which seticon || echo 'non'`
if [ -x $app ] ; then
if [ -x $app ] ; then
seticon "$WC_DMG" "$MASTER_DMG"
else
echo warning Missing stuff
Expand All @@ -71,5 +71,3 @@ cp -R *.dSYM DSYMS/
#ditto -ck --keepParent "$PROJECT_NAME.app.dSYM" "$PROJECT_NAME-$VERSION-$GITV+dSYM.zip"
ditto -ck DSYMS "$PROJECT_NAME-$VERSION-$GITV+dSYM.zip"
rm -rf DSYMS


0 comments on commit f563669

Please sign in to comment.