0

I'm developing a custom Joomla component for J3.X, and it's getting a bit tedious to keep on updating the com_mycomponent.xml file with a list of files and folders included in the component.

I've tried to use Apache Ant to autogenerate a manifest file, however it's quite tricky to get it to generate the list of files and folders in the format that Joomla requires - I'm currently using something along the lines of:

<fileset id="site" dir="./admin"/>

<pathconvert pathsep="&lt;/filename&gt;${line.separator}&lt;filename&gt;" property="siteFiles" refid="site">
</pathconvert>

<echo file="./test.xml" append="true">${siteFiles}</echo>

but the paths aren't quite right, and I still need to differentiate between files and folders.

Ant is one approach - you can see one user's attempts on this Wiki page - but alas it doesn't quite generate a full manifest and the author seems to be stuck at the same stage as I. What is the recommended method for automating this process? If Ant, what script do you use, and if not, what tools do you use?

2 Answers 2

3

This was my pain when I started coding components, then I stopped being so fussy about the files. Typically in a component the files in the root dont change, just the contents of the views, models etc.. so my typical manifest looks like this

<files folder="site">
    <folder>controllers</folder>
    <folder>css</folder>
    <folder>files</folder>
    <folder>images</folder>
    <folder>mobile</folder>
    <folder>models</folder>
    <folder>views</folder>
    <filename>controller.php</filename>
    <filename>index.html</filename>
    <filename>router.php</filename>
    <filename>rtannounce.php</filename>
</files>

so the only files I need worry about ar the handful ion the root. This works just as well for the admin files. Not quite the answer you were seeking I suppose, but why make life complicated!

3
  • I do it the same. The difference between the folder and the filename tags is that Joomla will track the files when filename is used. That means it will also delete files no longer used. For files within a folder, Joomla doesn't care what is no longer needed and you would have to manually delete those. But it's worth this little drawback :-)
    – Bakual
    Commented Jul 20, 2014 at 14:02
  • Very Good point! To be fair, I generally don't find I have to do any deletions unless I am actually deleting an entire table and associated files and major alterations like that for me would mean a component is actually uninstalled and reinstalled with preserved SQL if needed.
    – MOLEDesign
    Commented Jul 20, 2014 at 14:05
  • This is a valid point, will keep in mind. Commented Jul 22, 2014 at 7:37
2

phing is used in similar way: http://docs.joomla.org/Setting_up_your_workstation_for_extension_development_(build_with_Phing)#More_Phing_Examples

grunt is popular at this time, but I've never implemented it.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.