PhoneGap Build Config.xml Generator ColdFusion Builder Extension
This is a post that I started writing in October 2012 (around the time when this project was officially released into the great wide open), but alas it's taken me this long to complete it. Yes, I've been busy.
I build PhoneGap applications - I love it, and have even written a book on it (blatant plug). My main IDE is ColdFusion Builder. It does everything I need, and as it's based on Eclipse I can easily update and extend it with plugins for any extra functionality.
One of the beautiful features of ColdFusion Builder is the ability to create your own plugins written in ColdFusion, running locally on the server. Magic stuff.
As a PhoneGap developer and a heavy user of the PhoneGap Build service, I wanted to streamline my workflow a little. The PG Build service needs a config.xml file included in the code to provide application details (version number, name etc) as well as icon and splash screen image references (and much more). XML is great, but writing and managing a number of config.xml files had the potential to become cumbersome and prone to errors.
To remedy this, I built a ColdFusion Builder extension that allows me (and YOU!) to easily generate a config.xml file to use in your PhoneGap Build project.
You can download the extension from phonegapbuild.riaforge.org, and install it into ColdFusion Builder as you would with any extension.
Once installed, you will have a new option in the context-menu when you right-click on a project / directory in the navigator view panel. This will ultimately generate the config.xml file into the directory you have selected, so make sure you click on the root folder for your PhoneGap application:
Select the option to "Generate Config.xml", which will load up the generation wizard in an overlay window:
As you can see, there are a lot of options in the left-hand menu, all of which relate specifically to configuration values that you can set into the .xml file.
There are a few values that are required for the build service to accept and read the file properly. Any required fields will quickly display user-friendly messages if they have left blank after focus. If you attempt to save the file without any of these required fields, it will also prompt you to complete them. Each option also has a help hint to the right, which will display a (hopefully) helpful message to the user to explain what it is:
Working with icons and splash images is also incredibly easy. The extension has a separate tab for each platform, which each available image size for reference. Simply select to upload an image into that particular image "slot", and it will upload it to the project directory. When it does so, it will also rename each image file with a specific file name for that operating system / mobile platform, and it will separate the images into platform directories for ease of use:
One of the features available is the ability to specify access to specific domains and subdomains, or allow global access to external resources. The extension really helps to simplify this. By default all external access is restricted:
Change the option to "false" and a pop-up window will display to let you specify your access rules:
Once added, they will be visible to delete if required. You can now add as many access permissions as you need to:
Once you have finished defining the values in the wizard, click the rather large but friendly "Save File" button, which will generate the populated config.xml file for you in the location of the directory originally selected to open the wizard:
ColdFusion Builder will also automatically open the freshly-created file for you in the editor:
You may want to edit an existing configuration file that you have generated. That's easy to do using this extension. Simply select the "Generate Config.xml" menu option once more. The extension will first determine if an .xml file already exists in that location. If it does, it will give you the option to load that file, which will populate all of the wizard values and options from the file. Make your changes and save the file to update the values. Simple.
At the moment the extension is missing the ability to select which (if any) of the available plugins offered through PhoneGap Build you can use in your project. That will be available in a future update.
I use this extension a lot. It saves a lot of time generating required config.xml files for my PhoneGap Build projects, and I hope that it can help you too.