私はいくつかの Ant スクリプトに取り組んでおり、スクリプトで ant-contrib.jar ファイルも使用しています。コードブロックに続く私のantスクリプトの内容は、私の要件に従って機能していません。
<if>
<equals arg1="${require.html}" arg2="1"/>
<then>
<script language="javascript">
<![CDATA[
println("<h3>Selected Project Directory: ${project.dir}</h3>");
println("<h3>Generated reports are at the location ${dir.report}</h3>");
]]>
</script>
</then>
</if>
Ant Script を使用して埋め込み JavaScript で ${project.dir} 変数を使用しようとしています。ここでスクリプトを使用して、html ファイルを生成しようとしています。ただし、ブラウザに表示される出力は次のとおりです。
Selected Project Directory: ${project.dir}
Generated reports are at the location ${dir.report}
期待される出力:
Selected Project Directory: C:\Project
Generated reports are at the location C:\Report