File: Fix-build.xml-for-use-outside-of-starjava.patch

package info (click to toggle)
starjava-ttools 3.5.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 23,000 kB
  • sloc: java: 170,407; xml: 19,593; javascript: 670; python: 641; sh: 107; makefile: 29
file content (317 lines) | stat: -rw-r--r-- 12,664 bytes parent folder | download | duplicates (2)
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
From: Ole Streicher <olebole@debian.org>
Date: Fri, 17 Feb 2017 13:33:13 +0100
Subject: Fix build.xml for use outside of starjava

This includes the following changes:

 * Rename the `extclasspath` elements to `path`. With ant >= 1.6, there is no
   difference (and before, the difference was not relevant for Debian)

 * Ignore local property files

 * Change the starlink installation dir to the standard Java path /usr/share/java/

 * Prefix the name by `starlink-`

 * Adjust the build and test classpaths for Debian (also for CI tests)

 * Set a class path in the jar manifest

 * Set the source file encoding (cp1252), but not the source version (deprecated)

 * Don't sign the jarfile
---
 build.xml | 142 +++++++++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 89 insertions(+), 53 deletions(-)

diff --git a/build.xml b/build.xml
index 176ea3e..91b5718 100644
--- a/build.xml
+++ b/build.xml
@@ -38,12 +38,6 @@
  !-->
 
 <project name="Build file for TTOOLS" default="build" basedir=".">
-
-  <!-- If either or both of these files exist then any properties
-   !   contained within them will override those defined here.  -->
-  <property file="${user.home}/.stardev.properties"/>
-  <property file=".properties"/>
-
   <!-- Properties will also be set for all environment variables
    !   (PATH becomes "env.PATH"), generally not a good
    !   idea as names are OS dependent -->
@@ -56,13 +50,13 @@
    !-->
 
   <!-- Directory for the Starlink installation (usually /star/java)-->
-  <property name="star.dir" value="${basedir}/../../"/>
+  <property name="star.dir" value="/usr/share/java"/>
 
   <!-- Directory to install into (install target, usually /star/java)-->
   <property name="star.install" value="${star.dir}"/>
 
   <!-- Directory that contains the Starlink jar tree -->
-  <property name="star.jar.dir" value="${star.dir}/lib"/>
+  <property name="star.jar.dir" value="${star.dir}"/>
 
   <!-- Directory that contains the locally built sources (usually
    !   /star/java/source for full distribution) -->
@@ -83,9 +77,9 @@
    !-->
 
   <!-- Define the package name and current versions -->
-  <property name="Name" value="TTOOLS"/>
-  <property name="name" value="ttools"/>
-  <property name="version" value="3.5-2"/>
+  <property name="Name" value="Starjava TTOOLS"/>
+  <property name="name" value="starlink-ttools"/>
+  <property name="version" value="3.5.2"/>
 
   <!-- The Java package name -->
   <property name="package.name" value="uk.ac.starlink.ttools"/>
@@ -238,32 +232,71 @@
    !   1.4 is no longer used the extclasspath type can be replaced by a simple
    !   path.
    !-->
-  <extclasspath id="installed.classpath">
-
-    <!-- UTIL -->
-    <pathelement location="${star.jar.dir}/util/util.jar"/>
-
-    <!-- TABLE -->
-    <pathelement location="${star.jar.dir}/table/table.jar"/>
-
-    <!-- FITS -->
-    <pathelement location="${star.jar.dir}/fits/fits.jar"/>
-
-    <!-- VOTABLE -->
-    <pathelement location="${star.jar.dir}/votable/votable.jar"/>
+  <path id="installed.classpath">
+    <pathelement location="${star.jar.dir}/starlink-util.jar"/>
+    <pathelement location="${star.jar.dir}/starlink-table.jar"/>
+    <pathelement location="${star.jar.dir}/starlink-tjoin.jar"/>
+    <pathelement location="${star.jar.dir}/starlink-fits.jar"/>
+    <pathelement location="${star.jar.dir}/starlink-votable.jar"/>
+    <pathelement location="${star.jar.dir}/starlink-pal.jar"/>
+    <pathelement location="${star.jar.dir}/starlink-registry.jar"/>
+    <pathelement location="${star.jar.dir}/starlink-vo.jar"/>
+    <pathelement location="${star.jar.dir}/starlink-task.jar"/>
+    <pathelement location="${star.jar.dir}/starlink-tfcat.jar"/>
+    <pathelement location="${star.jar.dir}/starlink-dpac.jar"/>
+    <pathelement location="${star.jar.dir}/jel.jar"/>
+    <pathelement location="${star.jar.dir}/adql.jar"/>
+    <pathelement location="${star.jar.dir}/jsamp.jar"/>
+    <pathelement location="${star.jar.dir}/fits.jar"/>
+    <pathelement location="${star.jar.dir}/cds.moc.jar"/>
+    <pathelement location="${star.jar.dir}/eag-healpix.jar"/>
+    <pathelement location="${star.jar.dir}/skyview.jar"/>
+    <pathelement location="${star.jar.dir}/itext.jar"/>
+    <pathelement location="${star.jar.dir}/net.sourceforge.jlibeps.jar"/>
+    <pathelement location="${star.jar.dir}/jlatexmath.jar"/>
+    <pathelement location="${star.jar.dir}/jide-oss.jar"/>
+    <pathelement location="${star.jar.dir}/json.jar"/>
+    <pathelement location="${star.jar.dir}/commons-io.jar"/>
+    <pathelement location="${star.jar.dir}/org.jfree.svg.jar"/>
+    <pathelement location="${star.jar.dir}/servlet-api.jar"/>
+    <pathelement location="/usr/lib/jvm/default-java/lib/tools.jar"/>
+  </path>
 
