다음과 같은 작은 개미 파일 / 대상으로 고생하고 있습니다.
<project name="test" default="test" basedir=".">
<property name="out.dir" value="${basedir}/out/"/>
<property name="apidoc.path" value="${out.dir}test.zip"/>
<property name="apidoc.input" value="${basedir}/../source//apidocs"/>
<property name="apidoc.sha" value="TODO"/>
<target name="test">
<echo message="Starting target APIDOC"/>
<zip destfile="${apidoc.path}" basedir="${apidoc.input}" update="no"/>
<echo message="${apidoc.path}"/>
<checksum file="${apidoc.path}" algorithm="SHA-256" property="apidoc.sha"/>
<echo message="Hash wert ist ${apidoc.sha}"/>
</target>
</project>
대상은 doc 폴더에서 zip 파일을 생성 한 다음 (그렇습니다) zip 파일의 해시 값을 추가 사용을 위해 속성에 저장해야합니다. 그러나 해시 값은 속성에 저장되지 않습니다. 다음과 같이 출력을 얻습니다.
test:
[echo] Starting target APIDOC
[echo] /Users/user1/git/project/out/test.zip
[echo] Hash wert ist TODO
BUILD SUCCESSFUL
아무도 여기에 무엇이 잘못되고 생각하고 있습니까?
Ant의 속성은 변경할 수 없습니다. 이 라인
<property name="apidoc.sha" value="TODO"/>
값을 설정하고 그 후에는 변경할 수 없습니다.
-v
명령 줄 옵션으로 ant를 실행하면 다음 과 같은 메시지가 표시됩니다.
Override ignored for property "apidoc.sha"
<checksum>
작업 의 속성 값을 변경하려는 시도 가 무시되고 있음을 나타냅니다 .
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다