forked from open-dis/open-dis-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
83 lines (69 loc) · 3.4 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"?>
<!--
ant build file for cpp. Generates source code and does a few other things. This pretty much
just strictly generates cpp code. You should rely on build files in the Compile directory
to compile on your target architecture.
-->
<project name="open-dis codebase" default="generateCppDisSourceCode" basedir=".">
<property name="lib" location="lib"/>
<path id="lib.path">
<fileset id="lib.jars" dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="init" description="create initial directories">
<mkdir dir="src/obj"/>
</target>
<!-- Generate the C++ Open-DIS code. This relies on the jar file xmlpg.jar, from
a separate project in the trunk that is included in the lib directory of this project. You
must run patch after this to apply known manual fixes to the source code generated.
-->
<target name="generateCppDisSourceCode" depends="init" description = "run program to generate cpp">
<property name="xmlSourceFile" value="DISDescription/DIS6.xml"/>
<property name="cppdir" value="src/dis6"/>
<property name="product" value="cppDis6"/>
<antcall target="generateDisSourceCode"/>
</target>
<target name="generateCppDis7SourceCode" depends="init" description = "run program to generate cpp">
<property name="xmlSourceFile" value="DISDescription/DIS7.xml"/>
<property name="cppdir" value="src/dis7"/>
<property name="product" value="cppDis7"/>
<antcall target="generateDisSourceCode"/>
</target>
<target name="check-prerequisites-generate">
<condition property="properties-set">
<and>
<isset property="xmlSourceFile"/>
<isset property="cppdir"/>
</and>
</condition>
<fail message="Not all prerequisite properties are defined properly!" unless="properties-set"/>
</target>
<target name="generateDisSourceCode" depends="init, check-prerequisites-generate" description = "run program to generate DIS source code">
<echo message="Generating DIS source code cpp"/>
<java classname="edu.nps.moves.xmlpg.Xmlpg">
<classpath refid="lib.path"/>
<arg value="${xmlSourceFile}"/>
<arg value="cpp"/>
<sysproperty key="xmlpg.generatedSourceDir" value="${cppdir}"/>
</java>
<!-- apply the patches, manual changes to the code captured in the patch files -->
<antcall target="patch"/>
</target>
<target name="patch" description="patch generated source code">
<!--exec executable="patches/applyPatches.bash"-->
<!-- use this property for most cygwin-based windows releases -->
<!---property name="bash" value="/cygwin/bin/bash"/-->
<!-- Use this property for most Unix platforms -->
<property name="bash" value="/bin/bash"/>
<exec executable="${bash}" osfamily="unix">
<!-- Add an extra dash in front of the login for cygwin. The other extra arguments seem to help -->
<!--arg value="-login"/-->
<!--arg value="-i"/-->
<!--arg value="-c"/-->
<!-- The bash script to run. this applies the patches to the source code -->
<arg value="patches/applyPatches.bash"/>
<arg value="${product}"/>
</exec>
</target>
</project>