Skip to content

Commit

Permalink
Updating the scripts a little for deployment and adding version numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeydom committed Sep 5, 2018
1 parent 6ff1a2f commit d872bed
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 5 deletions.
41 changes: 41 additions & 0 deletions Port Map.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@
3180119B0D4DEC8400BE3B28 /* Resources */,
3180119C0D4DEC8400BE3B28 /* Sources */,
3180119D0D4DEC8400BE3B28 /* Frameworks */,
F29A391521400F4E00D70A50 /* Set Build Version Number */,
);
buildRules = (
);
Expand Down Expand Up @@ -638,6 +639,7 @@
F2C65FFB0D50C2D100820CAE /* Resources */,
F2C65FFC0D50C2D100820CAE /* Sources */,
F2C65FFD0D50C2D100820CAE /* Frameworks */,
F29A3917214010B900D70A50 /* Set Build Version Number */,
);
buildRules = (
);
Expand Down Expand Up @@ -715,6 +717,45 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
F29A391521400F4E00D70A50 /* Set Build Version Number */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Set Build Version Number";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n${SRCROOT}/set_build_number.sh\n";
};
F29A3917214010B900D70A50 /* Set Build Version Number */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Set Build Version Number";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n${SRCROOT}/set_build_number.sh\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
3180119C0D4DEC8400BE3B28 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
9 changes: 4 additions & 5 deletions createZip.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
zipBasePath="{TARGET_BUILD_DIR}/${ZipName}"
git=$(sh /etc/profile; which git)

echo "Removing zip file ${zipBasePath}.zip"
rm -f "${zipBasePath}.zip"
if [ x${ACTION} = xclean ]; then
exit 0
fi

echo "Removing .svn directories..."
find "${BUILT_PRODUCTS_DIR}/${ZipProduct}" -name ".svn" -exec rm -rvf "{}" \;
echo "...done"

echo "Setting ownership..."
chgrp -R admin "${BUILT_PRODUCTS_DIR}/${ZipProduct}"
echo "...done"
Expand All @@ -24,7 +21,9 @@ zip -9 -r -y "${ZipName}.zip" "${ZipProduct}"
echo "...done"

echo "Adding Revision Number to Zip file ${zipBasePath}.zip ..."
REV=`/usr/bin/env svnversion -n "${SRCROOT}"`
cd "${SRCROOT}"
REV=$("$git" rev-list --first-parent --count HEAD)
# REV=$("$git" describe --tag --always)
cd "${BUILT_PRODUCTS_DIR}"
cp "${ZipName}.zip" "${ZipName}-${REV}.zip"
echo "...done"
14 changes: 14 additions & 0 deletions set_build_number.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

git=$(sh /etc/profile; which git)
number_of_commits=$("$git" rev-list --first-parent --count HEAD)
git_release_version=$("$git" describe --tags --always)

target_plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH"
dsym_plist="$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist"

for plist in "$target_plist" "$dsym_plist"; do
if [ -f "$plist" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $number_of_commits" "$plist"
fi
done

0 comments on commit d872bed

Please sign in to comment.