- Download ANT from http://ant.apache.org/bindownload.cgi
- Download latest version i.e - apache-ant-1.10.1-bin.zip
- Extract the downloaded zip file somewhere like C:\Users\fgangana\Desktop\apache-ant-1.10.1
- Set the path in system variables -
- ANT_HOME - C:\Users\fgangana\Desktop\apache-ant-1.10.1\bin
- If PATH system variable already exists then add %ANT_HOME% to your path variable, else add new PATH variable and keep this value.
- Path-%ANT_HOME%\bin;%JAVA_HOME%\bin;C:\app\fgangana\product\11.1.0\client_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Sennheiser\SoftphoneSDK\
- Also create a JAVA_HOME environment variable and set the value to the location of your JDK.
- JAVA_HOME-C:\Program Files\Java\jdk1.7.0\bin
- Go to command prompt and type ant -version. If it shows that ‘Apache Ant Version compiled’ then that means we are good to go.
- still we need to dowload one more salesforce jar file-
- https://gs0.salesforce.com/dwnld/SfdcAnt/salesforce_ant_37.0.zip run this url it will download automatically.
- extact and save it to somewhere like C:\Users\fgangana\Downloads\salesforce_ant_37.0\sample
- open command prompt and navigate to salesforce ant file like- C:\salesforce_ant_37.0\sample> ant commands
- Go to build.properties in salesforce_ant_37.0 and open in note pad ++ and enter salesforce credentials(password=password+securitytoken).After that dont change anything
- Open "build.xml" and you could see many commands like -deployUnpackaged,deployCode,retrieveCode,undeployCode,deployCodeCheckOnly,quickDeploy,cancelDeploy etc.
- For ex: if you want to retrieve components from source system run the below query ---
- C:\salesforce_ant_37.0\sample> ant retrieveCode and hit "enter".
- Uder "codepkg" folder need add or updatecomponents in Package.xml.
For reference : https://www.youtube.com/watch?v=IrJ9gPQ1bbk
Package.xml could be -
<?xml version="1.0" encoding="UTF-8"?>
<Package x
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>ApexPage</name>
</types>
<types>
<members>*</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>EmailTemplate</name>
</types>
<types>
<members>*</members>
<name>LiveChatAgentConfig</name>
</types>
<version>31.0</version>
</Package>
No comments:
Post a Comment