make things more solid for snow-leopard

git-svn-id: http://google-refine.googlecode.com/svn/trunk@400 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Stefano Mazzocchi 2010-04-07 00:12:40 +00:00
parent 9e90e6f05c
commit 0978a8ec1d
2 changed files with 27 additions and 15 deletions

View File

@ -27,6 +27,7 @@
<property name="conf.dir" value="${basedir}/src/conf" /> <property name="conf.dir" value="${basedir}/src/conf" />
<property name="lib.dir" value="${basedir}/lib" /> <property name="lib.dir" value="${basedir}/lib" />
<property name="tests.dir" value="${basedir}/tests" /> <property name="tests.dir" value="${basedir}/tests" />
<property name="tools.dir" value="${basedir}/tools" />
<property name="server_classes.dir" value="${build.dir}/classes" /> <property name="server_classes.dir" value="${build.dir}/classes" />
<property name="webapp_classes.dir" value="${basedir}/src/main/webapp/WEB-INF/classes" /> <property name="webapp_classes.dir" value="${basedir}/src/main/webapp/WEB-INF/classes" />
@ -257,6 +258,7 @@
<target name="distclean" depends="clean"> <target name="distclean" depends="clean">
<delete dir="${build.dir}" /> <delete dir="${build.dir}" />
<delete dir="${dist.dir}" /> <delete dir="${dist.dir}" />
<delete dir="${tools.dir}" />
</target> </target>
</project> </project>

View File

@ -219,14 +219,7 @@ findbugs_prepare() {
FINDBUGS_FILE=`echo $FINDBUGS_URL | sed 's|.*/||'` FINDBUGS_FILE=`echo $FINDBUGS_URL | sed 's|.*/||'`
FINDBUGS_DIR="findbugs-1.3.9" FINDBUGS_DIR="findbugs-1.3.9"
cd $GRIDWORKS_TOOLS_DIR tool_download $FINDBUGS_URL $FINDBUGS_FILE $FINDBUGS_DIR
if [ ! -f "$FINDBUGS_FILE" ] ; then
download $FINDBUGS_URL $FINDBUGS_FILE
fi
if [ ! -d "$FINDBUGS_DIR" ] ; then
tar xzf $FINDBUGS_FILE || exit 1
fi
cd ..
} }
# ---------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------
@ -289,17 +282,22 @@ mac_dist() {
get_revision get_revision
ANT_PARAMS="-Djarbundler.dir=${GRIDWORKS_TOOLS_DIR}/${JARBUNDLER_DIR}" ANT_PARAMS="-Djarbundler.dir=${GRIDWORKS_TOOLS_DIR}/${JARBUNDLER_DIR}"
ant mac ant mac || exit 1
mkdir -p "$GRIDWORKS_BUILD_DIR/mac/.background" mkdir -p "$GRIDWORKS_BUILD_DIR/mac/.background"
cp src/graphics/dmg_background/dmg_background.png "$GRIDWORKS_BUILD_DIR/mac/.background/dmg_background.png" cp src/graphics/dmg_background/dmg_background.png "$GRIDWORKS_BUILD_DIR/mac/.background/dmg_background.png"
SIZE=30 SIZE=30
if [ -f "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" ] ; then
rm "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg"
fi
TITLE="Gridworks $VERSION" TITLE="Gridworks $VERSION"
echo "Building MacOSX DMG for $TITLE" echo "Building MacOSX DMG for $TITLE"
hdiutil create -srcfolder "$GRIDWORKS_BUILD_DIR/mac" -volname "$TITLE" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}m "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" hdiutil create -srcfolder "$GRIDWORKS_BUILD_DIR/mac" -volname "$TITLE" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}m "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" || error "can't create empty DMG"
hdiutil attach -readwrite -noverify -noautoopen "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" DEVICE=`hdiutil attach -readwrite -noverify -noautoopen "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" | egrep '^/dev/' | sed 1q | awk '{print $1}'`
hdiutil attach "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg"
echo ' echo '
tell application "Finder" tell application "Finder"
@ -319,20 +317,30 @@ mac_dist() {
close close
open open
update without registering applications update without registering applications
delay 2 delay 2
eject eject
end tell end tell
end tell end tell
' | osascript ' | osascript || error "error running applescript"
sync sync
sync sync
hdiutil convert "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" -format UDZO -imagekey zlib-level=9 -o "$GRIDWORKS_DIST_DIR/gridworks-$VERSION-$REVISION.dmg" hdiutil detach $DEVICE
hdiutil internet-enable -yes "$GRIDWORKS_DIST_DIR/gridworks-$VERSION-$REVISION.dmg" hdiutil convert "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" -format UDZO -imagekey zlib-level=9 -o "$GRIDWORKS_DIST_DIR/gridworks-$VERSION-$REVISION.dmg" || error "Error compressing DMG"
hdiutil internet-enable -yes "$GRIDWORKS_DIST_DIR/gridworks-$VERSION-$REVISION.dmg" || error "Error internet-enabling DMG"
rm -f "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" rm -f "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg"
} }
test() { test() {
ui_test $1
server_test $1
}
ui_test() {
windmill_prepare
}
server_test() {
if [ ! -d $GRIDWORKS_TEST_DIR/classes ] ; then if [ ! -d $GRIDWORKS_TEST_DIR/classes ] ; then
ant build_tests ant build_tests
echo "" echo ""
@ -529,6 +537,8 @@ case "$ACTION" in
clean) ant clean;; clean) ant clean;;
distclean) ant distclean;; distclean) ant distclean;;
test) test $1;; test) test $1;;
ui_test) ui_test $1;;
server_test) server_test $1;;
findbugs) findbugs;; findbugs) findbugs;;
run) run;; run) run;;
execute) execute $*;; execute) execute $*;;