0
일부 앤트 스크립트에서 작업하고 있으며 내 스크립트에서 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 스크립트가있는 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
작업 : 당신은 점을 포함하기 때문에 당신은 할 수 없어,하지만 당신은 여전히 그들에게이 방법으로 액세스 할 수 있습니다 –