Ant tasks that encapsulate the Salesforce CLI.
You simply have to make the tasks (and their dependencies) available to your build and you are ready to go:
<taskdef uri="com.mcartoixa.ant.sf" resource="com/mcartoixa/ant/sf/antlib.xml" classpath="ant-sf.jar:json.jar" />
Note that for a better handling of dependencies the use of a dependency manager like Apache Ivy is highly recommended.
<project name="example" default="build" xmlns:sf="com.mcartoixa.ant.sf"> <target name="-init-tasks-sf"> <taskdef uri="com.mcartoixa.ant.sf" resource="com/mcartoixa/ant/sf/antlib.xml" classpath="ant-sf.jar:json.jar" /> </target> <target name="build" depends="-init-tasks-sf"> <sf:org-create-scratch targetdevhubusername="HubOrg" defaultusername="true" definitionfile="config/project-scratch-def.json" alias="ciorg" wait="2" /> <sf:project-deploy-start targetorg="ciorg" /> <sf:apex-run-test targetorg="ciorg" wait="10" /> <sf:force-org-delete targetusername="ciorg" /> </target> </project>
All these tasks share a common set of attributes that can be used to alter their behavior.
Deprecated sfdx tasks are still available.
Version: 0.0.0-master