This repository has been archived by the owner on Mar 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
144 lines (121 loc) · 4.63 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
<?xml version="1.0"?>
<project name="Markdown-to-HTML-master" basedir="." default="build" xmlns:jacoco="antlib:org.jacoco.ant">
<description>
A build script along with creating a jar file
</description>
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="lib/jacocoant.jar"/>
</taskdef>
<property name="src.dir" location="src"/>
<property name="build.dir" location="classes"/>
<property name="lib.dir" location="lib"/>
<property name="doc.dir" location="doc"/>
<property name="javadoc.dir" location="doc\javadoc"/>
<property name="report.dir" location="report"/>
<property name="test.dir" location="test" />
<target name="init" description="creating classes, javadoc, report, and Test directories">
<mkdir dir="${build.dir}"/>
<mkdir dir="${javadoc.dir}"/>
<mkdir dir="${report.dir}"/>
<mkdir dir="${build.dir}/Test" />
</target>
<target name="build" depends="init" description="project build with Test case">
<javac srcdir="${src.dir}" destdir="${build.dir}" debug="true" includeantruntime="false">
<classpath path="classes" />
<classpath path="lib/junit.jar" />
<classpath path="lib/hamcrest-core.jar" />
<classpath path="lib/jtidy.jar" />
</javac>
<javac srcdir="${test.dir}" destdir="${build.dir}/Test" debug="true" includeantruntime="false">
<classpath path="classes" />
<classpath path="lib/junit.jar" />
<classpath path="lib/hamcrest-core.jar" />
<classpath path="lib/jtidy.jar" />
</javac>
</target>
<target name="make_jar" depends="build" description="making a jar file for running MDconverter">
<jar destfile="${lib.dir}\md_html_converter.jar" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="mdconverter.MDConverter" />
<attribute name="Class-Path" value="jtidy.jar hamcrest-core.jar junit.jar" />
</manifest>
</jar>
</target>
<target name="make_doc" depends="init" description="making javadocs">
<javadoc destdir="${javadoc.dir}">
<fileset dir="${src.dir}" defaultexcludes="yes">
<include name="Node/"/>
<include name="Token/"/>
<include name="util/"/>
<include name="mdconverter/"/>
</fileset>
<classpath>
<fileset dir="${lib.dir}">
<include name="jtidy.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
<target name="clean" description="cleaning up classes">
<delete dir="${build.dir}"/>
</target>
<target name="clean_doc" description="cleaning up javadoc files">
<delete dir="${javadoc.dir}"/>
</target>
<target name="clean_report" description="cleaning up report files">
<delete dir="${report.dir}"/>
</target>
<target name="test" depends ="build" description="This is for checking unit Test, systemtest.html will delete for cov-report">
<delete file="systemtest.html" />
<junit showoutput="false" printsummary="on" enabletestlistenerevents="true" fork="true" forkmode="perBatch">
<classpath path="${build.dir}" />
<classpath path="${build.dir}/test" />
<classpath path="lib/junit.jar" />
<classpath path="lib/hamcrest-core.jar" />
<classpath path="lib/jtidy.jar" />
<formatter type="plain" usefile="false" />
<batchtest>
<fileset dir="${build.dir}/Test">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</target>
<target name="cov-test" depends ="build" description="This is for checking coverage Test">
<delete file="systemtest.html" />
<jacoco:coverage>
<junit showoutput="false" printsummary="on" enabletestlistenerevents="true" fork="true" forkmode="perBatch">
<classpath path="${build.dir}" />
<classpath path="${build.dir}/test" />
<classpath path="lib/junit.jar" />
<classpath path="lib/hamcrest-core.jar" />
<classpath path="lib/jtidy.jar" />
<formatter type="plain" usefile="false" />
<batchtest>
<fileset dir="${build.dir}/Test">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
</target>
<target name="cov-report" depends="cov-test">
<jacoco:report>
<executiondata>
<fileset file="jacoco.exec" />
</executiondata>
<structure name="Coverage-Report">
<classfiles>
<fileset dir="classes">
<exclude name="org" />
<exclude name="lib/jtidy"/>
</fileset>
</classfiles>
<sourcefiles>
<fileset dir="src" />
</sourcefiles>
</structure>
<html destdir="report" />
</jacoco:report>
</target>
</project>