summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2004-02-02 13:01:45 +0000
committerburaq <buraq@epfl.ch>2004-02-02 13:01:45 +0000
commite6ad5066a8e81c9a75abbcb009141da264b1da71 (patch)
tree7ad4c80e52a7a65b95ba8cb2c916238b1f215821
parent8f71bdfa4e204b730c595b9fffd3fc380a6c9e24 (diff)
downloadscala-e6ad5066a8e81c9a75abbcb009141da264b1da71.tar.gz
scala-e6ad5066a8e81c9a75abbcb009141da264b1da71.tar.bz2
scala-e6ad5066a8e81c9a75abbcb009141da264b1da71.zip
teset whether fjbg is in classpath
-rw-r--r--sources/scala/tools/scala4ant/AntTask.scala26
1 files changed, 18 insertions, 8 deletions
diff --git a/sources/scala/tools/scala4ant/AntTask.scala b/sources/scala/tools/scala4ant/AntTask.scala
index 45808a0eef..11381176c7 100644
--- a/sources/scala/tools/scala4ant/AntTask.scala
+++ b/sources/scala/tools/scala4ant/AntTask.scala
@@ -13,6 +13,8 @@ import java.util._;
* adapted from package jaco.framework.ant.AntCompilerTask
* (part of Matthias Zenger's jaco framework)
*
+ * @todo deduce path to scala sources using path to tools.jar (brittle)
+ *
* @author Burak Emir
* @version 1.5
* $Id$
@@ -27,14 +29,22 @@ class AntTask extends Javac {
private val fileUtils:FileUtils = FileUtils.newFileUtils();
override def execute():unit = {
- val project = getProject();
- //val old = project.getProperty("build.compiler");
- project.setProperty("build.compiler", "scala.tools.scala4ant.AntAdaptor$class");
- super.execute();
- //if (old == null)
- // project.setProperty("build.compiler", "modern");
- //else
- // project.setProperty("build.compiler", old);
+ try{
+ Class.forName("ch.epfl.lamp.fjbg.JFieldOrMethod"); // simple check
+
+ val project = getProject();
+ //val old = project.getProperty("build.compiler");
+ project.setProperty("build.compiler", "scala.tools.scala4ant.AntAdaptor$class");
+ super.execute();
+ //if (old == null)
+ // project.setProperty("build.compiler", "modern");
+ //else
+ // project.setProperty("build.compiler", old);
+ } catch {
+ case e:ClassNotFoundException =>
+ throw new BuildException("Cannot run scala4ant. It seems fjbg.jar is not in your CLASSPATH.");
+ }
+
}
def setForce( fc:boolean ) = {