forked from open-dis/open-dis-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
112 lines (93 loc) · 5.22 KB
/
Copy pathbuild.xml
File metadata and controls
112 lines (93 loc) · 5.22 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<!-- to upload to the sourceforge project web site, "sftp myUserName,open-dis@web.sourceforge.net",
ie your sourceforge login name, a comma, and the group name. To transfer files you can do
something like scp -r aLocalDirectory myUserName,open-dis@web.sourceforge.net:/home/groups/o/op/open-dis/htdocs
though the location of the directory on the sourceforge side may change over time.
-->
<project name="open-dis codebase" basedir=".">
<property name="src" location="src/main/java"/>
<target name="init" description="create initial directories">
<mkdir dir="${build}"/>
<mkdir dir="${testReportOutputDir}"/>
<mkdir dir="${src}/edu"/>
<mkdir dir="${src}/edu/nps"/>
<mkdir dir="${src}/edu/nps/moves"/>
<mkdir dir="${src}/edu/nps/moves/dis"/>
<mkdir dir="${src}/edu/nps/moves/dis7"/>
</target>
<target name="generateAllSource">
<antcall target="generateJavaDisSourceCode"/>
<antcall target="generateJavaDis7SourceCode"/>
</target>
<!-- Generate the desktop Java 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.
Some source code generation properties are set in the XML file, such as the directory location.
These may be overridden by command line options that set java system properties via
the -D option.
This uses git submodules to share the XML description file across language implementations.
to pull it in, run
git submodule init
git submodule update
-->
<target name="generateJavaDisSourceCode" depends="init" description = "run program to generate desktop java">
<echo message="Be sure to bring in the git submodule for DISDescription with git submodule init; git submodule update"/>
<property name="xmlSourceFile" value="DISDescription/DIS6.xml"/>
<property name="xmlpg.generatedSourceDir" value="${src}"/>
<property name="xmlpg.package" value="edu.nps.moves.dis"/>
<property name="product" value="dis"/>
<echo message="Generating DIS source code for java desktop"/>
<echo message="source dir=${xmlpg.generatedSourceDir}"/>
<antcall target="generateDisSourceCode"/>
</target>
<target name="generateJavaDis7SourceCode" depends="init" description = "run program to generate java for DIS 2009, desktop version">
<echo message="Be sure to bring in the git submodule for DISDescription with git submodule init; git submodule
update"/>
<echo message="Generating DIS 7 desktop version"/>
<property name="xmlSourceFile" value="DISDescription/DIS7.xml"/>
<property name="javadir" value="${src}"/>
<property name="xmlpg.package" value="edu.nps.moves.dis7"/>
<property name="product" value="dis7"/>
<property name="xmlpg.generatedSourceDir" value="${src}"/>
<!-- apply the patches, manual changes to the code captured in the patch files -->
<antcall target="generateDisSourceCode"/>
</target>
<target name="check-prerequisites-generate">
<condition property="properties-set">
<and>
<isset property="xmlSourceFile"/>
<!--isset property="javadir"/-->
</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 for java"/>
<java classname="edu.nps.moves.xmlpg.Xmlpg">
<classpath refid="lib.path"/>
<arg value="${xmlSourceFile}"/>
<arg value="java"/>
<sysproperty key="xmlpg.generatedSourceDir" value="${src}"/>
<sysproperty key="xmlpg.package" value="${xmlpg.package}"/>
</java>
<!-- apply the patches, manual changes to the code captured in the patch files -->
<antcall target="patch"/>
</target>
<!-- Run patch scripts on the generated code to fix various problems. This is run by the generateDisSourceCode task -->
<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>