-  </extclasspath>
+  <path id="jar.classpath">
+    <pathelement location="${dist.lib.pkg}/starlink-util.jar"/>
+    <pathelement location="${dist.lib.pkg}/starlink-table.jar"/>
+    <pathelement location="${dist.lib.pkg}/starlink-tjoin.jar"/>
+    <pathelement location="${dist.lib.pkg}/starlink-fits.jar"/>
+    <pathelement location="${dist.lib.pkg}/starlink-votable.jar"/>
+    <pathelement location="${dist.lib.pkg}/starlink-pal.jar"/>
+    <pathelement location="${dist.lib.pkg}/starlink-registry.jar"/>
+    <pathelement location="${dist.lib.pkg}/starlink-vo.jar"/>
+    <pathelement location="${dist.lib.pkg}/starlink-task.jar"/>
+    <pathelement location="${dist.lib.pkg}/starlink-tfcat.jar"/>
+    <pathelement location="${dist.lib.pkg}/starlink-dpac.jar"/>
+    <pathelement location="${dist.lib.pkg}/jel.jar"/>
+    <pathelement location="${dist.lib.pkg}/adql.jar"/>
+    <pathelement location="${dist.lib.pkg}/jsamp.jar"/>
+    <pathelement location="${dist.lib.pkg}/fits.jar"/>
+    <pathelement location="${dist.lib.pkg}/cds.moc.jar"/>
+    <pathelement location="${dist.lib.pkg}/eag-healpix.jar"/>
+    <pathelement location="${dist.lib.pkg}/skyview.jar"/>
+    <pathelement location="${dist.lib.pkg}/itext.jar"/>
+    <pathelement location="${dist.lib.pkg}/net.sourceforge.jlibeps.jar"/>
+    <pathelement location="${dist.lib.pkg}/jlatexmath.jar"/>
+    <pathelement location="${dist.lib.pkg}/jide-oss.jar"/>
+    <pathelement location="${dist.lib.pkg}/json.jar"/>
+    <pathelement location="${dist.lib.pkg}/commons-io.jar"/>
+    <pathelement location="${dist.lib.pkg}/org.jfree.svg.jar"/>
+    <pathelement location="${dist.lib.pkg}/servlet-api.jar"/>
+  </path>
 
   <!-- Local build system jar files.
    !
    !   Name all the jar files of other packages that we depend on, which have
    !   not been installed (should be same packages as in installed.classpath).
    !-->
-  <extclasspath id="built.jarpath">
-
-    <pathelement location="${star.build.dir}/util/lib/util/util.jar"/>
-    <pathelement location="${star.build.dir}/table/lib/table/table.jar"/>
-  </extclasspath>
+  <path id="built.jarpath"/>
 
   <!-- Find all local third party jars files.
    !
@@ -272,6 +305,7 @@
    !   cannot be addressed. They are installed with the package jar files and
    !   should be entered into the main jar file manifest.
    !-->
+  <mkdir dir="${src.jars.dir}"/>
   <path id="package.jars">
      <fileset dir="${src.jars.dir}">
         <include name="*.jar"/>
@@ -351,14 +385,16 @@
    !   located there. The full classpath is also used.
    !-->
  <path id="tests-classpath">
+    <pathelement location="${star.jar.dir}/junit.jar"/>
+    <pathelement location="${star.jar.dir}/healpix.jar"/>
+    <pathelement location="${star.jar.dir}/jython.jar"/>
     <pathelement location="${build.classes}"/>
     <pathelement location="${build.tests}"/>
     <pathelement location="${tests.dir}"/>
     <pathelement location="${tests.etc.dir}"/>
     <pathelement location="${build.etc}"/>
-    <fileset dir="src/testlib" includes="*.jar"/>
-    <fileset dir="${src.downloads.dir}" includes="*.jar"/>
     <path refid="classpath"/>
+    <pathelement location="${star.jar.dir}/${name}.jar"/>
   </path>
 
   <!-- Turn this path into a string which is passed to the tests -->
@@ -453,7 +489,8 @@
            destdir="${build.classes}"
            debug="${debug}"
            deprecation="${deprecation}"
-           source="${source.version}"
+           encoding="cp1252"
+           includeantruntime="false"
            optimize="${optimize}">
       <compilerarg value="-Xlint:all,-path,-serial"/>
 
