-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
112 lines (93 loc) · 4.15 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
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
109
110
111
112
<?xml version="1.0" encoding="UTF-8"?>
<project name="<Project Name>" default="usage" basedir="compass">
<description>
Build file for <Project Name>.
Content:
1. Compile related tasks
2. Deploy related tasks
3. Clean related tasks
</description>
<!-- ##################################################
How to use:
- set path variables for your local system
- go to the path where this bild.xml file is located
on your computer
- run "ant deploy-preview" or "ant deploy-production"
to deploy files
- run "ant compile-preview" or "compile-production"
if you only want to compile with compass
################################################## -->
<!-- modifie these settings for you computer -->
<property name="compass-exec" value="compass"/>
<property name="stage-preview-path" value="${basedir}\..\build\preview"/>
<property name="stage-production-path" value="${basedir}\..\build\production"/>
<target name="usage" description="Display usage information">
<echo message="Execute 'ant -projecthelp' for build file help." />
<echo message="Execute 'ant -help' for Ant help." />
</target>
<!-- create a white-list of files that should be deployed -->
<fileset id="deployable" dir="${basedir}\..\">
<include name="**/*.html" />
<include name="**/*.htm" />
<include name="**/*.php" />
<include name="**/*.css" />
<include name="**/*.js" />
<include name="**/*.png" />
</fileset>
<!-- ===============================
[Compile] related tasks
================================ -->
<target name="compile" depends="compile-preview" description="set default compile settings" />
<target name="compile-preview" description="compile pretty for dev purposes, i.e. no compression, etc.">
<echo message="compiling with compass ..."/>
<exec executable="${compass-exec}">
<arg line="compile -e development --force" />
</exec>
</target>
<target name="compile-production" description="compile for production purposes, i.e. compressed, etc.">
<echo message="compiling with compass ..."/>
<exec executable="${compass-exec}">
<arg line="compile -e production --force" />
</exec>
</target>
<!-- ===============================
[Deploy] related tasks
================================ -->
<target name="deploy" depends="deploy-preview" description="define default deployment behavior" />
<target name="deploy-production" depends="compile-production" description="deploy files to production">
<delete dir="${stage-production-path}"/>
<mkdir dir="${stage-production-path}"/>
<copy todir="${stage-production-path}">
<fileset refid="deployable" />
</copy>
<antcall target="clear-sass-cache" />
</target>
<target name="deploy-preview" depends="compile-preview" description="deploy files to preview">
<delete dir="${stage-preview-path}" />
<mkdir dir="${stage-preview-path}" />
<copy todir="${stage-preview-path}">
<fileset refid="deployable" />
</copy>
<antcall target="clear-sass-cache" />
</target>
<target name="deploy-preview-compress" depends="compile-production" description="deploy files to preview">
<delete dir="${stage-preview-path}"/>
<mkdir dir="${stage-preview-path}"/>
<copy todir="${stage-preview-path}">
<fileset refid="deployable" />
</copy>
</target>
<!-- ===============================
[Clean] related tasks
================================ -->
<target name="clear" description="delete all deployed files">
<delete dir="${stage-preview-path}"/>
<delete dir="${stage-production-path}"/>
</target>
<target name="clear-sass-cache" description="delete all deployed files">
<echo message="compass clean"/>
<exec executable="${compass-exec}" output="compass-output.txt">
<arg line="clean" />
</exec>
</target>
</project>