forked from interviewcoder/leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
83 lines (71 loc) · 2.56 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="leetcode">
<description>
Leetcode project of Interview Coder
</description>
<property name="src" location="src" />
<property name="bin" location="bin" />
<property name="test" location="test" />
<property name="lib" location="lib" />
<property name="report" location="report" />
<property name="main-class" value="com.leetcode.Leetcode" />
<path id="classpath">
<fileset dir="${lib}" includes="**/*.jar" />
</path>
<!-- - - - - - - - - - - - - - - - - -
target: init
- - - - - - - - - - - - - - - - - -->
<target name="init">
<mkdir dir="${bin}" />
<mkdir dir="${report}" />
</target>
<!-- =================================
target: clean
================================= -->
<target name="clean" description="Clean uncessary parts">
<delete dir="${bin}" />
<delete dir="${report}" />
</target>
<!-- =================================
target: compile
================================= -->
<target name="compile" depends="clean, init" description="Compile the project">
<javac encoding="UTF-8" includeantruntime="false" srcdir="${src}" destdir="${bin}" classpathref="classpath" />
<javac srcdir="${test}" destdir="${bin}" includeantruntime="false" classpathref="classpath" />
</target>
<!-- =================================
target: crawl.compile
================================= -->
<target name="crawl.compile" depends="clean, init" description="Compile the project">
<javac encoding="UTF-8" includeantruntime="false" srcdir="${src}" destdir="${bin}" classpathref="classpath" />
</target>
<!-- =================================
target: test
================================= -->
<target name="test" depends="compile">
<junit>
<classpath>
<path refid="classpath" />
<pathelement location="${bin}" />
</classpath>
<!-- formatter to screen -->
<formatter type="brief" usefile="false" />
<!-- formatter to file -->
<formatter type="brief" />
<batchtest todir="${report}">
<fileset dir="${bin}" includes="**/SolutionTest.class" />
</batchtest>
</junit>
</target>
<!-- =================================
target: crawl
================================= -->
<target name="crawl" depends="crawl.compile" description="Crawl new problems from leetcode">
<java classname="${main-class}" fork="true">
<classpath>
<path refid="classpath" />
<pathelement location="${bin}" />
</classpath>
</java>
</target>
</project>