forked from FudgeMsg/Fudge-Proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
132 lines (119 loc) · 6.76 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
<project name="fudge-proto" default="compile">
<available file="${basedir}/../../common/common.xml" property="common.dir" value="${basedir}/../../common" />
<property file="build.properties"/>
<target name="parser"
description="--> build the grammar parser">
<exec executable="antlr3" dir="src">
<arg value="-o" />
<arg value="." />
<arg value="org/fudgemsg/proto/antlr/Proto.g" />
</exec>
</target>
<target name="clean-tests" depends="clean-tests-ant,clean-tests-c,clean-tests-cs,clean-tests-cpp,clean-tests-default,clean-tests-java,clean-tests-proto"
description="--> delete the output from the test scripts">
</target>
<target name="clean-tests-ant" description="--> delete the output from the Ant test scripts"><delete dir="${tests.dir}/out_ant" /></target>
<target name="clean-tests-c" description="--> delete the output from C test scripts"><delete dir="${tests.dir}/out_C" /></target>
<target name="clean-tests-cs" description="--> delete the output from C# test scripts"><delete dir="${tests.dir}/out_C#" /></target>
<target name="clean-tests-cpp" description="--> delete the output from C++ test scripts"><delete dir="${tests.dir}/out_C++" /></target>
<target name="clean-tests-default" description="--> delete the output from default test scripts"><delete dir="${tests.dir}/out_default" /></target>
<target name="clean-tests-java" description="--> delete the output from Java test scripts"><delete dir="${tests.dir}/out_Java" /></target>
<target name="clean-tests-proto" description="--> delete the output from .proto test scripts"><delete dir="${tests.dir}/out_proto" /></target>
<target name="compile-proto-java"
depends="tests"
description="--> compile the output of the Java code generator">
<javac srcdir="${tests.dir}/unit_Java"
destdir="${tests.dir}/out_Java"
classpathref="lib.path.id"
debug="${build.debug}"
optimize="${build.optimize}"
verbose="${build.verbose}"
listfiles="${build.listfiles}">
<src path="${tests.dir}/unit_Java" />
<src path="${tests.dir}/out_Java" />
</javac>
</target>
<target name="test-proto-java" depends="compile-proto-java"
description="--> test the output of the Java code generator">
<mkdir dir="${tests.dir}/out_Java/xml" />
<junit printSummary="true" fork="true" forkmode="once">
<classpath>
<path refid="lib.path.id" />
<pathelement path="${classes.dir}" />
<pathelement path="${tests.dir}/out_Java" />
</classpath>
<assertions>
<enable />
</assertions>
<formatter type="xml" />
<batchtest todir="${tests.dir}/out_Java/xml">
<fileset dir="${tests.dir}/unit_Java" includes="**/*Test.java" />
</batchtest>
</junit>
<mkdir dir="${tests.dir}/out_Java/html" />
<junitreport todir="${tests.dir}/out_Java/xml">
<fileset dir="${tests.dir}/out_Java/xml" includes="TEST-*.xml" />
<report todir="${tests.dir}/out_Java/html" />
</junitreport>
</target>
<target name="compile-proto-c"
depends="tests"
description="--> compile the output of the C code generator">
<taskdef resource="cpptasks.tasks"/>
<cc objdir="${tests.dir}/out_C" warnings="diagnostic">
<includepath path="${tests.dir}/unit_C" />
<fileset dir="${tests.dir}/out_C" includes="*.c" />
</cc>
</target>
<target name="test-ant-prep" depends="compile-src,test-proto-java">
<path id="fudge.proto.path.id">
<path refid="lib.path.id" />
<pathelement path="${classes.dir}" />
</path>
<path id="fudge.ant.path.id">
<path refid="lib.path.id" />
<pathelement path="${tests.dir}/out_Java" />
</path>
<taskdef name="fudgeproto" classname="org.fudgemsg.proto.AntTask" classpathref="fudge.proto.path.id" />
<mkdir dir="${tests.dir}/out_ant" />
</target>
<target name="test-ant-reqmut" depends="test-ant-prep">
<mkdir dir="${tests.dir}/out_ant/reqmut" />
<fudgeproto srcdir="${tests.dir}/proto" destdir="${tests.dir}/out_ant/reqmut" verbose="${build.verbose}" fudgeContext="org.fudgemsg.FudgeContext.GLOBAL_DEFAULT" fieldsMutable="true" fieldsRequired="true" gitIgnore="true">
<exclude name="errors/*" />
<fileHeader>// AntTask inserted File header</fileHeader>
<fileFooter>// AntTask inserted File footer</fileFooter>
</fudgeproto>
<javac srcdir="${tests.dir}/out_ant/reqmut" destdir="${tests.dir}/out_ant/reqmut" classpathref="fudge.ant.path.id" debug="${build.debug}" optimize="${build.optimize}" verbose="${build.verbose}" listfiles="${build.listfiles}" />
</target>
<target name="test-ant-reqro" depends="test-ant-prep">
<mkdir dir="${tests.dir}/out_ant/reqro" />
<fudgeproto srcdir="${tests.dir}/proto" destdir="${tests.dir}/out_ant/reqro" verbose="${build.verbose}" fudgeContext="org.fudgemsg.FudgeContext.GLOBAL_DEFAULT" fieldsMutable="false" fieldsRequired="true" gitIgnore="true">
<exclude name="errors/*" />
<fileHeader>// AntTask inserted File header</fileHeader>
<fileFooter>// AntTask inserted File footer</fileFooter>
</fudgeproto>
<javac srcdir="${tests.dir}/out_ant/reqro" destdir="${tests.dir}/out_ant/reqro" classpathref="fudge.ant.path.id" debug="${build.debug}" optimize="${build.optimize}" verbose="${build.verbose}" listfiles="${build.listfiles}" />
</target>
<target name="test-ant-optmut" depends="test-ant-prep">
<mkdir dir="${tests.dir}/out_ant/optmut" />
<fudgeproto srcdir="${tests.dir}/proto" destdir="${tests.dir}/out_ant/optmut" verbose="${build.verbose}" fudgeContext="org.fudgemsg.FudgeContext.GLOBAL_DEFAULT" fieldsMutable="true" fieldsRequired="false" gitIgnore="true">
<exclude name="errors/*" />
<fileHeader>// AntTask inserted File header</fileHeader>
<fileFooter>// AntTask inserted File footer</fileFooter>
</fudgeproto>
<javac srcdir="${tests.dir}/out_ant/optmut" destdir="${tests.dir}/out_ant/optmut" classpathref="fudge.ant.path.id" debug="${build.debug}" optimize="${build.optimize}" verbose="${build.verbose}" listfiles="${build.listfiles}" />
</target>
<target name="test-ant-optro" depends="test-ant-prep">
<mkdir dir="${tests.dir}/out_ant/optro" />
<fudgeproto srcdir="${tests.dir}/proto" destdir="${tests.dir}/out_ant/optro" verbose="${build.verbose}" fudgeContext="org.fudgemsg.FudgeContext.GLOBAL_DEFAULT" fieldsMutable="false" fieldsRequired="false" gitIgnore="true">
<exclude name="errors/*" />
<fileHeader>// AntTask inserted File header</fileHeader>
<fileFooter>// AntTask inserted File footer</fileFooter>
</fudgeproto>
<javac srcdir="${tests.dir}/out_ant/optro" destdir="${tests.dir}/out_ant/optro" classpathref="fudge.ant.path.id" debug="${build.debug}" optimize="${build.optimize}" verbose="${build.verbose}" listfiles="${build.listfiles}" />
</target>
<target name="test-ant" depends="test-ant-reqmut,test-ant-reqro,test-ant-optmut,test-ant-optro" description="--> test the ant task">
</target>
<import file="${common.dir}/common.xml"/>
</project>