Revision: 16719
http://sourceforge.net/p/gate/code/16719
Author: ian_roberts
Date: 2013-07-03 14:14:45 +0000 (Wed, 03 Jul 2013)
Log Message:
-----------
ScratchConsole.groovy was in fact valid Java, so renamed and added
dependencies to allow it to be built and run from Ant using javac.
Modified Paths:
--------------
mimir/trunk/mimir-test/build.xml
Added Paths:
-----------
mimir/trunk/mimir-test/src/gate/mimir/test/ScratchConsole.java
Removed Paths:
-------------
mimir/trunk/mimir-test/src/gate/mimir/test/ScratchConsole.groovy
Modified: mimir/trunk/mimir-test/build.xml
===================================================================
--- mimir/trunk/mimir-test/build.xml 2013-07-03 13:23:21 UTC (rev 16718)
+++ mimir/trunk/mimir-test/build.xml 2013-07-03 14:14:45 UTC (rev 16719)
@@ -24,6 +24,8 @@
<ivy:configure file="${build.dir}/ivysettings.xml"/>
<ivy:resolve file="${build.dir}/ivy.xml" log="quiet"/>
<ivy:cachepath pathid="ivylibs"/>
+
+ <ivy:cachepath organisation="org.codehaus.groovy" module="groovy-all"
revision="2.0.8" inline="true" conf="default" pathid="groovylibs"/>
</target>
<property name="helpers.to.test"
@@ -35,6 +37,7 @@
<fileset dir="${core-home}" includes="mimir-core-${app.version}.jar" />
<fileset dir="${client-home}"
includes="mimir-client-${app.version}.jar" />
<path refid="ivylibs" />
+ <path refid="groovylibs" />
</path>
<property name="classes.dir" location="classes" />
@@ -120,4 +123,16 @@
</batchtest>
</junit>
</target>
+
+ <target name="runconsole" depends="compile">
+ <java fork="true" classname="gate.mimir.test.ScratchConsole"
maxmemory="8G">
+ <jvmarg value="-XX:MaxPermSize=512M" />
+ <classpath>
+ <pathelement location="${conf.dir}" />
+ <pathelement location="${classes.dir}" />
+ <path refid="compile.classpath" />
+ </classpath>
+ <arg line="${console.args}" />
+ </java>
+ </target>
</project>
Deleted: mimir/trunk/mimir-test/src/gate/mimir/test/ScratchConsole.groovy
===================================================================
--- mimir/trunk/mimir-test/src/gate/mimir/test/ScratchConsole.groovy
2013-07-03 13:23:21 UTC (rev 16718)
+++ mimir/trunk/mimir-test/src/gate/mimir/test/ScratchConsole.groovy
2013-07-03 14:14:45 UTC (rev 16719)
@@ -1,50 +0,0 @@
-package gate.mimir.test;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-import gate.Gate;
-import gate.mimir.index.IndexException;
-import gate.mimir.search.QueryEngine;
-import gate.mimir.search.query.parser.QueryParser;
-import gate.util.GateException;
-import groovy.ui.Console;
-
-public class ScratchConsole {
- /**
- * @param args
- * @throws GateException
- * @throws MalformedURLException
- * @throws IndexException
- */
- public static void main(String[] args) throws MalformedURLException,
- GateException, IndexException {
- // GATE, Mimir init
- Gate.setGateHome(new File("gate-home"));
- Gate.setUserConfigFile(new File("gate-home/user-gate.xml"));
- Gate.init();
- // load the tokeniser plugin
- Gate.getCreoleRegister().registerDirectories(
- new File("gate-home/plugins/ANNIE-tokeniser").toURI().toURL());
- // load the DB plugin
- Gate.getCreoleRegister().registerDirectories(
- new File("../plugins/db-h2").toURI().toURL());
- // load the measurements plugin
- Gate.getCreoleRegister().registerDirectories(
- new File("../plugins/measurements").toURI().toURL());
- Gate.getCreoleRegister().registerDirectories(
- new File("../plugins/sparql").toURI().toURL());
- QueryEngine qEngine = new QueryEngine(new File(args[0]));
- // Prepare console
- Console console = new Console();
- console.setVariable("qEngine", qEngine);
- console.setVariable("qParser", QueryParser.class);
- console.run();
-// console.getInputArea().setText(
-// "import gate.mimir.search.*\n" +
-// "import gate.mimir.search.score.*\n" +
-// "def qNode = qParser.parse('{Measurement}')\n" +
-// "def qExecutor = qNode.getQueryExecutor(qEngine)\n" +
-// "def qRunner = new RankingQueryRunnerImpl(qExecutor, new
BindingScorer())");
- }
-}
Copied: mimir/trunk/mimir-test/src/gate/mimir/test/ScratchConsole.java (from
rev 16711, mimir/trunk/mimir-test/src/gate/mimir/test/ScratchConsole.groovy)
===================================================================
--- mimir/trunk/mimir-test/src/gate/mimir/test/ScratchConsole.java
(rev 0)
+++ mimir/trunk/mimir-test/src/gate/mimir/test/ScratchConsole.java
2013-07-03 14:14:45 UTC (rev 16719)
@@ -0,0 +1,50 @@
+package gate.mimir.test;
+
+import java.io.File;
+import java.net.MalformedURLException;
+
+import gate.Gate;
+import gate.mimir.index.IndexException;
+import gate.mimir.search.QueryEngine;
+import gate.mimir.search.query.parser.QueryParser;
+import gate.util.GateException;
+import groovy.ui.Console;
+
+public class ScratchConsole {
+ /**
+ * @param args
+ * @throws GateException
+ * @throws MalformedURLException
+ * @throws IndexException
+ */
+ public static void main(String[] args) throws MalformedURLException,
+ GateException, IndexException {
+ // GATE, Mimir init
+ Gate.setGateHome(new File("gate-home"));
+ Gate.setUserConfigFile(new File("gate-home/user-gate.xml"));
+ Gate.init();
+ // load the tokeniser plugin
+ Gate.getCreoleRegister().registerDirectories(
+ new File("gate-home/plugins/ANNIE-tokeniser").toURI().toURL());
+ // load the DB plugin
+ Gate.getCreoleRegister().registerDirectories(
+ new File("../plugins/db-h2").toURI().toURL());
+ // load the measurements plugin
+ Gate.getCreoleRegister().registerDirectories(
+ new File("../plugins/measurements").toURI().toURL());
+ Gate.getCreoleRegister().registerDirectories(
+ new File("../plugins/sparql").toURI().toURL());
+ QueryEngine qEngine = new QueryEngine(new File(args[0]));
+ // Prepare console
+ Console console = new Console();
+ console.setVariable("qEngine", qEngine);
+ console.setVariable("qParser", QueryParser.class);
+ console.run();
+// console.getInputArea().setText(
+// "import gate.mimir.search.*\n" +
+// "import gate.mimir.search.score.*\n" +
+// "def qNode = qParser.parse('{Measurement}')\n" +
+// "def qExecutor = qNode.getQueryExecutor(qEngine)\n" +
+// "def qRunner = new RankingQueryRunnerImpl(qExecutor, new
BindingScorer())");
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs