-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
153 lines (132 loc) · 5.5 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?xml version="1.0"?>
<project name="FaceMovie build script" default="compile" basedir=".">
<taskdef resource="pyAntTasks.properties"/>
<!-- INIT : Initialize properties and classpath -->
<target name="init">
<!-- Properties -->
<property name="old.version" value="0.8"/>
<property name="version" value="0.8.2"/>
<property name="base.dir" value="."/>
<property name="src.dir" value="${base.dir}/facemovie"/>
<property name="haar.dir" value="${base.dir}/haarcascades"/>
<property name="test.dir" value="${base.dir}/test"/>
<property name="doc.dir" location="${base.dir}/doc"/>
<property name="pkg.dir" value="${base.dir}/packaging"/>
<property name="samples.dir" value="data/inputs/samples"/>
<!-- Specialized packaging folders -->
<property name="old.pkg.dir" value="${pkg.dir}/old"/>
<property name="curr.pkg.dir" value="${pkg.dir}/current"/>
<property name="new.pkg.dir" value="${curr.pkg.dir}/${version}"/>
<property name="pipy.pkg.dir" value="${base.dir}/dist/fm_pipy"/>
<!-- Archive files -->
<property name="haar.zip" value="${new.pkg.dir}/haarcascades.zip"/>
<property name="samples.zip" value="${new.pkg.dir}/samples.zip"/>
<property name="exe.zip" value="${new.pkg.dir}/Facemovie-${version}-exe.zip"/>
<!-- Time -->
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd" />
</tstamp>
</target>
<!-- CLEAN : Removes all compiled stuff -->
<target name="clean" depends="init" description="Removes all compiled stuff">
<echo message="Removes build folder"/>
<delete dir="${base.dir}/build"/>
<echo message="Removes dist folder"/>
<delete dir="${base.dir}/dist"/>
<echo message="Removes all compiled Python files"/>
<delete>
<fileset dir="${base.dir}" includes="**/*.pyc"/>
</delete>
<echo message="Removes old doc"/>
<delete includeEmptyDirs="true">
<fileset dir="${doc.dir}/build" includes="**/*"/>
</delete>
<delete file="${base.dir}/README.rst"/>
</target>
<!-- COMPILE : Checks that all Python files compile before packaging -->
<target name="compile" depends="init" >
<py-compile dir="${src.dir}" pythonpath="${src.dir}" optimize="0"/>
<py-compile dir="${test.dir}" pythonpath="${test.dir}" optimize="0"/>
</target>
<!-- DOC : Generates documentation for the project -->
<target name="doc" depends="init,compile">
<exec dir="${base.dir}" executable="sphinx-build">
<arg line="${doc.dir}/source ${doc.dir}/build"/>
</exec>
</target>
<!-- EXE : Generates single Windows executable -->
<target name="exe" depends="init">
<exec dir="${base.dir}" executable="pandoc.exe">
<arg line="${base.dir}/README.markdown -o ${base.dir}/README.rst"/>
</exec>
<py-run script="setup.py" pythonpath="${base.dir}" optimize="0">
<arg value="build"/>
</py-run>
</target>
<!-- PACKAGING -->
<!-- package.clean : Moves old packages into proper folder -->
<target name="package.clean" depends="init">
<move todir="${old.pkg.dir}">
<fileset dir="${curr.pkg.dir}">
<include name="*/*"/>
</fileset>
</move>
<delete includeEmptyDirs="true">
<fileset dir="${curr.pkg.dir}" includes="**/*"/>
</delete>
</target>
<!-- package.create : Creates the new output folder and saves static data in it -->
<target name="package.create" depends="init,clean,compile">
<echo message="Creating output folder"/>
<mkdir dir="${new.pkg.dir}"/>
<echo message="Compressing HaarCascades"/>
<delete file="${haar.zip}"/>
<zip destfile="${haar.zip}" update="true">
<zipfileset dir="${haar.dir}" prefix="haarcascades" excludes="*.py"/>
</zip>
<echo message="Compressing Samples"/>
<delete file="${samples.zip}"/>
<zip destfile="${samples.zip}" update="true">
<zipfileset dir="${samples.dir}" prefix="samples" excludes="*.py"/>
</zip>
<echo message="Compressing Samples"/>
<delete file="${samples.zip}"/>
<zip destfile="${samples.zip}" update="true">
<zipfileset dir="${samples.dir}" prefix="samples" excludes="*.py"/>
</zip>
</target>
<!-- package.win : Creates the application package for Windows -->
<target name="package.win" depends="init,package.create,exe">
<echo message="Creating Windows Executable archive"/>
<delete file="${exe.zip}"/>
<zip destfile="${exe.zip}">
<zipfileset dir="${base.dir}/dist" includes="Facemoviefier.exe"/>
<zipfileset dir="${base.dir}" includes="README.markdown"/>
<zipfileset dir="${haar.dir}" excludes="*.py" prefix="haarcascades"/>
</zip>
</target>
<!-- package.pipy : Creates the application package for Windows -->
<target name="package.pipy" depends="init,package.create">
<echo message="Creating Windows Pipy archive"/>
<py-run script="setup.py" pythonpath="${base.dir}" optimize="0">
<arg value="sdist"/>
</py-run>
<copy file="${base.dir}/dist/Facemovie-${version}.zip" todir="${new.pkg.dir}"/>
</target>
<!-- package.doc : Creates the source documentation package -->
<target name="package.doc" depends="init,package.create,doc">
<echo message="Creating Documentation archive"/>
<zip destfile="${new.pkg.dir}/doc.zip"
basedir="${doc.dir}/build"
update="true"
/>
</target>
<!-- Whole packaging -->
<target name="package" depends="init,package.clean,package.create,package.win,package.pipy,package.doc" description="Performs all packaging">
<echo message="Packaging all information"/>
</target>
<!-- Whole packaging -->
<target name="package_lin" depends="init,package.clean,package.create,package.doc" description="Performs all packaging">
<echo message="Packaging all information"/>
</target>
</project>