fixed distros

git-svn-id: http://google-refine.googlecode.com/svn/trunk@921 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Stefano Mazzocchi 2010-05-31 07:06:55 +00:00
parent fc2a044767
commit 674eaf9efd
4 changed files with 36 additions and 26 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
.DS_Store
build/
dist/
server/classes/
main/webapp/WEB-INF/classes/
main/tests/server/classes/

View File

@ -208,14 +208,14 @@
<config
headerType="console"
outfile="${windows.dir}/Gridworks.exe"
jarPath="lib/${fullname}-server.jar"
jarPath="server/lib/${fullname}-server.jar"
dontWrapJar="true"
icon="${graphics.dir}/icon/gridworks.ico">
<classPath mainClass="com.metaweb.gridworks.Gridworks">
<cp>lib/*.jar</cp>
<cp>server/lib/*.jar</cp>
</classPath>
<jre minVersion="1.6.0" jdkPreference="preferJre" initialHeapSize="256" maxHeapSize="1024">
<opt>-Djava.library.path=lib/native/windows -Dgridworks.version=${revision}</opt>
<opt>-Djava.library.path=server/lib/native/windows -Dgridworks.version=${revision}</opt>
</jre>
<versionInfo
fileVersion="${full_version}"
@ -231,13 +231,13 @@
/>
</config>
</launch4j>
<copy file="${build.dir}/${fullname}-server.jar" tofile="${windows.dir}/${fullname}-server.jar"/>
<copy todir="${windows.dir}/lib">
<copy file="${build.dir}/${fullname}-server.jar" tofile="${windows.dir}/server/lib/${fullname}-server.jar"/>
<copy todir="${windows.dir}/server/lib">
<fileset dir="${server.lib.dir}">
<include name="**/*.jar"/>
</fileset>
</copy>
<copy todir="${windows.dir}/lib/native/windows">
<copy todir="${windows.dir}/server/lib/native/windows">
<fileset dir="${server.lib.dir}/native/windows">
<include name="*.dll"/>
</fileset>
@ -257,6 +257,7 @@
<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}/gridworks.ini" tofile="${windows.dir}/gridworks.ini"/>
<copy file="${basedir}/README.txt" tofile="${windows.dir}/README.txt"/>
<copy file="${basedir}/LICENSE.txt" tofile="${windows.dir}/LICENSE.txt"/>
@ -274,7 +275,7 @@
<copy file="${build.dir}/${fullname}-server.jar" tofile="${linux.dir}/server/lib/${fullname}-server.jar"/>
<copy todir="${linux.dir}/main/webapp">
<copy todir="${linux.dir}/webapp">
<fileset dir="${built.webapp.dir}">
<include name="**"/>
</fileset>

View File

@ -140,14 +140,9 @@ set GRIDWORKS_HOST=127.0.0.1
:gotHOST
set OPTS=%OPTS% -Dgridworks.host=%GRIDWORKS_HOST%
if not "%GRIDWORKS_WEBAPP%" == "" goto gotHost
set GRIDWORKS_WEBAPP=main\webapp
:gotHOST
set OPTS=%OPTS% -Dgridworks.webapp=%GRIDWORKS_WEBAPP%
if not "%GRIDWORKS_BUILD_DIR%" == "" goto gotBuildDir
set GRIDWORKS_BUILD_DIR=server\build
:gotBuildDir
if not "%GRIDWORKS_CLASSES_DIR%" == "" goto gotClassesDir
set GRIDWORKS_CLASSES_DIR=server\classes
:gotClassesDir
if not "%GRIDWORKS_LIB_DIR%" == "" goto gotLibDir
set GRIDWORKS_LIB_DIR=server\lib
@ -163,7 +158,7 @@ if ""%ACTION%"" == ""distclean"" goto doAnt
if ""%ACTION%"" == ""run"" goto doRun
:doRun
set CLASSPATH="%GRIDWORKS_BUILD_DIR%\classes;%GRIDWORKS_LIB_DIR%\*"
set CLASSPATH="%GRIDWORKS_CLASSES_DIR%;%GRIDWORKS_LIB_DIR%\*"
"%JAVA_HOME%\bin\java.exe" -cp %CLASSPATH% %OPTS% -Djava.library.path=%GRIDWORKS_LIB_DIR%/native/windows com.metaweb.gridworks.Gridworks
goto end
@ -180,7 +175,7 @@ echo.
echo http://bit.ly/1c2gkR
echo.
:gotAntHome
"%ANT_HOME%\bin\ant.bat" -f build.xml -Dbuild.dir="%GRIDWORKS_BUILD_DIR%" %ACTION%
"%ANT_HOME%\bin\ant.bat" -f build.xml %ACTION%
goto end
:end

View File

@ -132,17 +132,23 @@ class GridworksServer extends Server {
connector.setStatsOn(false);
this.addConnector(connector);
final File contextRoot = new File(Configurations.get("gridworks.webapp","webapp"));
final String contextPath = Configurations.get("gridworks.context_path","/");
File webapp = new File(Configurations.get("gridworks.webapp","main/webapp"));
File webXml = new File(contextRoot, "WEB-INF/web.xml");
if (!webXml.isFile()) {
logger.warn("Warning: Failed to find web application. Could not find 'web.xml' at '" + webXml.getAbsolutePath() + "'");
System.exit(-1);
if (!isWebapp(webapp)) {
webapp = new File("main/webapp");
if (!isWebapp(webapp)) {
webapp = new File("webapp");
if (!isWebapp(webapp)) {
logger.warn("Warning: Failed to find web application at '" + webapp.getAbsolutePath() + "'");
System.exit(-1);
}
}
}
logger.info("Initializing context: '" + contextPath + "' from '" + contextRoot.getAbsolutePath() + "'");
WebAppContext context = new WebAppContext(contextRoot.getAbsolutePath(), contextPath);
final String contextPath = Configurations.get("gridworks.context_path","/");
logger.info("Initializing context: '" + contextPath + "' from '" + webapp.getAbsolutePath() + "'");
WebAppContext context = new WebAppContext(webapp.getAbsolutePath(), contextPath);
context.setMaxFormContentSize(1048576);
//context.setCopyWebDir(false);
//context.setDefaultsDescriptor(null);
@ -153,7 +159,7 @@ class GridworksServer extends Server {
// Enable context autoreloading
if (Configurations.getBoolean("gridworks.autoreloading",false)) {
scanForUpdates(contextRoot, context);
scanForUpdates(webapp, context);
}
// start the server
@ -180,6 +186,13 @@ class GridworksServer extends Server {
}
}
static private boolean isWebapp(File dir) {
if (dir == null) return false;
if (!dir.exists() || !dir.canRead()) return false;
File webXml = new File(dir, "WEB-INF/web.xml");
return webXml.exists() && webXml.canRead();
}
static private void scanForUpdates(final File contextRoot, final WebAppContext context) {
List<File> scanList = new ArrayList<File>();