@@ -555,7 +592,7 @@
              sourcepath="${java.dir}"
              packagenames="uk.ac.starlink.ttools.func"
              classpathref="classpath"
-             source="${source.version}"/>
+             encoding="cp1252"/>
 
     <!-- Write and compile JyStilts module source code. -->
     <echo message="Generating stilts.py"/>
@@ -579,7 +616,7 @@
           logerror="yes">
       <classpath refid="classpath"/>
       <sysproperty key="java.awt.headless" value="true"/>
-      <arg value="${src.jars.dir}/jlatexmath.jar"/>
+      <arg value="${star.jar.dir}/jlatexmath.jar"/>
     </java>
   </target>
 
@@ -642,11 +679,16 @@
     <!-- Create the library jar file, ttools.jar.
      !   This excludes any GPL-encumbered parts. -->
     <mkdir dir="${dist.lib.pkg}"/>
+    <manifestclasspath property="jar.class.path"
+                       jarfile="${dist.lib.pkg}/${name}.jar">
+      <classpath refid="jar.classpath" />
+    </manifestclasspath>
     <jar destfile="${dist.lib.pkg}/${name}.jar">
       <fileset dir="${build.classes}"
                excludes="uk/ac/starlink/ttools/gpl/*
                          uk/ac/starlink/ttools/gpl"/>
       <fileset dir="${build.javadocs}"/>
+      <fileset dir="${build.etc}"/>
       <manifest>
         <attribute name="Built-By" value="${user.name}"/>
         <attribute name="Class-Path" value="${jar.class.path}"/>
@@ -679,19 +721,6 @@
       </manifest>
     </jar>
 
-    <!-- Sign all jar files -->
-    <antcall target="signjars"/>
-  </target>
-
-  <target name="signjars" if="sign.jars">
-    <signjar alias="${webstart.alias}"
-             keystore="${webstart.keystore}"
-             keypass="${webstart.keypass}"
-             storepass="${webstart.storepass}">
-      <fileset dir="${dist.lib}"
-               includes="**/*.jar **/*.zip"
-               excludes="**/stilts.jar **/stilts-app.jar **/stilts_jars.zip"/>
-    </signjar>
   </target>
 
   <!--
@@ -1151,14 +1180,14 @@
 
       <!-- Get a list of directories that name all the potential
        !   java packages -->
-      <packageset dir="${java.dir}" defaultexcludes="yes">
-         <include name="**"/>
+      <fileset dir="${java.dir}" defaultexcludes="yes">
+         <include name="**/*.java"/>
          <exclude name="uk/ac/starlink/ttools/build"/>
 	 <exclude name="uk/ac/starlink/ttools/cone/HtmTiling.java"/>
 	 <exclude name="uk/ac/starlink/ttools/task/StiltsServer.java"/>
 	 <exclude name="uk/ac/starlink/ttools/server/*.java"/>
 	 <exclude name="uk/ac/starlink/ttools/mode/PlasticMode.java"/>
-      </packageset>
+      </fileset>
 
       <!-- Link to the full Java API at SUNs website -->
       <link offline="true" href="${javaapi.url}"
@@ -1661,7 +1690,7 @@
    !   =================
    !-->
   <target name="compile-tests"
-          depends="build, download"
+          depends="build"
           if="junit.present">
 
     <mkdir dir="${build.tests}"/>
@@ -1669,12 +1698,15 @@
     <javac srcdir="${tests.dir}"
            destdir="${build.tests}"
            debug="${debug}"
-           source="${source.version}"
+           encoding="cp1252"
+           includeantruntime="false"
            deprecation="${deprecation}" >
 
       <classpath refid="tests-classpath"/>
 
       <exclude name="uk/ac/starlink/ttools/task/TableMatch1Test.java"/>
+      <exclude name="uk/ac/starlink/ttools/mode/ReflectionTest.java"/>
+      <exclude name="uk/ac/starlink/ttools/DocTest.java"/>
     </javac>
 
   </target>
@@ -1729,6 +1761,8 @@
       <sysproperty key="basedir" value="${basedir}"/>
       <sysproperty key="xdoc.etc" value="${xdoc.etc}"/>
       <sysproperty key="plot2.figdata.dir" value="${plot2.figdata.dir}"/>
+      <sysproperty key="python.cachedir" value="${build.dir}/tmp"/>
+      <sysproperty key="python.path" value="/usr/lib/site-python:/usr/share/jython/Lib"/>
 
       <formatter type="brief" usefile="false"/>
 
@@ -1737,6 +1771,8 @@
           <include name="**/*Test.java"/>
           <exclude name="**/net_tests/*"/>
           <exclude name="uk/ac/starlink/ttools/task/TableMatch1Test.java"/>
+          <exclude name="uk/ac/starlink/ttools/mode/ReflectionTest.java"/>
+          <exclude name="uk/ac/starlink/ttools/DocTest.java"/>
         </fileset>
       </batchtest>