Building package.xml for Continuous Integration Or Ant Deployment

I am in the process of setting up version control and automated builds using Git and ANT and eventually we might setup Jenkins for continuous integration.

My plan is to utilize Git branches by developers for each feature development and test it in their own sandbox and merge it back to Master branch and from there, we would use ANT for deploying to other environments.

However one question that stuck me is, How to build package.xml? One developer might have modified just an Apex class and other might have modfied a just a visualforce page. Should I manually build the package.xml? I think manual approach is tedious and error prone. I have been reading through several articles on this topic and somebody suggested using a script to generate paackage.xml based on modified files. Not sure that is a good idea. Anyway I wanted to get your thoghts on this.

Would really appreciate your feedback and Thanks.

Answer

If you are using jenkins you can write a Shell script .

The below is starter blog that i have found success with Jenkins multiple times when setting the flow for the client .

http://kevinbromer.com/2013/03/dynamically-building-package-xml/

If you have cummulus set up with your git flow you can use below from salesforce foundation

https://github.com/SalesforceFoundation/CumulusCI

Also you can also use ANT as highlighted in the below article

http://www.jitendrazaa.com/blog/salesforce/auto-generate-package-xml-using-ant-complete-source-code-and-video/

Attribution
Source : Link , Question Author : sdondeti , Answer Author : Mohith Shrivastava

Leave a Comment