- build a windows distribution
- update to the latest ant to use in case one is not present locally git-svn-id: http://google-refine.googlecode.com/svn/trunk@85 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
36e609d649
commit
91d0133a76
66
build.xml
66
build.xml
@ -6,7 +6,7 @@
|
||||
|
|
||||
+-->
|
||||
|
||||
<project name="gridworks" default="compile" basedir=".">
|
||||
<project name="gridworks" default="build" basedir=".">
|
||||
|
||||
<property environment="env"/>
|
||||
|
||||
@ -17,31 +17,31 @@
|
||||
<property name="build.dir" value="${basedir}/build" />
|
||||
<property name="classes.dir" value="${build.dir}/classes" />
|
||||
<property name="bundle.dir" value="${build.dir}/bundle" />
|
||||
<property name="exe.dir" value="${build.dir}/exe" />
|
||||
|
||||
<taskdef
|
||||
name="jarbundler"
|
||||
classpath="${tools.dir}/jarbundler-2.1.0.jar"
|
||||
classname="net.sourceforge.jarbundler.JarBundler"
|
||||
/>
|
||||
|
||||
<path id="class.path">
|
||||
<fileset dir="${lib.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<target name="compile">
|
||||
<target name="build">
|
||||
<mkdir dir="${classes.dir}" />
|
||||
<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true">
|
||||
<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true" includeAntRuntime="no">
|
||||
<classpath refid="class.path" />
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="jar" depends="compile">
|
||||
<target name="jar" depends="build">
|
||||
<jar destfile="${build.dir}/gridworks.jar" basedir="${classes.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="bundle" depends="jar">
|
||||
<taskdef
|
||||
name="jarbundler"
|
||||
classname="net.sourceforge.jarbundler.JarBundler"
|
||||
classpath="${tools.dir}/jarbundler-2.1.0.jar"
|
||||
/>
|
||||
<mkdir dir="${bundle.dir}"/>
|
||||
<jarbundler
|
||||
dir="${bundle.dir}"
|
||||
@ -54,7 +54,7 @@
|
||||
workingdirectory="$APP_PACKAGE/Contents/Resources"
|
||||
jvmversion="1.6+"
|
||||
bundleid="com.metaweb.gridworks.Gridworks"
|
||||
vmoptions="-Xms256M -Xmx1024M"
|
||||
vmoptions="${java.options}"
|
||||
antialiasedgraphics="true"
|
||||
antialiasedtext="true"
|
||||
liveresize="true"
|
||||
@ -68,10 +68,52 @@
|
||||
<resourcefileset dir="${basedir}/src/main/">
|
||||
<include name="webapp/**" />
|
||||
</resourcefileset>
|
||||
|
||||
</jarbundler>
|
||||
</target>
|
||||
|
||||
<target name="exe" depends="jar">
|
||||
<mkdir dir="${exe.dir}"/>
|
||||
<taskdef
|
||||
name="launch4j"
|
||||
classname="net.sf.launch4j.ant.Launch4jTask"
|
||||
classpath="${tools.dir}/launch4j/launch4j.jar:${tools.dir}/launch4j/lib/xstream.jar"
|
||||
/>
|
||||
<launch4j>
|
||||
<config
|
||||
headerType="console"
|
||||
outfile="${exe.dir}/Gridworks.exe"
|
||||
jarPath="lib/gridworks-${version}.jar"
|
||||
dontWrapJar="true"
|
||||
icon="${graphics.dir}/icon/gridworks.ico">
|
||||
<classPath mainClass="com.metaweb.gridworks.Gridworks">
|
||||
<cp>${lib.dir}/*.jar</cp>
|
||||
</classPath>
|
||||
<jre minVersion="1.6.0" jdkPreference="preferJre">
|
||||
<opt>${java.version}</opt>
|
||||
</jre>
|
||||
<versionInfo
|
||||
fileVersion="${version}.0.0"
|
||||
txtFileVersion="${version}"
|
||||
fileDescription="gridworks"
|
||||
copyright="Copyright (c) 2010, Metaweb Technologies, Inc."
|
||||
productVersion="${version}.0.0"
|
||||
txtProductVersion="${version}.0.0"
|
||||
productName="Gridworks"
|
||||
companyName="Metaweb Technologies, Inc."
|
||||
internalName="gridworks"
|
||||
originalFilename="gridworks.exe"
|
||||
/>
|
||||
</config>
|
||||
</launch4j>
|
||||
<copy todir="${exe.dir}/lib">
|
||||
<fileset dir="${lib.dir}">
|
||||
<include name="**/*.jar"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy file="${build.dir}/gridworks.jar" tofile="${exe.dir}/lib/gridworks-${version}.jar"/>
|
||||
<zip destfile="${dist.dir}/gridworks-${version}.zip" basedir="${exe.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete file="${build.dir}/gridworks.jar" />
|
||||
<delete dir="${classes.dir}" />
|
||||
|
42
gridworks
42
gridworks
@ -43,6 +43,7 @@ and <action> is one of
|
||||
run ....................... Run Gridworks
|
||||
|
||||
make_dmg <version> ........ Make MacOSX DMG distribution
|
||||
make_exe <version> ........ Make Windows EXE distribution
|
||||
|
||||
clean ..................... Clean compiled classes
|
||||
distclean ................. Remove all generated files
|
||||
@ -74,18 +75,18 @@ ant_prepare() {
|
||||
|
||||
ANT=`which ant`
|
||||
if [ "$ANT" = "" ] ; then
|
||||
ANT_TAR=`ls thirdparty | grep apache-ant`
|
||||
ANT_DIR="$GRIDWORKS_BUILD_DIR/ant"
|
||||
ANT="$ANT_DIR/bin/ant"
|
||||
ANT_TAR=`find thirdparty | grep apache-ant | grep -v svn`
|
||||
ANT_DIR=`echo $ANT_TAR | sed 's/.tar.gz//'`
|
||||
if [ ! -d $ANT_DIR ] ; then
|
||||
tar xzf $ANT_TAR -C $BUILD_DIR || exit 1
|
||||
tar xzf $ANT_TAR -C $GRIDWORKS_BUILD_DIR || exit 1
|
||||
fi
|
||||
ANT="$ANT_DIR/bin/ant"
|
||||
fi
|
||||
}
|
||||
|
||||
ant() {
|
||||
ant_prepare
|
||||
$ANT -f build.xml -Dbuild.dir="$GRIDWORKS_BUILD_DIR" -Ddist.dir="$GRIDWORKS_DIST_DIR" -Dversion="$VERSION" $1 || exit 1
|
||||
$ANT -f build.xml -Dbuild.dir="$GRIDWORKS_BUILD_DIR" -Ddist.dir="$GRIDWORKS_DIST_DIR" -Dversion="$VERSION" -Djava.options="$JAVA_OPTIONS" $1 || exit 1
|
||||
}
|
||||
|
||||
dist_prepare() {
|
||||
@ -93,7 +94,29 @@ dist_prepare() {
|
||||
mkdir $GRIDWORKS_DIST_DIR || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
launch4j_prepare() {
|
||||
LAUNCH4J_TAR=`find thirdparty | grep launch4j | grep -v svn`
|
||||
LAUNCH4J_DIR="thirdparty/launch4j"
|
||||
if [ ! -d "$LAUNCH4J_DIR" ] ; then
|
||||
tar xzf $LAUNCH4J_TAR -C thirdparty || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
make_exe() {
|
||||
check_macosx
|
||||
dist_prepare
|
||||
launch4j_prepare
|
||||
|
||||
VERSION=$1
|
||||
|
||||
if [ "$VERSION" == "" ] ; then
|
||||
fail "Must specify a version number"
|
||||
fi
|
||||
|
||||
ant exe
|
||||
}
|
||||
|
||||
make_dmg() {
|
||||
check_macosx
|
||||
dist_prepare
|
||||
@ -215,7 +238,7 @@ ACTION=$1; shift
|
||||
# ----- Verify and Set Required Environment Variables -------------------------
|
||||
|
||||
if [ "$JAVA_OPTIONS" == "" ] ; then
|
||||
JAVA_OPTIONS="-Xms256M -Xmx1024M -XX:+UseLargePages -XX:+UseConcMarkSweepGC -XX:+UseParallelGC"
|
||||
JAVA_OPTIONS="-Xms256M -Xmx1024M -XX:+UseLargePages -XX:+UseParallelGC"
|
||||
fi
|
||||
add_option "$JAVA_OPTIONS"
|
||||
|
||||
@ -250,7 +273,7 @@ fi
|
||||
|
||||
case "$ACTION" in
|
||||
build)
|
||||
ant compile;;
|
||||
ant build;;
|
||||
|
||||
bundle)
|
||||
ant bundle;;
|
||||
@ -266,6 +289,9 @@ case "$ACTION" in
|
||||
|
||||
make_dmg)
|
||||
make_dmg $1;;
|
||||
|
||||
make_exe)
|
||||
make_exe $1;;
|
||||
|
||||
*)
|
||||
usage; ;;
|
||||
|
@ -37,13 +37,16 @@ echo /x enable JMX monitoring (for jconsole and friends)
|
||||
echo.
|
||||
echo and <action> is one of
|
||||
echo.
|
||||
echo build ..... Build Gridworks
|
||||
echo run ....... Run Gridworks
|
||||
echo build ..................... Build Gridworks
|
||||
echo run ....................... Run Gridworks
|
||||
echo.
|
||||
echo clean ..................... Clean compiled classes
|
||||
echo distclean ................. Remove all generated files
|
||||
echo.
|
||||
goto end
|
||||
|
||||
:fail
|
||||
echo See: '%0 /h' for usage.
|
||||
echo Type 'gridworks /h' for usage.
|
||||
goto end
|
||||
|
||||
:endUtils
|
||||
@ -97,7 +100,7 @@ goto loop
|
||||
rem --- Fold in Environment Vars --------------------------------------------
|
||||
|
||||
if not "%JAVA_OPTIONS%" == "" goto gotJavaOptions
|
||||
set JAVA_OPTIONS=-Xms256M -Xmx1024M
|
||||
set JAVA_OPTIONS=-Xms256M -Xmx1024M -XX:+UseLargePages -XX:+UseParallelGC
|
||||
:gotJavaOptions
|
||||
set OPTS=%OPTS% %JAVA_OPTIONS%
|
||||
|
||||
@ -127,23 +130,21 @@ set GRIDWORKS_LIB_DIR=lib
|
||||
rem ----- Respond to the action ----------------------------------------------------------
|
||||
|
||||
set ACTION=%1
|
||||
|
||||
if not "%ACTION%" == "" goto gotAction
|
||||
set ACTION="run"
|
||||
:gotAction
|
||||
|
||||
if ""%ACTION%"" == ""build"" goto doBuild
|
||||
if ""%ACTION%"" == ""build"" goto doAnt
|
||||
if ""%ACTION%"" == ""clean"" goto doAnt
|
||||
if ""%ACTION%"" == ""distclean"" goto doAnt
|
||||
if ""%ACTION%"" == ""run"" goto doRun
|
||||
|
||||
goto usage
|
||||
|
||||
:doBuild
|
||||
ant -f build.xml compile
|
||||
goto end
|
||||
|
||||
:doRun
|
||||
set CLASSPATH="%GRIDWORKS_BUILD_DIR%\classes;%GRIDWORKS_LIB_DIR%\*"
|
||||
"%JAVA_HOME%\bin\java.exe" -cp %CLASSPATH% %OPTS% com.metaweb.gridworks.Gridworks
|
||||
goto end
|
||||
|
||||
:doAnt
|
||||
ant -f build.xml -Dbuild.dir="%GRIDWORKS_BUILD_DI%" -Ddist.dir="%GRIDWORKS_DIST_DIR%" -Dversion="%VERSION%" %ACTION%
|
||||
goto end
|
||||
|
||||
:end
|
||||
|
BIN
src/graphics/icon/gridworks.ico
Normal file
BIN
src/graphics/icon/gridworks.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
BIN
thirdparty/apache-ant-1.8.0.tar.gz
vendored
Normal file
BIN
thirdparty/apache-ant-1.8.0.tar.gz
vendored
Normal file
Binary file not shown.
BIN
thirdparty/apache-ant-1.8.0RC1-slim.tar.gz
vendored
BIN
thirdparty/apache-ant-1.8.0RC1-slim.tar.gz
vendored
Binary file not shown.
BIN
thirdparty/launch4j-3.0.1-macosx.tar.gz
vendored
Normal file
BIN
thirdparty/launch4j-3.0.1-macosx.tar.gz
vendored
Normal file
Binary file not shown.
BIN
thirdparty/launch4j-3.01.jar
vendored
BIN
thirdparty/launch4j-3.01.jar
vendored
Binary file not shown.
Loading…
Reference in New Issue
Block a user