DIPlib / diplib

Quantitative Image Analysis in C++, MATLAB and Python
https://diplib.org
Apache License 2.0
228 stars 50 forks source link

Simplify DIPjavaio build by including a Bio-Formats "stub" jar file in the repo. #157

Closed crisluengo closed 5 months ago

crisluengo commented 6 months ago

I created a file javaio/java/bioformats/bio-formats-stripped.jar that contains the minimal set of .class files needed for the build of BioFormatsInterface.java. This file is used to resolve the references to functions and classes in bioformats_package.jar. Including this file means that:

  1. We don't need to download 40+ MB four times when running the deploy script.
  2. We can build DIPjavaio in CI, but we still can't test it.
  3. Build instructions are a little simpler for the end user.

Possible issues:

  1. Including a binary file in a repo is never nice. But this one is only 93 KB.
  2. Bio-Formats is GPL. But the core code is all 2-clause BSD (I've checked the license notice in the source .java file for each of the included .class files). It is some of the readers and writers (for specific file types) that are GPL. But even if it were GPL, we're not linking to it in outside of DIPjavaio, so this should all be fine.
  3. Future updates to DIPjavaio might reference other classes/functions in Bio-Formats, meaning we'll need to add more .class files back into the .jar file.

What do you think, should we use this or not?

crisluengo commented 5 months ago

Thank you! (You know much, much more about Java than I do.)

I've fixed the NumPy 2.0 thing in the master branch.