Skip to content

Commit

Permalink
New build script
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinbjornt committed Jun 28, 2015
1 parent d628bae commit ad29bcc
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Application/PlatypusIconView.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ - (void)mouseDown: (NSEvent*)event {
} else {
[dragPasteboard declareTypes:[NSArray arrayWithObject:NSTIFFPboardType] owner:self];
[dragPasteboard setData:[delegate imageData] forType:NSTIFFPboardType];
}
}

//draw our original image as 50% transparent
[dragImage lockFocus];
Expand Down
16 changes: 15 additions & 1 deletion Platypus.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@
F4B5DE4014919FF500C43901 /* PlatypusUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlatypusUtility.m; path = Shared/PlatypusUtility.m; sourceTree = "<group>"; };
F4B87C191B3C997300F4B8BE /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = ../../System/Library/Frameworks/Accelerate.framework; sourceTree = "<group>"; };
F4B87C501B3F04F400F4B8BE /* cat2html.l */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lex; name = cat2html.l; path = CommandLineTool/cat2html.l; sourceTree = "<group>"; };
F4B87C581B403A6E00F4B8BE /* build_release.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build_release.sh; sourceTree = "<group>"; };
F4B87C591B403A6E00F4B8BE /* src_loc_stats.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = src_loc_stats.sh; sourceTree = "<group>"; };
F4B87C5A1B403A6E00F4B8BE /* uncrustify.cfg */ = {isa = PBXFileReference; lastKnownFileType = text; path = uncrustify.cfg; sourceTree = "<group>"; };
F4BDABD50FD9A7CC00328FDD /* PlatypusScriptFile.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = PlatypusScriptFile.icns; sourceTree = "<group>"; };
F4BDABD60FD9A7CC00328FDD /* PlatypusProfile.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = PlatypusProfile.icns; sourceTree = "<group>"; };
F4D6568E14C4BFD6003552F9 /* Add.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Add.png; sourceTree = "<group>"; };
Expand Down Expand Up @@ -358,6 +361,7 @@
29B97314FDCFA39411CA2CEA /* Platypus */ = {
isa = PBXGroup;
children = (
F4B87C571B403A1E00F4B8BE /* Scripts */,
F4DC074D11F629A40043764E /* Documentation */,
F4A4338B0E04C962000523E7 /* Common.h */,
F48B7CB611F76B0C00351575 /* Application */,
Expand Down Expand Up @@ -613,6 +617,16 @@
name = Utility;
sourceTree = "<group>";
};
F4B87C571B403A1E00F4B8BE /* Scripts */ = {
isa = PBXGroup;
children = (
F4B87C581B403A6E00F4B8BE /* build_release.sh */,
F4B87C591B403A6E00F4B8BE /* src_loc_stats.sh */,
F4B87C5A1B403A6E00F4B8BE /* uncrustify.cfg */,
);
name = Scripts;
sourceTree = "<group>";
};
F4D6568C14C4BFD6003552F9 /* Images */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -886,7 +900,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#/bin/sh\n#\n# Since XCode won't let us copy files from\n# within application bundles in the Copy Files\n# phase, we copy the ScriptExec.app bundle over,\n# then copy the binary within into Resources,\n# and finally delete app bundle\n\nRESOURCES_DIR=\"${TARGET_BUILD_DIR}/Platypus.app/Contents/Resources\"\nSCRIPT_EXEC_APP_PATH=\"${RESOURCES_DIR}/ScriptExec.app\"\nSCRIPT_EXEC_BIN_PATH=\"${SCRIPT_EXEC_APP_PATH}/Contents/MacOS/ScriptExec\"\ncp $SCRIPT_EXEC_BIN_PATH \"${RESOURCES_DIR}/ScriptExec\"\nrm -r $SCRIPT_EXEC_APP_PATH\n";
shellScript = "#/bin/sh\n#\n# Since XCode won't let us copy files from\n# within application bundles in the Copy Files\n# phase, we copy the ScriptExec.app bundle over,\n# then copy the binary within into Resources,\n# and finally delete app bundle\n\nRESOURCES_DIR=\"${TARGET_BUILD_DIR}/Platypus.app/Contents/Resources\"\nSCRIPT_EXEC_APP_PATH=\"${RESOURCES_DIR}/ScriptExec.app\"\nSCRIPT_EXEC_BIN_PATH=\"${SCRIPT_EXEC_APP_PATH}/Contents/MacOS/ScriptExec\"\ncp \"${SCRIPT_EXEC_BIN_PATH}\" \"${RESOURCES_DIR}/ScriptExec\"\nrm -r \"${SCRIPT_EXEC_APP_PATH}\"\n";
};
F4FB337514FBDAD500BAECEB /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
52 changes: 52 additions & 0 deletions build_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash
#
# Release build script for Platypus
# Must be run from src root
#
# Created by Sveinbjorn Thordarson 28/06/2015
#

