forked from mbtaylor/jsamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
maven.xml
125 lines (117 loc) · 5.14 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
<?xml version='1.0'?>
<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util">
<!-- Tweak the target which generates an Ant build.xml file. This is
! probably fragile - it would be more correct to use an xslt
! transformer here, but not really worth the additional effort. -->
<postGoal name="ant:generate-build">
<ant:replace file="build.xml">
<replaceFilter token="<javac "
value="<javac source='1.4' target='1.4' "/>
<replaceFilter token='if="Junit.present"'
value='if="Junit.present.false"'/>
</ant:replace>
<ant:mkdir dir="target"/>
<ant:move file="build.xml" toFile="target/build.xml"/>
</postGoal>
<!-- For convenience, move the single dependency jar into the target
! directory. This just means that it can be invoked in place. -->
<postGoal name="jar:jar">
<ant:copy file="${maven.repo.local}/xmlrpc/jars/xmlrpc-1.2-b1.jar"
todir="target"/>
</postGoal>
<!-- New goal to generate a sources export file. -->
<goal name="source-zip"
description="Build zip file containing buildable(?) sources for export"
prereqs="ant:generate-build,java:jar-resources">
<ant:mkdir dir="target"/>
<ant:zip destfile="target/jsamp_src-${pom.currentVersion}.zip">
<ant:fileset dir="target">
<include name="build.xml"/>
</ant:fileset>
<ant:fileset dir=".">
<include name="src/java/**"/>
<include name="src/resources/**"/>
</ant:fileset>
<ant:zipfileset dir="target/classes" prefix="src/resources">
<include name="org/astrogrid/samp/jsamp.version"/>
</ant:zipfileset>
</ant:zip>
</goal>
<preGoal name="xdoc:transform">
<attainGoal name="command-usage"/>
</preGoal>
<postGoal name="xdoc:transform">
<!-- Hack maven theme file. It gratuitously sets font size of paragraph
! text to small. Not only is this just wrong (presumably motivated
! by whatever happened to look good on Mr Maven's screen/browser
! combination) it looks stupid when P and UL/OL/DL elements appear
! adjacently. -->
<ant:replace file="target/docs/style/maven-theme.css">
<replaceFilter token=" font-size: small;"
replace=" font-size: normal;"/>
</ant:replace>
<ant:copy todir="target/docs">
<fileset dir="${maven.docs.src}/../resources"/>
</ant:copy>
</postGoal>
<postGoal name="java:jar-resources">
<ant:echo message="${pom.currentVersion}"
file="target/classes/org/astrogrid/samp/jsamp.version"/>
</postGoal>
<goal name="samp-deploy"
description="Deploy built archives to repository"
prereqs="jar:jar,source-zip,site">
<echo message="Do this:"/>
<echo message=" /usr/java/latest/bin/jarsigner -keystore /export/home/mbt/certs/mbtstore -tsa https://timestamp.geotrust.com/tsa -signedjar target/jsamp-${pom.currentVersion}_signed.jar target/jsamp-${pom.currentVersion}.jar mbt-phys-bris"/>
<ant:delete dir="${astrogrid.jsamp.deploydir}"/>
<ant:mkdir dir="${astrogrid.jsamp.deploydir}"/>
<ant:copy file="target/jsamp-${pom.currentVersion}.jar"
todir="${astrogrid.jsamp.deploydir}"
failonerror="true"/>
<ant:copy file="target/jsamp-${pom.currentVersion}_signed.jar"
todir="${astrogrid.jsamp.deploydir}"
failonerror="true"/>
<ant:copy file="target/jsamp_src-${pom.currentVersion}.zip"
todir="${astrogrid.jsamp.deploydir}"
failonerror="true"/>
<ant:copy todir="${astrogrid.jsamp.deploydir}" failonerror="true">
<fileset dir="target/docs"/>
</ant:copy>
<ant:replace dir="${astrogrid.jsamp.deploydir}"
includes="downloads.html">
<replaceFilter token="[SAMP-VERSION]" value="${pom.currentVersion}"/>
</ant:replace>
</goal>
<goal name="command-usage"
description="Write usage messages for command-line tools to files"
prereqs="java:compile">
<ant:mkdir dir="target/docs"/>
<j:set var="commands"
value="org.astrogrid.samp.JSamp
org.astrogrid.samp.hub.Hub
org.astrogrid.samp.gui.HubMonitor
org.astrogrid.samp.test.Snooper
org.astrogrid.samp.test.MessageSender
org.astrogrid.samp.test.CalcStorm
org.astrogrid.samp.test.HubTester
org.astrogrid.samp.bridge.Bridge"/>
<u:tokenize var="commands" delim=" ">${commands}</u:tokenize>
<j:forEach items="${commands}" var="cmd">
<ant:echo message="Usage for ${cmd}"/>
<ant:java classname="${cmd}"
output="target/docs/${cmd}.usage"
fork="true">
<classpath>
<path refid="maven.dependency.classpath"/>
<pathelement location="target/classes"/>
</classpath>
<arg value="-help"/>
</ant:java>
<ant:replace file="target/docs/${cmd}.usage">
<replaceFilter token="&" value="&amp;"/>
<replaceFilter token="<" value="&lt;"/>
<replaceFilter token=">" value="&gt;"/>
</ant:replace>
</j:forEach>
</goal>
</project>