-
Notifications
You must be signed in to change notification settings - Fork 3
/
maven.xml
163 lines (139 loc) · 5.47 KB
/
maven.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?xml version="1.0"?>
<!-- Copyright (c) 2005 Dustin Sallings (dustin@spy.net) -->
<project default="jar"
xmlns:m="jelly:maven"
xmlns:ant="jelly:ant"
xmlns:j="jelly:core">
<preGoal name="java:compile">
<attainGoal name="spyjar:core"/>
<attainGoal name="git:versions"/>
<attainGoal name="git:changelog"/>
<attainGoal name="spyjar:buildprops"/>
<attainGoal name="spyjar:buildinfo"/>
</preGoal>
<postGoal name="clean">
<ant:delete file="cobertura.ser"/>
</postGoal>
<goal name="spyjar:core">
<!-- First stage compile. -->
<ant:javac srcdir="${maven.src.dir}/java"
destdir="${maven.build.dest}"
debug="${maven.compile.debug}"
deprecation="${maven.compile.deprecation}"
verbose="${maven.compile.verbose}">
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:pathelement path="${maven.build.dest}"/>
</ant:classpath>
<include name="net/spy/util/SPGen.java"/>
<include name="net/spy/util/InterfaceImplementor.java"/>
<include name="net/spy/util/ProxyInterfaceImplementor.java"/>
<include name="net/spy/SpyUtil.java"/>
<include name="net/spy/SpyToker.java"/>
<include name="net/spy/util/TypeNameGen.java"/>
<include name="net/spy/db/CachedResultSetStub.java"/>
<include name="net/spy/db/ProxyResultSetStub.java"/>
<include name="net/spy/ant/*.java"/>
</ant:javac>
<!-- Define the tasks needed to proceed -->
<ant:taskdef resource="net/spy/ant/tasks.properties">
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:pathelement path="${maven.build.dest}"/>
<ant:pathelement path="${maven.src.dir}/java"/>
</ant:classpath>
</ant:taskdef>
<!-- Generating type names -->
<ant:mkdir dir="${maven.build.src}/net/spy/db"/>
<ant:java classname="net.spy.util.TypeNameGen">
<arg value="${maven.build.src}/net/spy/db/TypeNames.java"/>
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:pathelement path="${maven.build.dest}"/>
</ant:classpath>
</ant:java>
<!-- Generating result set classes -->
<ant:implement interfaceName="java.sql.ResultSet"
superClass="net.spy.db.CachedResultSetStub"
outClass="net.spy.db.CachedResultSet"
outDir="${maven.build.src}"/>
<ant:implementproxy interfaceName="java.sql.ResultSet"
superClass="net.spy.SpyObject"
outClass="net.spy.db.ProxyResultSet"
outDir="${maven.build.src}"/>
<!-- Second stage compile -->
<ant:javac
destdir="${maven.build.dest}"
debug="${maven.compile.debug}"
deprecation="${maven.compile.deprecation}"
verbose="${maven.compile.verbose}">
<ant:src>
<ant:path refid="maven.compile.src.set"/>
<ant:path path="${maven.src.dir}/java"/>
<ant:path path="${maven.build.src}"/>
</ant:src>
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:pathelement path="${maven.build.dest}"/>
</ant:classpath>
<include name="net/spy/db/*Stub.java"/>
<include name="net/spy/db/ProxyResultSet.java"/>
<include name="net/spy/db/CachedResultSet.java"/>
</ant:javac>
<ant:implement interfaceName="java.sql.ResultSet"
superClass="net.spy.db.FileResultSetStub"
outClass="net.spy.db.FileResultSet"
outDir="${maven.build.src}"/>
<ant:implement interfaceName="java.sql.PreparedStatement"
superClass="net.spy.db.CachePreparedStatementStub"
outClass="net.spy.db.CachePreparedStatement"
outDir="${maven.build.src}"/>
<ant:spgen srcdir="${maven.src.dir}/java/" destdir="${maven.build.src}"/>
<path id="spyjar.build.src" location="${maven.build.src}"/>
<m:addPath id="maven.compile.src.set" refid="spyjar.build.src"/>
</goal>
<goal name="spyjar:buildprops">
<tstamp/>
<copy file="${basedir}/etc/properties.in"
tofile="${spy.buildinfo.prop.out}"/>
<propertyfile file="${spy.buildinfo.prop.out}">
<entry key="build.date" type="date" value="now"/>
<entry key="build.dstamp" value="${DSTAMP}"/>
<entry key="build.tstamp" value="${TSTAMP}"/>
<entry key="build.dtstamp" value="${DSTAMP}${TSTAMP}"/>
<entry key="java.vendor" value="${java.vendor}"/>
<entry key="java.version" value="${java.version}"/>
<entry key="os.name" value="${os.name}"/>
<entry key="os.version" value="${os.version}"/>
<entry key="git.long.version" value="${git.long.version}"/>
<entry key="tree.version" value="${git.long.version}"/>
<entry key="git.short.version" value="${git.short.version}"/>
</propertyfile>
<property file="${spy.buildinfo.prop.out}"/>
</goal>
<goal name="spyjar:buildinfo" prereqs="spyjar:buildprops">
<taskdef classpathref="maven.dependency.classpath"
resource="net/spy/ant/tasks.properties"/>
<buildinfo package="${spy.buildinfo.package}"
buildprops="${spy.buildinfo.prop.rel}"
changelog="${spy.buildinfo.changelog}"
destdir="${spy.buildinfo.dest}"/>
<path id="spy.buildinfo.generated.src"
location="${spy.buildinfo.dest}"/>
<m:addPath id="maven.compile.src.set"
refid="spy.buildinfo.generated.src"/>
</goal>
<preGoal name="test:compile">
<ant:mkdir dir="${maven.build.dir}/testsrc"/>
<ant:spgen srcdir="${maven.src.dir}/test/"
interfaces="java.io.Serializable java.util.RandomAccess"
destdir="${maven.build.dir}/testsrc"/>
<path id="spyjar.test.build.src" location="${maven.build.dir}/testsrc"/>
<m:addPath id="maven.test.compile.src.set" refid="spyjar.test.build.src"/>
</preGoal>
<preGoal name="site">
<ant:mkdir dir="${maven.docs.dest}/apidocs/images"/>
<ant:copy file="${basedir}/etc/graphtest.png"
tofile="${maven.docs.dest}/apidocs/images/graphtest.png"/>
</preGoal>
</project>