こんにちは、このコードを見てください
私のプロパティファイルには win-x86.pc-shared-location=E:\Ant_Scripts があります
以下では、test.xml にあるPrintInstallerName_build
ように、build.xmlから呼び出そうとしています。PrintInstallerName_build
build.xml ファイルで${platform.id} has value=win-x86
は、呼び出し元のターゲットと呼び出されたターゲットの param1 にも value=win-x86 があります
<target name="PrintInstallerName" >
<echo>PlatForm.Id====>${platform.id}</echo>
<ant antfile="test.xml" target="PrintInstallerName_build">
<property name="param1" value="${platform.id}"/>
</ant>
<target name="PrintInstallerName_build" >
<echo>${param1.pc-shared-location}</echo><!--${param1.pc-shared-location}-->
<echo>${param1}.pc-shared-location}</echo><!--win-x86.pc-shared-location-->
<echo>${win-x86.pc-shared-location}</echo><!--E:\\Ant_Scripts-->
</target>
あなたが見ることができるように、最後のステートメントだけが正しい出力を与えますが、それはハードコードされてE:\\Ant_Scripts
います。明日は国防総省です。