diff --git a/src/main/java/coneforest.psylla.tools/coneforest/psylla/tools/ant/Psylla.java b/src/main/java/coneforest.psylla.tools/coneforest/psylla/tools/ant/Psylla.java
index e26d6014..382620af 100644
--- a/src/main/java/coneforest.psylla.tools/coneforest/psylla/tools/ant/Psylla.java
+++ b/src/main/java/coneforest.psylla.tools/coneforest/psylla/tools/ant/Psylla.java
@@ -10,18 +10,33 @@
/**
* The {@code psylla} Ant task.
+*
+*
+* Supported attributes:
+*
+* - {@code eval}
+* - {@code script}
+* - {@code locale}
+* - {@code consoleEncoding}
+* - {@code classPath}
+* - {@code libraryPath}
+* - {@code timeout}
+*
*/
public class Psylla
extends Task
{
@Override
public void execute()
+ throws BuildException
{
final var psyllaArgs=new ArrayList();
if(consoleEncoding!=null)
psyllaArgs.add("--console-encoding="+consoleEncoding);
if(classPath!=null)
psyllaArgs.add("--classpath="+classPath);
+ if(libraryPath!=null)
+ psyllaArgs.add("--librarypath="+libraryPath);
if(locale!=null)
psyllaArgs.add("--locale="+locale);
if(eval!=null)
@@ -37,7 +52,7 @@ public void execute()
{
final var arg=argObject.getValue();
if(arg==null)
- throw new BuildException("\"arg\" element must have \"value\" attribute");
+ throw new BuildException("The \"arg\" element must have the \"value\" attribute");
args[i++]=arg;
};
@@ -45,33 +60,46 @@ public void execute()
{
coneforest.psylla.runtime.Psylla.launch(System.out, System.err, args).join(timeout);
}
- catch(final PsyErrorException e)
+ catch(final PsyErrorException|ProcessingException|FileNotFoundException e)
{
- // TODO
- }
- catch(final ProcessingException e)
- {
- // TODO
- }
- catch(final FileNotFoundException e)
- {
- // TODO
+ throw new BuildException(e);
}
catch(final InterruptedException e)
{
+ // NOP
}
}
+ /**
+ * Set the eval string.
+ *
+ * @param value the eval string.
+ */
public void setEval(final String value)
{
eval=value;
}
+ /**
+ * Set the class path.
+ *
+ * @param value the class path.
+ */
public void setClassPath(final String value)
{
classPath=value;
}
+ /**
+ * Set the library path.
+ *
+ * @param value the library path.
+ */
+ public void setLibraryPath(final String value)
+ {
+ libraryPath=value;
+ }
+
/**
* Set the locale.
*
@@ -92,16 +120,29 @@ public void setConsoleEncoding(final String value)
consoleEncoding=value;
}
+ /**
+ * Set the script.
+ *
+ * @param value the script.
+ */
public void setScript(final File value)
{
script=value;
}
+ /**
+ * Set the timeout.
+ *
+ * @param value the timeout.
+ */
public void setTimeout(final Integer timeout)
{
this.timeout=timeout.intValue();
}
+ /**
+ * Add a command-line argument.
+ */
public Arg createArg()
{
final var arg=new Arg();
@@ -111,7 +152,7 @@ public Arg createArg()
private final ArrayList argList=new ArrayList<>();
- private String eval, classPath, consoleEncoding, locale;
+ private String eval, classPath, libraryPath, consoleEncoding, locale;
private File script;