fixed distros
git-svn-id: http://google-refine.googlecode.com/svn/trunk@921 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
fc2a044767
commit
674eaf9efd
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
build/
|
build/
|
||||||
|
dist/
|
||||||
server/classes/
|
server/classes/
|
||||||
main/webapp/WEB-INF/classes/
|
main/webapp/WEB-INF/classes/
|
||||||
main/tests/server/classes/
|
main/tests/server/classes/
|
||||||
|
15
build.xml
15
build.xml
@ -208,14 +208,14 @@
|
|||||||
<config
|
<config
|
||||||
headerType="console"
|
headerType="console"
|
||||||
outfile="${windows.dir}/Gridworks.exe"
|
outfile="${windows.dir}/Gridworks.exe"
|
||||||
jarPath="lib/${fullname}-server.jar"
|
jarPath="server/lib/${fullname}-server.jar"
|
||||||
dontWrapJar="true"
|
dontWrapJar="true"
|
||||||
icon="${graphics.dir}/icon/gridworks.ico">
|
icon="${graphics.dir}/icon/gridworks.ico">
|
||||||
<classPath mainClass="com.metaweb.gridworks.Gridworks">
|
<classPath mainClass="com.metaweb.gridworks.Gridworks">
|
||||||
<cp>lib/*.jar</cp>
|
<cp>server/lib/*.jar</cp>
|
||||||
</classPath>
|
</classPath>
|
||||||
<jre minVersion="1.6.0" jdkPreference="preferJre" initialHeapSize="256" maxHeapSize="1024">
|
<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>
|
</jre>
|
||||||
<versionInfo
|
<versionInfo
|
||||||
fileVersion="${full_version}"
|
fileVersion="${full_version}"
|
||||||
@ -231,13 +231,13 @@
|
|||||||
/>
|
/>
|
||||||
</config>
|
</config>
|
||||||
</launch4j>
|
</launch4j>
|
||||||
<copy file="${build.dir}/${fullname}-server.jar" tofile="${windows.dir}/${fullname}-server.jar"/>
|
<copy file="${build.dir}/${fullname}-server.jar" tofile="${windows.dir}/server/lib/${fullname}-server.jar"/>
|
||||||
<copy todir="${windows.dir}/lib">
|
<copy todir="${windows.dir}/server/lib">
|
||||||
<fileset dir="${server.lib.dir}">
|
<fileset dir="${server.lib.dir}">
|
||||||
<include name="**/*.jar"/>
|
<include name="**/*.jar"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
<copy todir="${windows.dir}/lib/native/windows">
|
<copy todir="${windows.dir}/server/lib/native/windows">
|
||||||
<fileset dir="${server.lib.dir}/native/windows">
|
<fileset dir="${server.lib.dir}/native/windows">
|
||||||
<include name="*.dll"/>
|
<include name="*.dll"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
@ -257,6 +257,7 @@
|
|||||||
|
|
||||||
<copy file="${conf.dir}/gridworks.l4j.ini" tofile="${windows.dir}/gridworks.l4j.ini"/>
|
<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.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}/README.txt" tofile="${windows.dir}/README.txt"/>
|
||||||
<copy file="${basedir}/LICENSE.txt" tofile="${windows.dir}/LICENSE.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 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}">
|
<fileset dir="${built.webapp.dir}">
|
||||||
<include name="**"/>
|
<include name="**"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
|
@ -140,14 +140,9 @@ set GRIDWORKS_HOST=127.0.0.1
|
|||||||
:gotHOST
|
:gotHOST
|
||||||
set OPTS=%OPTS% -Dgridworks.host=%GRIDWORKS_HOST%
|
set OPTS=%OPTS% -Dgridworks.host=%GRIDWORKS_HOST%
|
||||||
|
|
||||||
if not "%GRIDWORKS_WEBAPP%" == "" goto gotHost
|
if not "%GRIDWORKS_CLASSES_DIR%" == "" goto gotClassesDir
|
||||||
set GRIDWORKS_WEBAPP=main\webapp
|
set GRIDWORKS_CLASSES_DIR=server\classes
|
||||||
:gotHOST
|
:gotClassesDir
|
||||||
set OPTS=%OPTS% -Dgridworks.webapp=%GRIDWORKS_WEBAPP%
|
|
||||||
|
|
||||||
if not "%GRIDWORKS_BUILD_DIR%" == "" goto gotBuildDir
|
|
||||||
set GRIDWORKS_BUILD_DIR=server\build
|
|
||||||
:gotBuildDir
|
|
||||||
|
|
||||||
if not "%GRIDWORKS_LIB_DIR%" == "" goto gotLibDir
|
if not "%GRIDWORKS_LIB_DIR%" == "" goto gotLibDir
|
||||||
set GRIDWORKS_LIB_DIR=server\lib
|
set GRIDWORKS_LIB_DIR=server\lib
|
||||||
@ -163,7 +158,7 @@ if ""%ACTION%"" == ""distclean"" goto doAnt
|
|||||||
if ""%ACTION%"" == ""run"" goto doRun
|
if ""%ACTION%"" == ""run"" goto doRun
|
||||||
|
|
||||||
: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
|
"%JAVA_HOME%\bin\java.exe" -cp %CLASSPATH% %OPTS% -Djava.library.path=%GRIDWORKS_LIB_DIR%/native/windows com.metaweb.gridworks.Gridworks
|
||||||
goto end
|
goto end
|
||||||
|
|
||||||
@ -180,7 +175,7 @@ echo.
|
|||||||
echo http://bit.ly/1c2gkR
|
echo http://bit.ly/1c2gkR
|
||||||
echo.
|
echo.
|
||||||
:gotAntHome
|
: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
|
goto end
|
||||||
|
|
||||||
:end
|
:end
|
||||||
|
@ -132,17 +132,23 @@ class GridworksServer extends Server {
|
|||||||
connector.setStatsOn(false);
|
connector.setStatsOn(false);
|
||||||
this.addConnector(connector);
|
this.addConnector(connector);
|
||||||
|
|
||||||
final File contextRoot = new File(Configurations.get("gridworks.webapp","webapp"));
|
File webapp = new File(Configurations.get("gridworks.webapp","main/webapp"));
|
||||||
final String contextPath = Configurations.get("gridworks.context_path","/");
|
|
||||||
|
|
||||||
File webXml = new File(contextRoot, "WEB-INF/web.xml");
|
if (!isWebapp(webapp)) {
|
||||||
if (!webXml.isFile()) {
|
webapp = new File("main/webapp");
|
||||||
logger.warn("Warning: Failed to find web application. Could not find 'web.xml' at '" + webXml.getAbsolutePath() + "'");
|
if (!isWebapp(webapp)) {
|
||||||
|
webapp = new File("webapp");
|
||||||
|
if (!isWebapp(webapp)) {
|
||||||
|
logger.warn("Warning: Failed to find web application at '" + webapp.getAbsolutePath() + "'");
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
logger.info("Initializing context: '" + contextPath + "' from '" + contextRoot.getAbsolutePath() + "'");
|
final String contextPath = Configurations.get("gridworks.context_path","/");
|
||||||
WebAppContext context = new WebAppContext(contextRoot.getAbsolutePath(), contextPath);
|
|
||||||
|
logger.info("Initializing context: '" + contextPath + "' from '" + webapp.getAbsolutePath() + "'");
|
||||||
|
WebAppContext context = new WebAppContext(webapp.getAbsolutePath(), contextPath);
|
||||||
context.setMaxFormContentSize(1048576);
|
context.setMaxFormContentSize(1048576);
|
||||||
//context.setCopyWebDir(false);
|
//context.setCopyWebDir(false);
|
||||||
//context.setDefaultsDescriptor(null);
|
//context.setDefaultsDescriptor(null);
|
||||||
@ -153,7 +159,7 @@ class GridworksServer extends Server {
|
|||||||
|
|
||||||
// Enable context autoreloading
|
// Enable context autoreloading
|
||||||
if (Configurations.getBoolean("gridworks.autoreloading",false)) {
|
if (Configurations.getBoolean("gridworks.autoreloading",false)) {
|
||||||
scanForUpdates(contextRoot, context);
|
scanForUpdates(webapp, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// start the server
|
// 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) {
|
static private void scanForUpdates(final File contextRoot, final WebAppContext context) {
|
||||||
List<File> scanList = new ArrayList<File>();
|
List<File> scanList = new ArrayList<File>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user