Answer the question
In order to leave comments, you need to log in
How to generate version or build number in xml file using Phing?
Hello.
I use Phing to build the installation package of the component for Joomla. I would like to make it so that the next version and/or assembly number would be automatically substituted into the <version></version> tag of the component's xml configuration file. Does anyone have an example of such a task?
Answer the question
In order to leave comments, you need to log in
At least I figured out the version:
<target name="copy_admin_configure_files" description="Copying compontent configure files">
<echo message="Copying component configure files" />
<copy file="${joomla_admin_component}/index.html" todir="${package_temporary}" />
<copy file="${joomla_admin_component}/script.php" todir="${package_temporary}" />
<version releasetype="Bugfix" file="${package_root}/mycomponent_version.txt" property="version.number" />
<copy todir="${package_temporary}">
<fileset dir="${joomla_admin_component}">
<include name="mycomponent.xml" />
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="<version>\d+\.\d+\.\d+<\/version>" replace="<version>${version.number}</version>" ignoreCase="true" modifiers="m" />
</replaceregexp>
</filterchain>
</copy>
</target>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question