SRC_DIR=$PWD
BUILD_DIR="/tmp/"

VERSION=`perl -e 'use Shell;@lines=cat("Common.h");foreach(@lines){if($_=~m/PROGRAM_VERSION.+(\d\.\d.+)\"/){print $1;}}'`
APP_NAME=`perl -e 'use Shell;@lines=cat("Common.h");foreach(@lines){if($_=~m/PROGRAM_NAME.+\"(.+)\"/){print $1;}}'`
APP_NAME_LC=`echo -n "${APP_NAME}" | perl -ne 'print lc'` # lowercase name

APP_FOLDER_NAME="${APP_NAME}-${VERSION}"
APP_BUNDLE_NAME="${APP_NAME}.app"

APP_ZIP_NAME="${APP_NAME_LC}${VERSION}.zip"
APP_SRC_ZIP_NAME="${APP_NAME_LC}${VERSION}.src.zip"

echo "Building ${APP_NAME_LC} version ${VERSION}"

xcodebuild -parallelizeTargets\
-scheme "Platypus App" \
-configuration Deployment \
CONFIGURATION_BUILD_DIR="${BUILD_DIR}" \
clean \
build

# Remove previous app folder
rm -r "${BUILD_DIR}/${APP_FOLDER_NAME}" &> /dev/null

# Create folder and copy app into it
mkdir "${BUILD_DIR}/${APP_FOLDER_NAME}"
mv "${BUILD_DIR}/${APP_BUNDLE_NAME}" "${BUILD_DIR}${APP_FOLDER_NAME}/"

# Create symlink to Readme file
cd "${BUILD_DIR}/${APP_FOLDER_NAME}"
ln -s "${APP_BUNDLE_NAME}/Contents/Resources/Readme.html" "Readme.html"

# Create zip archive and move to desktop
echo "Creating application archive..."
cd "${BUILD_DIR}"
zip --symlinks "${APP_ZIP_NAME}" -r "${APP_FOLDER_NAME}"
mv "${APP_ZIP_NAME}" ~/Desktop/

# Create source archive
echo "Creating source archive..."
cd "${SRC_DIR}"
zip --symlinks -r "${APP_SRC_ZIP_NAME}" "." -x *.git* -x *.zip* -x *.tgz* -x *.gz* -x *.DS_Store* -x *dsa_priv.pem* -x *Sparkle/dsa_priv.pem*
mv "${APP_SRC_ZIP_NAME}" ~/Desktop/
10 changes: 0 additions & 10 deletions deploy_update.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src_loc_stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ find . -name \*.\[m\] -exec cat {} \; | wc -l
echo "LOC Total header files"
find . -name \*.\[h\] -exec cat {} \; | wc -l
echo "LOC Platypus App"
find PlatypusApplication -name \*.\[m\|h\] -exec cat {} \; | wc -l
find Application -name \*.\[m\|h\] -exec cat {} \; | wc -l
echo "LOC ScriptExec"
find ScriptExec -name \*.\[m\|h\] -exec cat {} \; | wc -l
echo "LOC Command Line Tool"
Expand Down

0 comments on commit ad29bcc

Please sign in to comment.