- condensing exe and cli distributions into one for windows (shipping both the .exe and the .bat in the same package)

- renamed the distibutions based on their target OS
- more polishing here and there


git-svn-id: http://google-refine.googlecode.com/svn/trunk@365 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Stefano Mazzocchi 2010-03-31 02:11:53 +00:00
parent 3c9af6501e
commit 9db9351a0b
3 changed files with 67 additions and 89 deletions

View File

@ -30,11 +30,12 @@
<property name="classes.dir" value="${build.dir}/classes" />
<property name="tests_classes.dir" value="${tests.dir}/classes" />
<property name="webapp.dir" value="${build.dir}/webapp" />
<property name="bundle.dir" value="${build.dir}/bundle" />
<property name="exe.dir" value="${build.dir}/exe" />
<property name="cli.name" value="gridworks-${version}" />
<property name="cli.dir" value="${build.dir}/cli/${cli.name}" />
<property name="webapp.name" value="webapp" />
<property name="webapp.dir" value="${build.dir}/${webapp.name}" />
<property name="mac.dir" value="${build.dir}/mac" />
<property name="windows.dir" value="${build.dir}/windows" />
<property name="linux.name" value="gridworks-${version}" />
<property name="linux.dir" value="${build.dir}/linux/${linux.name}" />
<path id="class.path">
<fileset dir="${lib.dir}">
@ -82,17 +83,17 @@
</replace>
</target>
<target name="bundle" depends="jar, prepare_webapp">
<target name="mac" depends="jar, prepare_webapp">
<taskdef
name="jarbundler"
classname="net.sourceforge.jarbundler.JarBundler"
classpath="${tools.dir}/jarbundler-2.1.0.jar"
/>
<mkdir dir="${bundle.dir}"/>
<mkdir dir="${mac.dir}"/>
<jarbundler
dir="${bundle.dir}"
dir="${mac.dir}"
name="Gridworks"
mainclass="com.metaweb.gridworks.Gridworks"
icon="${graphics.dir}/icon/gridworks.icns"
@ -113,14 +114,14 @@
<include name="**/*.jar" />
</jarfileset>
<jarfilelist dir="${build.dir}" files="gridworks.jar" />
<resourcefileset dir="${webapp.dir}">
<include name="**" />
<resourcefileset dir="${webapp.dir}/..">
<include name="${webapp.name}/**" />
</resourcefileset>
</jarbundler>
</target>
<target name="exe" depends="jar, prepare_webapp">
<mkdir dir="${exe.dir}"/>
<target name="windows" depends="jar, prepare_webapp">
<mkdir dir="${windows.dir}"/>
<taskdef
name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
@ -129,7 +130,7 @@
<launch4j>
<config
headerType="console"
outfile="${exe.dir}/Gridworks.exe"
outfile="${windows.dir}/Gridworks.exe"
jarPath="lib/gridworks-${version}-${revision}.jar"
dontWrapJar="true"
icon="${graphics.dir}/icon/gridworks.ico">
@ -153,83 +154,70 @@
/>
</config>
</launch4j>
<copy todir="${exe.dir}/lib">
<copy todir="${windows.dir}/lib">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</copy>
<copy todir="${exe.dir}/lib/native/windows">
<copy todir="${windows.dir}/lib/native/windows">
<fileset dir="${lib.dir}/native/windows">
<include name="*.dll"/>
</fileset>
</copy>
<copy file="${build.dir}/gridworks.jar" tofile="${exe.dir}/lib/gridworks-${version}-${revision}.jar"/>
<copy todir="${exe.dir}/src/main/webapp">
<copy file="${build.dir}/gridworks.jar" tofile="${windows.dir}/lib/gridworks-${version}-${revision}.jar"/>
<copy todir="${windows.dir}/webapp">
<fileset dir="${webapp.dir}">
<include name="**"/>
</fileset>
</copy>
<copy todir="${cli.dir}/licenses">
<copy todir="${linux.dir}/licenses">
<fileset dir="${basedir}/licenses">
<include name="**"/>
</fileset>
</copy>
<copy file="${conf.dir}/gridworks.l4j.ini" tofile="${exe.dir}/gridworks.l4j.ini"/>
<copy file="${basedir}/README.txt" tofile="${exe.dir}/README.txt"/>
<copy file="${basedir}/LICENSE.txt" tofile="${exe.dir}/LICENSE.txt"/>
<copy file="${conf.dir}/gridworks.l4j.ini" tofile="${windows.dir}/gridworks.l4j.ini"/>
<copy file="${basedir}/gridworks.bat" tofile="${windows.dir}/gridworks.bat"/>
<copy file="${basedir}/README.txt" tofile="${windows.dir}/README.txt"/>
<copy file="${basedir}/LICENSE.txt" tofile="${windows.dir}/LICENSE.txt"/>
<zip destfile="${dist.dir}/gridworks-${version}-${revision}.zip" basedir="${exe.dir}"/>
<zip destfile="${dist.dir}/gridworks-${version}-${revision}.zip" basedir="${windows.dir}"/>
</target>
<target name="cli" depends="jar, prepare_webapp">
<mkdir dir="${cli.dir}"/>
<target name="linux" depends="jar, prepare_webapp">
<mkdir dir="${linux.dir}"/>
<copy todir="${cli.dir}/lib">
<copy todir="${linux.dir}/lib">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</copy>
<copy todir="${cli.dir}/lib/native/windows">
<fileset dir="${lib.dir}/native/windows">
<include name="*.dll"/>
</fileset>
</copy>
<copy file="${build.dir}/gridworks.jar" tofile="${cli.dir}/lib/gridworks-${version}-${revision}.jar"/>
<copy file="${build.dir}/gridworks.jar" tofile="${linux.dir}/lib/gridworks-${version}-${revision}.jar"/>
<copy todir="${cli.dir}/src/main/webapp">
<copy todir="${linux.dir}/src/main/webapp">
<fileset dir="${webapp.dir}">
<include name="**"/>
</fileset>
</copy>
<copy todir="${cli.dir}/licenses">
<copy todir="${linux.dir}/licenses">
<fileset dir="${basedir}/licenses">
<include name="**"/>
</fileset>
</copy>
<copy file="${basedir}/gridworks.ini" tofile="${cli.dir}/gridworks.ini"/>
<copy file="${basedir}/gridworks.bat" tofile="${cli.dir}/gridworks.bat"/>
<copy file="${basedir}/LICENSE.txt" tofile="${cli.dir}/LICENSE.txt"/>
<copy file="${basedir}/README.txt" tofile="${cli.dir}/README.txt"/>
<delete file="${cli.dir}/gridworks"/>
<zip destfile="${dist.dir}/gridworks-${version}-${revision}-cli.zip" basedir="${cli.dir}"/>
<delete file="${cli.dir}/gridworks.bat"/>
<delete dir="${cli.dir}/lib/native/windows"/>
<copy file="${basedir}/gridworks" tofile="${cli.dir}/gridworks"/>
<copy file="${basedir}/gridworks.ini" tofile="${linux.dir}/gridworks.ini"/>
<copy file="${basedir}/LICENSE.txt" tofile="${linux.dir}/LICENSE.txt"/>
<copy file="${basedir}/README.txt" tofile="${linux.dir}/README.txt"/>
<copy file="${basedir}/gridworks" tofile="${linux.dir}/gridworks"/>
<tar longfile="gnu" compression="gzip" destfile="${dist.dir}/gridworks-${version}-${revision}.tar.gz">
<tarfileset dir="${cli.dir}/.." filemode="755">
<include name="${cli.name}/gridworks"/>
<tarfileset dir="${linux.dir}/.." filemode="755">
<include name="${linux.name}/gridworks"/>
</tarfileset>
<tarfileset dir="${cli.dir}/..">
<include name="${cli.name}/**"/>
<exclude name="${cli.name}/gridworks"/>
<tarfileset dir="${linux.dir}/..">
<include name="${linux.name}/**"/>
<exclude name="${linux.name}/gridworks"/>
</tarfileset>
</tar>
</target>

