在下面phing XML中,「skel中」目標裏面我檢查,如果配置了應用程序,如果它不那麼我所說的配置目標,然後將配置應用到幾個文件。目標通過<phingcall>叫不設置屬性在調用目標
的問題是,物業db.host
的phingcall後沒有設置,即使它是在propertyprompt後進行設置。
我錯過了什麼?
<!-- base configuration -->
<property name="paths.config" value="config" />
<property name="paths.config.file" value="${paths.config}/environment.ini" />
<available file="${paths.config.file}" property="configured" />
<target name="configure">
<if>
<equals arg1="${configured}" arg2="true" />
<then>
<echo message="Reconfigure ..." />
</then>
<else>
<echo message="Configure ..." />
</else>
</if>
<propertyprompt propertyName="db.host" defaultValue="localhost" promptText="Mysql Server Host" />
</target>
<target name="skel">
<echo msg="Skel files..." />
<if>
<equals arg1="${configured}" arg2="${configured}" />
<then>
<echo message="Missing config file ..." />
<phingcall target="configure" />
</then>
</if>
<echo message="${db.host}" />
<copy todir="config">
<mapper type="glob" from="*.skel" to="*"/>
<filterchain>
<expandproperties />
</filterchain>
<fileset dir="config">
<include name="*.skel" />
</fileset>
</copy>
</target>