Commit e38598d7 authored by Jamie Hall's avatar Jamie Hall
Browse files

Final changes to build process for mac

parent f972d0a1
...@@ -6,3 +6,4 @@ ...@@ -6,3 +6,4 @@
.eggs .eggs
dist/ dist/
.DS_Store .DS_Store
Tests/FunctionalTests/Jobs
...@@ -5,27 +5,18 @@ import os ...@@ -5,27 +5,18 @@ import os
if sys.platform.startswith('darwin'): if sys.platform.startswith('darwin'):
from setuptools import setup from setuptools import setup
#build_name = os.environ['BUILD_NAME'] build_name = os.environ['BUILD_NAME']
#rev_number = os.environ['REV_NUMBER'] rev_number = os.environ['REV_NUMBER']
#version = build_name + " v" + rev_number version = build_name + " v" + rev_number
version = 1
build_name = "MDANSE"
APP = ['../../../Scripts/mdanse_gui'] APP = ['../../../Scripts/mdanse_gui']
PLIST = { PLIST = {
u'CFBundleName': u'MDANSE', u'CFBundleName': u'MDANSE',
u'CFBundleShortVersionString': build_name, u'CFBundleShortVersionString': build_name,
u'CFBundleVersion': version, u'CFBundleVersion': version,
u'CFBundleIdentifier': u'eu.ill.MDANSE-'+build_name, u'CFBundleIdentifier': u'eu.ill.MDANSE-'+build_name,
u'LSMinimumSystemVersion': u'10.6', u'LSApplicationCategoryType': u'public.app-category.science'
u'LSApplicationCategoryType': u'public.app-category.science',
u'CFBundleDocumentTypes': [
{
u'CFBundleTypeRole': u'Viewer',
u'LSItemContentTypes': [u'eu.ill.MDANSE'],
u'LSHandlerRank': u'Owner',
}
]
} }
OPTIONS = { OPTIONS = {
'argv_emulation': True, 'argv_emulation': True,
......
...@@ -47,14 +47,34 @@ if [ "$BUILD_TARGET" = "darwin" ]; then ...@@ -47,14 +47,34 @@ if [ "$BUILD_TARGET" = "darwin" ]; then
# Now build last version and install it in our homebrewed python # Now build last version and install it in our homebrewed python
echo -e "$BLEU""Building MDANSE" "$NORMAL" echo -e "$BLEU""Building MDANSE" "$NORMAL"
# Clean up temporary build directories
rm -rf build
rm -rf dist
# Remove previous install of MDANSE
rm /usr/local/bin/mdanse*
rm /usr/local/lib/python2.7/site-packages/MDANSE*.egg-info
rm -rf /usr/local/lib/python2.7/site-packages/MDANSE
# Build and install MDANSE to the homebrewed python
/usr/local/bin/python setup.py build /usr/local/bin/python setup.py build
/usr/local/bin/python setup.py install /usr/local/bin/python setup.py install
# Performs the unit tests
cd Tests/UnitTests
nosetests --verbosity=3 -P .
cd ../..
cd Tests/FunctionalTests/Jobs
python BuildJobTests.py
nosetests --verbosity=3 --exe -P .
cd ../../..
TARGET_DIR=MDANSE-${BUILD_NAME}-b${REV_NUMBER}-MacOS TARGET_DIR=MDANSE-${BUILD_NAME}-b${REV_NUMBER}-MacOS
echo -e "$BLEU""Packaging MDANSE" "$NORMAL" echo -e "$BLEU""Packaging MDANSE" "$NORMAL"
rm -rf BuildServer/Darwin/Build/dist rm -rf BuildServer/Darwin/Build
rm -rf BuildServer/Darwin/Build/build mkdir BuildServer/Darwin/Build
# debug option for py2app, if needed # debug option for py2app, if needed
export DISTUTILS_DEBUG=0 export DISTUTILS_DEBUG=0
...@@ -84,6 +104,8 @@ if [ "$BUILD_TARGET" = "darwin" ]; then ...@@ -84,6 +104,8 @@ if [ "$BUILD_TARGET" = "darwin" ]; then
hdiutil unmount /Volumes/MDANSE -force -quiet hdiutil unmount /Volumes/MDANSE -force -quiet
sleep 5
../Tools/create-dmg/create-dmg --background "../Resources/background.jpg" --volname "MDANSE" --window-pos 200 120 --window-size 800 400 --icon MDANSE.app 200 190 --hide-extension MDANSE.app --app-drop-link 600 185 MDANSE.dmg ./dist ../Tools/create-dmg/create-dmg --background "../Resources/background.jpg" --volname "MDANSE" --window-pos 200 120 --window-size 800 400 --icon MDANSE.app 200 190 --hide-extension MDANSE.app --app-drop-link 600 185 MDANSE.dmg ./dist
exit exit
fi fi
......
...@@ -161,6 +161,8 @@ echo "Mount directory: $MOUNT_DIR" ...@@ -161,6 +161,8 @@ echo "Mount directory: $MOUNT_DIR"
DEV_NAME=$(hdiutil attach -readwrite -noverify -noautoopen "${DMG_TEMP_NAME}" | egrep '^/dev/' | sed 1q | awk '{print $1}') DEV_NAME=$(hdiutil attach -readwrite -noverify -noautoopen "${DMG_TEMP_NAME}" | egrep '^/dev/' | sed 1q | awk '{print $1}')
echo "Device name: $DEV_NAME" echo "Device name: $DEV_NAME"
sleep 5
if ! test -z "$BACKGROUND_FILE"; then if ! test -z "$BACKGROUND_FILE"; then
echo "Copying background file..." echo "Copying background file..."
test -d "$MOUNT_DIR/.background" || mkdir "$MOUNT_DIR/.background" test -d "$MOUNT_DIR/.background" || mkdir "$MOUNT_DIR/.background"
......
...@@ -312,7 +312,7 @@ or directly to the MDANSE mailing list: ...@@ -312,7 +312,7 @@ or directly to the MDANSE mailing list:
mainHTML = os.path.join(PLATFORM.api_path(),'MDANSE.html') mainHTML = os.path.join(PLATFORM.api_path(),'MDANSE.html')
if os.path.exists(mainHTML): if os.path.exists(mainHTML):
webbrowser.open(mainHTML) webbrowser.open("file://%s" % mainHTML)
else: else:
LOGGER("Can not open MDANSE API. Maybe the documentation was not properly installed.", "error",['dialog']) LOGGER("Can not open MDANSE API. Maybe the documentation was not properly installed.", "error",['dialog'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment