-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
118 lines (105 loc) · 4.34 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="photoViewer">
<property name="src.dir" location="src"/>
<property name="src.assets.dir" location="assets" />
<property name="src.testAssets.dir" location="testAssets" />
<property name="build.dir" location="build"/>
<property name="artifacts.dir" location="artifacts"/>
<property name="docs.dir" location="docs"/>
<property name="build.assets.dir" location="${build.dir}/assets" />
<property name="build.testAssets.dir" location="${build.dir}/testAssets" />
<property name="lib.dir" location="lib"/>
<property name="test.dir" location="src/Tests"/>
<property name="test.report.dir" location="test-reports"/>
<patternset id="ignored.files">
<exclude name="**/CVS/**"/>
<exclude name="**/SCCS/**"/>
<exclude name="**/RCS/**"/>
<exclude name="**/rcs/**"/>
<exclude name="**/.DS_Store/**"/>
<exclude name="**/.svn/**"/>
<exclude name="**/.pyc/**"/>
<exclude name="**/.pyo/**"/>
<exclude name="**/*.pyc/**"/>
<exclude name="**/*.pyo/**"/>
<exclude name="**/.git/**"/>
<exclude name="**/*.hprof/**"/>
<exclude name="**/_svn/**"/>
<exclude name="**/.hg/**"/>
<exclude name="**/*.lib/**"/>
<exclude name="**/*~/**"/>
<exclude name="**/__pycache__/**"/>
<exclude name="**/.bundle/**"/>
<exclude name="**/*.rbc/**"/>
<exclude name="**/vssver.scc/**"/>
<exclude name="**/vssver2.scc/**"/>
<exclude name="**/src/Tests/**"/>
<exclude name="**/${docs.dir}/**"/>
<exclude name="**/${build.dir}/**"/>
<exclude name="**/${test.report.dir}/**"/>
</patternset>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
<pathelement location="${build.dir}"/>
</path>
<target name="init" depends="clean">
<mkdir dir="${build.dir}"/>
<mkdir dir="${docs.dir}"/>
<mkdir dir="${test.report.dir}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src.dir}" destdir="${build.dir}">
<classpath refid="classpath"/>
<patternset refid="ignored.files"/>
</javac>
</target>
<target name="test" depends="compile, copyNonEmbeddedFiles">
<junit printsummary="off" fork="off" haltonfailure="yes">
<formatter type="xml"/>
<classpath refid="classpath"/>
<batchtest todir="${test.report.dir}">
<fileset dir="${src.dir}">
<include name="Tests/**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${test.report.dir}">
<fileset dir="${test.report.dir}"/>
<report todir="${test.report.dir}"/>
</junitreport>
</target>
<target name="docs" depends="compile">
<javadoc packagenames="PhotoViewer" sourcepath="${src.dir}" destdir="${docs.dir}">
<fileset dir="${src.dir}">
<include name="**"/>
</fileset>
<classpath refid="classpath"/>
</javadoc>
</target>
<target name="copyNonEmbeddedFiles" depends="init">
<mkdir dir="${build.assets.dir}" />
<copy todir="${build.assets.dir}" includeemptydirs="false" overwrite="true">
<fileset dir="${src.assets.dir}" />
</copy>
<mkdir dir="${build.testAssets.dir}" />
<copy todir="${build.testAssets.dir}" includeemptydirs="false" overwrite="true">
<fileset dir="${src.testAssets.dir}" />
</copy>
</target>
<target name="dist" depends="compile,copyNonEmbeddedFiles">
<mkdir dir="${artifacts.dir}"/>
<jar jarfile="${artifacts.dir}/photoViewer-SNAPSHOT.jar" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="PhotoViewer.Launcher" />
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${docs.dir}"/>
<delete dir="${test.report.dir}"/>
</target>
<target name="all" depends="clean,init,compile,test,docs,dist">
<description>Runs all targets</description>
</target>
</project>