imagej / imagej-launcher

The ImageJ native launcher
https://imagej.net/learn/launcher
BSD 2-Clause "Simplified" License
21 stars 23 forks source link

Stop using the NAR plugin #48

Closed ctrueden closed 5 years ago

ctrueden commented 6 years ago

We will now use Travis and AppVeyor to build and deploy the platform-specific native binaries. The bare executables will be deployed using deploy:deploy-file rather than deploying the wrapped NARs.

So we don't really need the .nar files anymore. And we'd really like the main imagej-launcher-x.y.z.nar to actually be named imagej-launcher-x.y.z.jar in the repository, and for Maven to treat it like a normal JAR file instead of a black box packaging type.

We can eliminate use of the NAR plugin completely by migrating the build instructions out of the NAR plugin's configuration in the pom.xml in favor of having individual platform-specific build scripts. This gives us very fine-grained control over exactly how the launcher is built on each platform, as opposed to using CMake, which would be theoretically nice but maybe (in my experience trying it with this specific project) more time-consuming to get right.

Maven-wise, this project would then be structured as a normal pure-Java project, with the native code being built in a separate step by the CI platforms.

stelfrich commented 5 years ago

See progress happening on cmake.

How far would you go with this, @ctrueden? With the current state on the branch you can't follow the standard CMake pattern of mkdir build && cd build && cmake .. since we require e.g. the name of the executable to be set from the outside (where outside mostly means when building with Maven). Should I go ahead and encode the platform logic in the CMakeLists.txt instead of the POM s.t. we are able to call cmake without additional parameters? We will need at least one flag to switch to compilation of 32-bit binaries on 64-bit systems, but we should be able to put the rest into CMake logic..

ctrueden commented 5 years ago

Awesome, thanks for working on it, @stelfrich!

I do not feel strongly about whether CMake should work "out of the box" without Maven. If it can do so, great, but if it is easier to pass needed flags from Maven to CMake, that is OK.

stelfrich commented 5 years ago

Builds work now via the regular mkdir build && cd build && cmake .. pattern as well as from Maven. That is, if you don't provide a target architecture a binary for the architecture you are on is build.