Ant tasks that encapsulate the Salesforce DX 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.sfdx" resource="com/mcartoixa/ant/sfdx/antlib.xml" classpath="ant-sfdx.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:sfdx="com.mcartoixa.ant.sfdx"> <target name="-init-tasks-sfdx"> <taskdef uri="com.mcartoixa.ant.sfdx" resource="com/mcartoixa/ant/sfdx/antlib.xml" classpath="ant-sfdx.jar:json.jar" /> </target> <target name="build" depends="-init-tasks-sfdx"> <sfdx:force-org-create targetdevhubusername="HubOrg" defaultusername="true" definitionfile="config/project-scratch-def.json" alias="ciorg" wait="2" /> <sfdx:force-source-push targetusername="ciorg" /> <sfdx:force-apex-test-run targetusername="ciorg" wait="10" /> <sfdx:force-org-delete targetusername="ciorg" /> </target> </project>
All these tasks share a common set of attributes that can be used to alter their behavior.
Version: 0.0.0-master