Skip to content

Commit

Permalink
Updating build system to support force build even on release branch, …
Browse files Browse the repository at this point in the history
…and manage package building option to deny relocation dynamically (and so, relative path are automatically computed based on just created root)
  • Loading branch information
ygini committed Sep 13, 2017
1 parent 6f84be2 commit cb1f94c
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 32 deletions.
30 changes: 19 additions & 11 deletions package/BuildAndPackage.command
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,28 @@ fi

UNCOMMITED_CHANGE=$(git status -s | wc -l | bc)

if [ $UNCOMMITED_CHANGE -ne 0 ] && [ "$CONFIGURATION" == "Release" ]
if [ -z $FORCE_SKIP_REPO_STATE ]
then
echo "Your are on ${CURRENT_BRANCH} and there"
echo "is some uncommited change to the repo."
echo "Please, commit and try again or use"
echo "a development branch."
exit 1
if [ $UNCOMMITED_CHANGE -ne 0 ] && [ "$CONFIGURATION" == "Release" ]
then
echo "Your are on ${CURRENT_BRANCH} and there"
echo "is some uncommited change to the repo."
echo "Please, commit and try again or use"
echo "a development branch."
exit 1
fi
fi

PKG_VERSION=$(/usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" "${PROJECT_DIR}/Hello IT/Info.plist")

if [[ "$CURRENT_BRANCH" == release* ]]
then
CONFIGURATION="Release"
CONFIGURATION="Release"
VERSION_FROM_BRANCH=$(echo "${CURRENT_BRANCH}" | awk -F'/' '{print $2}')
if [[ "$VERSION_FROM_BRANCH" =~ ^[0-9]+\.[0-9]+ ]]
if [[ "$VERSION_FROM_BRANCH" =~ ^[0-9]+\.[0-9]+ ]]
then
PKG_VERSION=$VERSION_FROM_BRANCH
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $PKG_VERSION" "${PROJECT_DIR}/Hello IT/Info.plist"
PKG_VERSION=$VERSION_FROM_BRANCH
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $PKG_VERSION" "${PROJECT_DIR}/Hello IT/Info.plist"
git add "${PROJECT_DIR}/Hello IT/Info.plist"
git commit -m "Update app version number according to release branch"
fi
Expand Down Expand Up @@ -95,7 +98,12 @@ cp -r "${GIT_ROOT_DIR}/package/LaunchAgents/com.github.ygini.hello-it.plist" "${

#sudo chown -R root:wheel "${PKG_ROOT}"

pkgbuild --component-plist "${GIT_ROOT_DIR}/package/pkgbuild_options.plist" --sign "${DEVELOPER_ID_INSTALLER}" --root "${PKG_ROOT}" --scripts "${GIT_ROOT_DIR}/package/pkg_scripts" --identifier "com.github.ygini.hello-it" --version "${PKG_VERSION}" "${RELEASE_LOCATION}/Hello-IT-${PKG_VERSION}-${CONFIGURATION}.pkg"
PBK_BUILD_COMPONENT="${BUILT_PRODUCTS_DIR}/components.plist"
pkgbuild --analyze --root "${PKG_ROOT}" "${PBK_BUILD_COMPONENT}"

/usr/libexec/PlistBuddy -c "Set 0:BundleIsRelocatable bool false" "${PBK_BUILD_COMPONENT}"
/usr/libexec/PlistBuddy -c "Print" "${PBK_BUILD_COMPONENT}"
pkgbuild --component-plist "${PBK_BUILD_COMPONENT}" --sign "${DEVELOPER_ID_INSTALLER}" --root "${PKG_ROOT}" --scripts "${GIT_ROOT_DIR}/package/pkg_scripts" --identifier "com.github.ygini.hello-it" --version "${PKG_VERSION}" "${RELEASE_LOCATION}/Hello-IT-${PKG_VERSION}-${CONFIGURATION}.pkg"

rm -rf "${PKG_ROOT}"

Expand Down
11 changes: 0 additions & 11 deletions package/pkgbuild_options.plist

This file was deleted.

2 changes: 1 addition & 1 deletion src/HITDevKit/HITDevKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>178</string>
<string>199</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015 Yoann Gini (Open Source Project). All rights reserved.</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion src/Hello IT/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>198</string>
<string>199</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/OpenApplication/OpenApplication/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>178</string>
<string>199</string>
<key>HITPFunctionIdentifier</key>
<string>public.open.application</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/OpenResource/OpenResource/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>178</string>
<string>199</string>
<key>HITPFunctionIdentifier</key>
<string>public.open.resource</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Quit/Quit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>178</string>
<string>199</string>
<key>HITPFunctionIdentifier</key>
<string>public.quit</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/ScriptedItem/ScriptedItem/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>178</string>
<string>199</string>
<key>HITPFunctionIdentifier</key>
<string>public.script.item</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Separator/Separator/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>178</string>
<string>199</string>
<key>HITPFunctionIdentifier</key>
<string>public.separator</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/SubMenu/SubMenu/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>178</string>
<string>199</string>
<key>HITPFunctionIdentifier</key>
<string>public.submenu</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/TestHTTP/TestHTTP/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>178</string>
<string>199</string>
<key>HITPFunctionIdentifier</key>
<string>public.test.http</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Title/Title/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>178</string>
<string>199</string>
<key>HITPFunctionIdentifier</key>
<string>public.title</string>
<key>NSHumanReadableCopyright</key>
Expand Down

0 comments on commit cb1f94c

Please sign in to comment.