Repository navigation
Expand file tree
/
Copy pathbuild.xml
More file actions
108 lines (88 loc) · 3.66 KB
/
Copy pathbuild.xml
File metadata and controls
108 lines (88 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?xml version='1.0' encoding='UTF-8'?>
<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="."
xmlns:sf="http://com.salesforce"
>
<property name="antlib" value="lib" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${antlib}/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<taskdef resource="com/salesforce/sforce_ant.properties" uri="http://com.salesforce">
<classpath>
<pathelement location="${antlib}/ant-salesforce.jar" />
</classpath>
</taskdef>
<property file="build.properties"/>
<property environment="env"/>
<condition property="sf.username" value=""> <not> <isset property="sf.username"/> </not> </condition>
<condition property="sf.password" value=""> <not> <isset property="sf.password"/> </not> </condition>
<condition property="sf.sessionId" value=""> <not> <isset property="sf.sessionId"/> </not> </condition>
<description>
Sample project that deploys a demo of the LightningToVisualforce demo
</description>
<target name="makeCredentials" description="Creates Credentials">
<echo><![CDATA[
What is your username?]]></echo>
<input addproperty="username" />
<echo><![CDATA[
What is your password?]]></echo>
<input addproperty="password" />
<echo><![CDATA[
What is your security token?]]></echo>
<input addproperty="token" />
<echo><![CDATA[
What is your domain host?
(ex: test.salesforce.com or login.salesforce.com)]]></echo>
<input addproperty="host" />
<!-- default blanks if someone just hits return -->
<property name="username" value="" />
<property name="password" value="" />
<property name="token" value="" />
<property name="host" value="" />
<echo file="build.properties"><![CDATA[
# Specify the login credentials for the desired Salesforce organization
sf.username=${username}
sf.password=${password}${token}
#sf.sessionId = <Insert your Salesforce session id here. Use this or username/password above. Cannot use both>
#sf.pkgName = <Insert comma separated package names to be retrieved>
#sf.zipFile = <Insert path of the zipfile to be retrieved>
#sf.metadataType = <Insert metadata type name for which listMetadata or bulkRetrieve operations are to be performed>
# Use 'https://login.salesforce.com' for production or developer edition (the default if not specified).
# Use 'https://test.salesforce.com for sandbox.
sf.serverurl=https://${host}
sf.maxPoll=500
# If your network requires an HTTP proxy, see http://ant.apache.org/manual/proxy.html for configuration.
]]></echo>
</target>
<target name="test" description="Tests the Deploy" depends="checkCredentials">
<sf:deploy username="${sf.username}" password="${sf.password}" sessionId="${sf.sessionId}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}"
deployRoot="src/" checkOnly="true" rollbackOnError="true"
/>
</target>
<target name="deploy" description="Performs the deploy" depends="checkCredentials">
<sf:deploy username="${sf.username}" password="${sf.password}" sessionId="${sf.sessionId}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}"
deployRoot="src/" checkOnly="false" rollbackOnError="true"
/>
<echo><![CDATA[
Success.
Please navigate to /apex/TEST_PostMessageParent within your environment to see the demo.]]></echo>
</target>
<!-- internal tasks -->
<target name="checkCredentials">
<if>
<or>
<equals arg1="${sf.username}" arg2="$${sf.username}" />
<equals arg1="${sf.username}" arg2="" />
</or>
<then>
<echo><![CDATA[
Please run:
ant makeCredentials
to continue.
]]></echo>
<fail />
</then>
</if>
</target>
</project>