File: build.xml

package info (click to toggle)
castor 1.3.2-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 44,976 kB
  • sloc: java: 206,032; xml: 95,088; sql: 14,460; sh: 365; makefile: 10
file content (172 lines) | stat: -rw-r--r-- 7,491 bytes parent folder | download | duplicates (4)
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<project name="Castor XML - code generator" default="compile.codegen" basedir=".">

    <property environment="env" />
    <property name="source"               value="${basedir}/src"/>
    <property name="main.java"            value="${source}/main/java"/>
    <property name="main.resources"       value="${source}/main/resources"/>
    <property name="main.generated"       value="${basedir}/target/generated-sources/castor"/>
	<property name="test.java"            value="${source}/test/java"/>
    <property name="test.resources"       value="${source}/test/resources"/>
    <property name="build"                value="${basedir}/build"/>
    <property name="classes"              value="${build}/classes"/>
	<property name="test.classes"         value="${build}/test"/>
    <property name="archive"              value="${project}-codegen-${version}${release}"/>
    <property name="gen.src"              value="${build}/generated-sources"/>

	<!--
	<artifact:dependencies filesetId="dependency.fileset" useScope="test">
	    <artifact:pom id="core" file="${basedir}/pom.xml" />
    </artifact:dependencies>	
    -->

    <path id="build.compile.classpath">
        <pathelement location="${basedir}/build/classes"/>
        <pathelement location="${basedir}/../build/classes"/>
        <pathelement location="${basedir}/../schema/build/classes"/>
        <pathelement location="${basedir}/../anttask/build/classes"/>
        <pathelement location="${basedir}/../core/build/classes"/>
        <fileset dir="/" includesfile="${basedir}/../debian/classpath-debian"/>
    	
    	<!-- JARs -->
    	<!--
    	<pathelement location="${basedir}/../lib/commons-logging-1.1.jar"/>
    	<pathelement location="${basedir}/../lib/junit_3.8.2.jar"/>
    	<pathelement location="${basedir}/../lib/velocity-1.5.jar"/>
    	-->
    </path>

    <path id="build.test-compile.classpath">
        <path refid="build.compile.classpath"/>
        <pathelement location="${basedir}/build/test"/>
        <pathelement location="${basedir}/../build/test"/>
    </path>

    <path id="test.classpath">
        <pathelement location="${basedir}/build/classes"/>
        <pathelement location="${basedir}/build/test"/>
        <pathelement location="${basedir}/../build/classes"/>
    	<pathelement location="${basedir}/../lib/commons-logging-1.1.jar"/>
    	<pathelement location="${basedir}/../lib/junit_3.8.2.jar"/>
    	<pathelement location="${basedir}/../lib/velocity-1.5.jar"/>
    	<pathelement location="${basedir}/../lib/commons-collections-3.1.jar"/>
      	<pathelement location="${basedir}/../lib/commons-lang-2.1.jar"/>
        <pathelement location="${basedir}/../anttask/build/classes"/>
    	<pathelement location="${basedir}/../lib/junit_3.8.2.jar"/>
    	<pathelement location="${basedir}/../bin/lib/ant-junit-1.6.jar"/>
    </path>

	<target name="derive.codegen.libs">
		<mkdir dir="${basedir}/lib" />  	
	    <!--
	    <copy todir="${basedir}/lib" verbose="true">
	      <fileset refid="dependency.fileset"/>
	      <mapper type="flatten"/>
	    </copy>
	    -->
	</target>	

    <target name="prepare.codegen" unless="prepare.codegen.executed">
        <mkdir dir="${build}"/>
        <mkdir dir="${classes}"/>
        <property name="prepare.codegen.executed" value="true"/>
    </target>

    <target name="clean.codegen" description="Removes CodeGen build directory">
        <delete dir="${build}"/>
    </target>

    <target name="clean.tests.codegen" description="Removes CodeGen test build directory">
        <delete dir="${test.classes}"/>
    </target>

    <target name="compile.codegen" depends="prepare.codegen, derive.codegen.libs" description="Compile CodeGen">
        <javac srcdir="${main.generated}" destdir="${classes}" 
               debug="on" encoding="ISO-8859-1" deprecation="false"
               source="1.5" target="1.5">
            <classpath refid="build.compile.classpath"/>
        	<classpath>
        		<fileset dir="${basedir}/lib"/>
        	</classpath>
        </javac>
        <javac srcdir="${main.java}" destdir="${classes}" 
               debug="on" encoding="ISO-8859-1" deprecation="false"
        	   source="1.5" target="1.5">
            <classpath refid="build.compile.classpath"/>
        	<classpath>
        		<fileset dir="${basedir}/lib"/>
        	</classpath>
        </javac>
        <copy todir="${classes}">
            <fileset dir="${main.generated}">
                <include name="**/*.cdr"/>
            </fileset>
            <fileset dir="${main.resources}">
                <include name="**"/>
            </fileset>
            <filterset begintoken="$$" endtoken="$$">
	            <filter token="VERSION" value="${version}"/>
	            <filter token="RELEASE" value="${release}"/>
            </filterset>
        </copy>
    </target>

    <target name="jar.codegen" depends="compile.codegen" description="Build AntTask JAR file">
        <jar jarfile="${build}/${archive}.jar" basedir="${classes}" includes="**"
             manifest="${classes}/META-INF/MANIFEST.MF"/>
        <copy file="${build}/${archive}.jar" tofile="${basedir}/../dist/${archive}.jar"/>
    </target>

    <target name="compile.bugs.codegen" depends="compile.codegen" 
    	    description="Build the tests packages">
        <mkdir dir="${test.classes}"/>
        <javac srcdir="${test.java}" destdir="${test.classes}"
               debug="on" encoding="ISO-8859-1" deprecation="${deprecation}"
        	   source="1.5" target="1.5">
            <classpath refid="build.test-compile.classpath"/>
        </javac>

        <copy todir="${test.classes}">
            <fileset dir="${test.resources}"/>
        </copy>
    </target>
	
	<target name="tests.codegen" description="Runs
		JUnit tests" depends="compile.bugs.codegen">
		<junit printsummary="true">
			<formatter type="plain" />
			<batchtest>
				<fileset dir="${test.classes}">
					<include name="**/Test*"/>
					<include name="**/*Test"/>
				</fileset>
			</batchtest>
			<classpath refid="test.classpath" />
		</junit>
	</target>
	
    <target name="gen.binding" depends="compile.codegen"
            description="Use the Source Generator to create the Java classes for binding.xsd">
        <delete dir="${gen.src}/binding"/>
        <mkdir dir="${gen.src}/binding"/>
        <taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask"
                 classpathref="build.compile.classpath"/>
        <castor-srcgen file="${main.resources}/org/exolab/castor/builder/binding/binding.xsd"
                       todir="${gen.src}/binding"
                       package="org.exolab.castor.builder.binding.xml"
                       lineseparator="unix"
        			   properties="${classes}/org/exolab/castor/builder/binding.generation.properties"
                       types="j2"
                       warnings="true"/>
        <javac destdir="${classes}" excludes="${excludes}"
               debug="${main.opt.debug}" encoding="ISO-8859-1" deprecation="off"
               optimize="on" source="1.4" target="1.4">
            <src path="${gen.src}/binding" />
            <classpath refid="build.compile.classpath"/>
        </javac>
    </target>

<!--
                       bindingfile="${main.resources}/org/exolab/castor/builder/binding/binding-binding.xml"
-->	

</project>