Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Deploying Code
You can deploy metadata components and Apex at the same time, but you may find it useful to create separate targets for deploying Apex, so that you can run tests as part of the deployment. A portion of a build.xml file is listed below, with a target named deployCode that deploys the contents of the codepkg package and runs the tests for one class.
1<target name="deployCode">
2 <sf:deploy
3 username="${sf.username}"
4 password="${sf.password}"
5 sessionId="${sf.sessionId}"
6 serverurl="${sf.serverurl}"
7 deployroot="codepkg">
8 <runTest>SampleDeployClass</runTest>
9 </sf:deploy>
10</target>