简体   繁体   English

Scala 2.9.1的错误fsc Ant任务是否有解决方法?

[英]Is there a workaround for Scala 2.9.1's buggy fsc Ant task?

The fsc Ant task provided with Scala 2.9.1 is buggy (issues SI-5174 and SI-5196 ): if the compile fails, everything proceeds as normal. 随Scala 2.9.1提供的fsc Ant任务是错误的(问题SI-5174SI-5196 ):如果编译失败,一切都正常进行。 If the compile succeeds , on the other hand, then an internal compilation error is reported—even though everything was compiled directly. 另一方面,如果编译成功 ,则报告内部编译错误 - 即使所有内容都是直接编译的。 One can, of course, run the task and ignore the error, but it's annoying and becomes more difficult to see when things are correct or not. 当然,人们可以运行任务并忽略错误,但这很烦人,并且在事情正确或不正确时变得更加困难。 This is clearly a known bug, but what I'm wondering is if there are any known workarounds : ways to still use fsc with Scala 2.9 to get the (significant) speed boost that it provides, but not see an error (even if the error still happens behind the scenes). 这显然是一个已知的错误,但我想知道的是,是否有任何已知的解决方法 :仍然使用fsc与Scala 2.9获得它提供的(显着)速度提升的方法,但没有看到错误(即使错误仍然发生在幕后)。 I know that this has been fixed in Scala 2.10, but I'd rather not install that; 我知道这已在Scala 2.10中修复,但我宁愿不安装它; it's not yet a stable release, and my collaborator and I already have Scala 2.9 installed. 它还不是一个稳定版本,我的合作者和我已经安装了Scala 2.9。


Additional information that might be applicable: 可能适用的其他信息:

The error that's reported is 报告的错误是

[fsc] /.../build.xml:48: Compile failed; see the compiler error output for details.
[fsc]   at scala.tools.ant.ScalaTask$class.buildError(ScalaMatchingTask.scala:27)
[fsc]   at scala.tools.ant.ScalaMatchingTask.buildError(ScalaMatchingTask.scala:30)
[fsc]   at scala.tools.ant.FastScalac.execute(FastScalac.scala:107)
[fsc]   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[fsc]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[fsc]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[fsc]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[fsc]   at java.lang.reflect.Method.invoke(Method.java:597)
[fsc]   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[fsc]   at org.apache.tools.ant.Task.perform(Task.java:348)
[fsc]   at org.apache.tools.ant.Target.execute(Target.java:390)
[fsc]   at org.apache.tools.ant.Target.performTasks(Target.java:411)
[fsc]   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[fsc]   at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[fsc]   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[fsc]   at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[fsc]   at org.apache.tools.ant.Main.runBuild(Main.java:809)
[fsc]   at org.apache.tools.ant.Main.startAnt(Main.java:217)
[fsc]   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[fsc]   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

The relevant portions of the build.xml file are: build.xml文件的相关部分是:

<target name="init">
  ...
  <taskdef resource="scala/tools/ant/antlib.xml">
    <classpath>
      <pathelement location="${scala-compiler.jar}" />
      <pathelement location="${scala-library.jar}" />
    </classpath>
  </taskdef>
</target>

...

<target name="compile" depends="init">
  <mkdir dir="${classes.dir}" />
  <fsc srcdir="${source.dir}"
       destdir="${classes.dir}"
       classpathref="build.classpath"
       deprecation="yes"
       unchecked="yes" />
</target>

To be blunt, no, or at least none that I've managed to find. 坦白,不,或至少没有我能找到的。 We ended up moving to Maven (tried SBT but it was too buggy). 我们最终搬到了Maven(尝试了SBT,但它太多了)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM