antを得るためにscala用のantlib.xmlをインストールするにはどうすればよいですか?スカラー用にAntを設定する
現時点では、scalaタスクを含むbuild.xmlファイルにant
を実行すると、次のエラーが発生します。
[taskdef] Could not load definitions from resource scala/tools/ant/antlib.xml. It could not be found.
/scalala/scalala-read-only/scalala/build.xml:36: Problem: failed to create task or type scalac
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
私はscala-2.8.1.final/lib/scala-compiler.jar
をunjarredしているが、私は内容をどこに置くか分かりません。
<!-- Define project CLASSPATH. -->
<path id="project.classpath">
<pathelement location="${build.dir}" />
<fileset dir="${env.SCALA_HOME}/lib/"> <include name="*.jar" /> </fileset>
<fileset dir="${lib.dir}"> <include name="*.jar" /> </fileset>
</path>
<!-- Define scala compiler, scaladoc, etc command -->
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="${env.SCALA_HOME}/lib/scala-compiler.jar" />
<pathelement location="${env.SCALA_HOME}/lib/scala-library.jar" />
</classpath>
</taskdef>
:
次のコードは、build.xmlファイルを持っていることは重要である
<target name="compile" depends="">
<mkdir dir="${build.dir}"/>
<scalac srcdir="${src.dir}" destdir="${build.dir}"
classpathref="project.classpath" force="changed">
<!-- addparams="-Yclosure-elim -optimise" -->
<include name="**/*.scala"/>
</scalac>
</target>
回答:ここで
は、build.xmlのから対応する蟻コードスニペットです
私の問題は、$SCALA_HOME
という環境変数(${env.SCALA_HOME}
)が間違っている(/usr/local/scala-2.8.1.final/
ではなく、1レベルが深すぎる:/usr/local/scala-2.8.1.final/bin/
)、lib
ディレクトリが見つかりませんでした。
おそらく、関連するantコードスニペットを投稿する必要があります。おそらく、build.xmlにscalacのtypedefがありません。 – Raghuram