View File

@ -52,9 +52,9 @@ and <action> is one of
test ...................... Test Gridworks
make_dmg <version> ........ Make MacOSX DMG distribution
make_exe <version> ........ Make Windows EXE distribution
make_cli <version> ........ Make distributions to be run at command line
mac_dist <version> ........ Make MacOSX binary distribution
windows_dist <version> .... Make Windows binary distribution
linux_dist <version> ...... Make Linux binary distribution
dist <version> ............ Make all distributions
@ -143,13 +143,13 @@ get_revision() {
}
dist() {
make_dmg $1
make_exe $1
make_cli $1
mac_dist $1
windows_dist $1
linux_dist $1
echo "Distributions were built."
echo "All distributions were built and are located at $GRIDWORKS_DIST_DIR"
echo
echo "Upload them, then prepend the GridworksReleases array at"
echo "Upload them to the distibution site, then prepend the GridworksReleases array at"
echo
echo " http://acre.freebase.com/#app=/user/dfhuynh/labs-site&file=gridworks.js"
echo
@ -163,42 +163,41 @@ dist() {
echo
}
make_exe() {
windows_dist() {
check_macosx
dist_prepare
launch4j_prepare
get_version $1
get_revision
ant exe
ant windows
}
make_cli() {
linux_dist() {
dist_prepare
get_version $1
get_revision
ant cli
ant linux
}
make_dmg() {
mac_dist() {
check_macosx
dist_prepare
get_version $1
get_revision
ant bundle
ant mac
mkdir "$GRIDWORKS_BUILD_DIR/bundle/.background"
cp src/graphics/dmg_background/dmg_background.png "$GRIDWORKS_BUILD_DIR/bundle/.background/dmg_background.png"
mkdir -p "$GRIDWORKS_BUILD_DIR/mac/.background"
cp src/graphics/dmg_background/dmg_background.png "$GRIDWORKS_BUILD_DIR/mac/.background/dmg_background.png"
SIZE=30
TITLE="Gridworks $VERSION"
echo "Building MacOSX DMG for $TITLE"
hdiutil create -srcfolder "$GRIDWORKS_BUILD_DIR/bundle" -volname "$TITLE" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}m "$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"
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 attach -readwrite -noverify -noautoopen "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg"
echo '
tell application "Finder"
@ -224,10 +223,8 @@ make_dmg() {
end tell
' | osascript
chmod -Rf go-w /Volumes/Gridworks
sync
sync
hdiutil detach $DEVICE
hdiutil convert "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" -format UDZO -imagekey zlib-level=9 -o "$GRIDWORKS_DIST_DIR/gridworks-$VERSION-$REVISION.dmg"
hdiutil internet-enable -yes "$GRIDWORKS_DIST_DIR/gridworks-$VERSION-$REVISION.dmg"
rm -f "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg"
@ -260,7 +257,6 @@ test() {
run() {
if [ ! -d $GRIDWORKS_BUILD_DIR/classes ] ; then
is_jar=`ls $GRIDWORKS_LIB_DIR | grep gridworks`
echo "\"$is_jar\""
if [ "$is_jar" == "" ] ; then
ant build
echo ""
@ -305,10 +301,6 @@ execute() {
# -------------------------- script -----------------------------
# ----- We called without arguments print the usage -------------
[ $# -gt 0 ] || usage
# ----- Normalize the current directory -------------------------
cd `dirname $0`
@ -366,6 +358,10 @@ done
ACTION=$1; shift
if [ "$ACTION" == "" ]; then
ACTION="run"
fi
# ----- Verify and Set Required Environment Variables -------------------------
if [ "$JAVA_OPTIONS" == "" ] ; then
@ -416,9 +412,6 @@ case "$ACTION" in
build)
ant build;;
bundle)
ant bundle;;
clean)
ant clean;;
@ -434,14 +427,14 @@ case "$ACTION" in
execute)
execute $*;;
make_dmg)
make_dmg $1;;
mac_dist)
mac_dist $1;;
make_exe)
make_exe $1;;
windows_dist)
windows_dist $1;;
make_cli)
make_cli $1;;
linux_dist)
linux_dist $1;;
dist)
dist $1;;

View File

@ -161,11 +161,8 @@ if ""%ACTION%"" == ""clean"" goto doAnt
if ""%ACTION%"" == ""distclean"" goto doAnt
if ""%ACTION%"" == ""run"" goto doRun
goto usage
:doRun
set CLASSPATH="%GRIDWORKS_BUILD_DIR%\classes;%GRIDWORKS_LIB_DIR%\*"
echo %OPTS%
"%JAVA_HOME%\bin\java.exe" -cp %CLASSPATH% %OPTS% -Djava.library.path=lib/native/windows com.metaweb.gridworks.Gridworks
goto end