forked from Los-Angeles-Salesforce-Developer-Group/DUGforce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
78 lines (64 loc) · 3.13 KB
/
build.xml
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
<project name="DUGforce" default="usage" basedir="." xmlns:sf="antlib:com.salesforce" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:ml="org.missinglink.ant.task.http.HttpClientTask">
<!-- Download from https://code.google.com/p/missing-link/ -->
<!-- Commenting out to get Travis build working
<taskdef name="http" uri="org.missinglink.ant.task.http.HttpClientTask" classname="org.missinglink.ant.task.http.HttpClientTask" classpath="lib/ml-ant-http-1.1.3/ml-ant-http-1.1.3.jar" />
-->
<!-- sf.username and sf.password should be set in build.properties -->
<!-- This file is not included in the repo, create it if it does not exist -->
<!--
Sample build.properties:
sf.password=SuzieQ123securitytokenabcdef
-->
<property file="build.properties" />
<property file="local.build.properties" />
<property environment="env" />
<!--
! Commenting this out because it chokes "BUILD FAILED"
! build.xml:21: taskdef class org.apache.ivy.ant.IvyRetrieve cannot be found
! using the classloader AntClassLoader[]
!-->
<!--<taskdef name="ivy-retrieve" classname="org.apache.ivy.ant.IvyRetrieve"/>-->
<target name="usage">
<exec executable="ant">
<arg value="-p" />
</exec>
</target>
<target name="deployWithUnitTests" depends="buildResources" description="Deploys code to org and runs all Apex unit tests">
<sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" deployRoot="src" rollbackOnError="true" runAllTests="true" />
</target>
<target name="deploy" description="Deploys code to org">
<sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" deployRoot="src" rollbackOnError="true" />
</target>
<!-- Shows check only; never actually saves to the server -->
<target name="deployCodeCheckOnly" depends="buildResources" description="Check to see if deploy would succeed">
<sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" deployRoot="src" checkOnly="true"/>
</target>
<target name="buildResources" description="Compresses all dirs in resources/ folder saving to src/staticResources">
<!--
<echo>$${user.dir}=${user.dir}</echo>
<echo>$${basedir}=${basedir}</echo>
<echo>dirset dir=resources/</echo>
-->
<subant genericantfile="build.xml" target="buildArchive">
<dirset dir="resources/" includes="*" />
</subant>
<echo>$${basedir}=${basedir}</echo>
</target>
<target name="buildArchive">
<!--
<echo>$${user.dir}=${user.dir}</echo>
<echo>$${basedir}=${basedir}</echo>
<echo level="warning">Overwriting: ${basedir}.resource</echo>
-->
<delete file="${basedir}.resource" failonerror="false" />
<zip destfile="${basedir}.resource">
<fileset dir="${basedir}" includes="**" />
</zip>
<copy file="${basedir}.resource" todir="${user.dir}/src/staticresources" />
<!--
<echo>file="${basedir}.resource"</echo>
<echo>todir="${user.dir}/src/staticresources"</echo>
-->
</target>
</project>