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

package info (click to toggle)
starjava-tfcat 1.0%2B2024.08.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 416 kB
  • sloc: java: 1,810; xml: 416; makefile: 26
file content (171 lines) | stat: -rw-r--r-- 5,962 bytes parent folder | download
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
From: Ole Streicher <olebole@debian.org>
Date: Wed, 12 Oct 2022 15:55:37 +0200
Subject: Fix build.xml for use outside of starjava

---
 build.xml | 59 +++++++++++++++++++++++++++++++----------------------------
 1 file changed, 31 insertions(+), 28 deletions(-)

diff --git a/build.xml b/build.xml
index 4fb7d0b..8650690 100644
--- a/build.xml
+++ b/build.xml
@@ -33,11 +33,6 @@
 
 <project name="Build file for TFCAT" 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 -->
@@ -50,13 +45,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) -->
@@ -77,8 +72,8 @@
    !-->
 
   <!-- Define the package name and current versions -->
-  <property name="Name" value="TFCAT"/>
-  <property name="name" value="tfcat"/>
+  <property name="Name" value="Starjava TFCAT"/>
+  <property name="name" value="starlink-tfcat"/>
   <property name="version" value="1.0"/>
 
   <!-- The Java package name -->
@@ -114,6 +109,7 @@
   <!-- Directory containing any third-party jars that should be
    !   distributed (normally these would belong in a proper package)-->
   <property name="src.jars.dir" value="${src.dir}/lib"/>
+  <mkdir dir="${src.jars.dir}"/>
 
   <!-- Directory containing any JNI source code -->
   <property name="src.jni.dir" value="${src.dir}/jni"/>
@@ -196,16 +192,25 @@
    !   1.4 is no longer used the extclasspath type can be replaced by a simple
    !   path.
    !-->
-  <extclasspath id="installed.classpath">
-  </extclasspath>
+  <path id="installed.classpath">
+    <pathelement location="${star.jar.dir}/json.jar"/>
+    <pathelement location="${star.jar.dir}/commons-io.jar"/>
+    <pathelement location="${star.jar.dir}/unity.jar"/>
+  </path>
+
+  <path id="jar.classpath">
+    <pathelement location="${dist.lib.pkg}/json.jar"/>
+    <pathelement location="${dist.lib.pkg}/commons-io.jar"/>
+    <pathelement location="${dist.lib.pkg}/unity.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">
-  </extclasspath>
+  <path id="built.jarpath">
+  </path>
 
   <!-- Find all local third party jars files.
    !
@@ -296,12 +301,14 @@
    !   we also add tests.dir and tests.etc.dir so that resources may be
    !   located there. The full classpath is also used.
    !-->  
- <path id="tests-classpath">
+  <path id="tests-classpath">
+    <pathelement location="${star.jar.dir}/junit.jar"/>
     <pathelement location="${build.classes}"/>
     <pathelement location="${build.tests}"/>
     <pathelement location="${tests.dir}"/>
     <pathelement location="${tests.etc.dir}"/>
     <path refid="classpath"/>
+    <pathelement location="${star.jar.dir}/${name}.jar"/>
   </path>
 
   <!-- Turn this path into a string which is passed to the tests -->
@@ -372,7 +379,8 @@
            destdir="${build.classes}"
            debug="${debug}"
            deprecation="${deprecation}"
-           source="${source.version}"
+           encoding="cp1252"
+           includeantruntime="false"
            optimize="${optimize}">
       <compilerarg value="-Xlint:all,-path,-serial"/>
 
@@ -390,7 +398,7 @@
      !   (i.e. are discovered using "getResource()"). -->
   <!--
     <copy todir="${build.classes}">
-      <fileset dir="${java.dir}">
+      <fileset dir="${java.dir}" includes="[none]">
         <include name="**/{package.support.files}"/>
         <include name="**/{more.package.support.files}"/>
       </fileset>
@@ -427,6 +435,10 @@
           description="-> creates the package jar file(s)">
 
     <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"
          basedir="${build.classes}">
       <manifest>
@@ -436,16 +448,6 @@
       </manifest>
     </jar>
 
-    <!-- Sign all jar files -->
-    <antcall target="signjars"/>
-  </target>
-
-  <target name="signjars" if="sign.jars">
-    <signjar jar="${dist.lib.pkg}/${name}.jar"
-             alias="${webstart.alias}"
-             keystore="${webstart.keystore}"
-             keypass="${webstart.keypass}"
-             storepass="${webstart.storepass}"/>
   </target>
 
   <!--
@@ -882,7 +884,7 @@
              windowtitle="${Name} API"
              doctitle="${Name}"
              defaultexcludes="yes"
-             source="${source.version}"
+             encoding="cp1252"
              classpathref="classpath">
       <arg value="-Xdoclint:all,-missing"/>
       <arg value="-quiet"/>
@@ -967,7 +969,8 @@
     <javac srcdir="${tests.dir}"
            destdir="${build.tests}"
            debug="${debug}"
-           source="${source.version}"
+           encoding="cp1252"
+           includeantruntime="false"
            deprecation="${deprecation}" >
 
       <classpath refid="tests-classpath"/>