Commit b3b68741 authored by Ole Streicher's avatar Ole Streicher

Reorder classpath to make sure local classes are found before original

parent c335cb4e
......@@ -21,11 +21,11 @@ This includes the following changes:
* Don't sign the jarfile
---
build.xml | 73 +++++++++++++++++++++++++--------------------------------------
1 file changed, 29 insertions(+), 44 deletions(-)
build.xml | 75 ++++++++++++++++++++++++---------------------------------------
1 file changed, 29 insertions(+), 46 deletions(-)
diff --git a/build.xml b/build.xml
index 00c4e1f..c37f085 100644
index 00c4e1f..feb75a8 100644
--- a/build.xml
+++ b/build.xml
@@ -37,12 +37,6 @@
......@@ -68,7 +68,7 @@ index 00c4e1f..c37f085 100644
<property name="version" value="0.1"/>
<!-- The Java package name -->
@@ -193,25 +187,24 @@
@@ -193,25 +187,22 @@
! class files in preference to installed ones (an extra user-define
! defined CLASSPATH can also be used as needed).
!-->
......@@ -82,33 +82,33 @@ index 00c4e1f..c37f085 100644
-
- <!-- Array -->
- <pathelement location="${star.jar.dir}/array/array.jar"/>
+ <path id="installed.classpath">
-
- <!-- Table -->
- <pathelement location="${star.jar.dir}/table/table.jar"/>
+ <pathelement location="${star.jar.dir}/junit.jar"/>
+ <pathelement location="${star.jar.dir}/fits.jar"/>
-
- <!-- Util -->
- <pathelement location="${star.jar.dir}/util/util.jar"/>
+ <path id="installed.classpath">
+ <pathelement location="${star.jar.dir}/starlink-array.jar"/>
+ <pathelement location="${star.jar.dir}/starlink-table.jar"/>
+ <pathelement location="${star.jar.dir}/starlink-util.jar"/>
- <!-- Util -->
- <pathelement location="${star.jar.dir}/util/util.jar"/>
+ <pathelement location="${star.jar.dir}/fits.jar"/>
+ <pathelement location="${star.jar.dir}/junit.jar"/>
+ </path>
- </extclasspath>
+ <path id="jar.classpath">
+ <pathelement location="${dist.lib.pkg}/fits.jar"/>
+ <pathelement location="${dist.lib.pkg}/starlink-util.jar"/>
+ <pathelement location="${dist.lib.pkg}/starlink-array.jar"/>
+ <pathelement location="${dist.lib.pkg}/starlink-table.jar"/>
+ <pathelement location="${dist.lib.pkg}/fits.jar"/>
+ </path>
+
<!-- Generate the local build classpath. This is the most difficult
! part of handling the classpath. The local classes will be in
! the "build/classes" part of each package, plus third party
@@ -228,15 +221,7 @@
@@ -228,15 +219,7 @@
! doesn't work as expected add the additional classes/jars to
! the extra classpath.
!-->
......@@ -125,7 +125,7 @@ index 00c4e1f..c37f085 100644
<path id="built.classpath">
@@ -281,6 +266,7 @@
@@ -281,6 +264,7 @@
<pathelement location="${tests.dir}"/>
<pathelement location="${tests.etc.dir}"/>
<path refid="classpath"/>
......@@ -133,7 +133,7 @@ index 00c4e1f..c37f085 100644
</path>
<!-- Turn this path into a string which is passed to the tests -->
@@ -374,7 +360,8 @@
@@ -374,7 +358,8 @@
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
......@@ -143,7 +143,7 @@ index 00c4e1f..c37f085 100644
optimize="${optimize}">
<classpath refid="classpath"/>
@@ -405,6 +392,10 @@
@@ -405,6 +390,10 @@
description="-> creates the package jar file">
<mkdir dir="${dist.lib.pkg}"/>
......@@ -154,7 +154,7 @@ index 00c4e1f..c37f085 100644
<jar destfile="${dist.lib.pkg}/${name}.jar"
basedir="${build.classes}">
<manifest>
@@ -415,13 +406,6 @@
@@ -415,13 +404,6 @@
<zip destfile="${dist.lib.pkg}/${name}_src.zip" basedir="${java.dir}"/>
......@@ -168,7 +168,7 @@ index 00c4e1f..c37f085 100644
</target>
<!--
@@ -802,7 +786,7 @@
@@ -802,7 +784,7 @@
windowtitle="${Name} API"
doctitle="${Name}"
defaultexcludes="yes"
......@@ -177,7 +177,7 @@ index 00c4e1f..c37f085 100644
classpathref="classpath">
<!-- Get a list of directories that name all the potential
@@ -888,7 +872,8 @@
@@ -888,7 +870,8 @@
<javac srcdir="${tests.dir}"
destdir="${build.tests}"
debug="${debug}"
......
......@@ -2,15 +2,48 @@ From: Ole Streicher <olebole@debian.org>
Date: Mon, 20 Feb 2017 13:28:16 +0100
Subject: Use latest nom.tam.fits API
Unfortunately, nom.tam.fits (at least until release 1.15.1) re-orders
the header before writing, so that they conform to FITS version 2.
Specifically this puts the `EXTEND` header directly after the `NAXIS*`
headers.
The FITS-PLUS format created in starjava-votable however requires
additional keywords between `NAXIS*` and `EXTEND`. This is a bit
unfortunate, unflexible, and violated the FITS standard when the
FITS-PLUS format was created, but since FITS version 3 the keyword
order does not matter anymore. So, this patch also includes an
alternative `nom.tam.fits.HeaderOrder` class that leaves the order as
it is. This is also the current proposal on the according nom-tam-fits
pull request:
https://github.com/nom-tam-fits/nom-tam-fits/issues/114
Depending on the result of the PR, this patch may be simplified.
---
src/main/nom/tam/fits/HeaderOrder.java | 8 ++++++++
.../uk/ac/starlink/fits/AbstractArrayDataIO.java | 4 ++++
src/main/uk/ac/starlink/fits/FitsConstants.java | 6 +++---
src/main/uk/ac/starlink/fits/FitsTableBuilder.java | 4 ++--
src/main/uk/ac/starlink/fits/MappedFile.java | 23 +++++++++++++++++++++-
src/main/uk/ac/starlink/fits/MultiMappedFile.java | 21 ++++++++++++++++++++
.../uk/ac/starlink/fits/WritableFitsArrayImpl.java | 2 +-
6 files changed, 53 insertions(+), 7 deletions(-)
7 files changed, 61 insertions(+), 7 deletions(-)
create mode 100644 src/main/nom/tam/fits/HeaderOrder.java
diff --git a/src/main/nom/tam/fits/HeaderOrder.java b/src/main/nom/tam/fits/HeaderOrder.java
new file mode 100644
index 0000000..a9835b4
--- /dev/null
+++ b/src/main/nom/tam/fits/HeaderOrder.java
@@ -0,0 +1,8 @@
+package nom.tam.fits;
+
+public class HeaderOrder implements java.util.Comparator<String> {
+ @Override
+ public int compare(String c1, String c2) {
+ return 0;
+ }
+}
diff --git a/src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java b/src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java
index 24065f6..8b81173 100644
--- a/src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment