This directory contains scripts needed to build Crypto native code using a Docker image.
The Docker image runs on Ubuntu and includes Maven and cross-compilation tools which are used to build Linux and Windows native code files (see build.sh for the list). The image uses virtual mounts for the source code and Maven repository, so the output of the build is available on the host system and can be included in a subsequent release build.
The binary jar is built from the contents of target/classes, so any additional native objects can be added to the build by copying them to the appropriate directory under target/classes/org/apache/commons/crypto/native before creating the release. For example, the macOS object can be added as target/classes/org/apache/commons/crypto/native/Mac/x86_64/libcommons-crypto.jnilib
cd src/docker docker compose build crypto
cd src/docker docker compose run crypto # run shell; can then use Maven to do builds OR docker compose run --entrypoint src/docker/build.sh crypto # run full build docker compose run --entrypoint src/docker/build_linux32.sh crypto # optionally run linux32 build # N.B. the linux32 build needs an additional install, but that causes linux 64 bit builds to fail.
This is the easiest if the release manager has access to a macOS host.
The steps are:
Now perform the release (don't run mvn clean!)
If the Release Manager (RM) does not have access to a macOS system, they will need to obtain a copy of the macOS native binary from another Commons developer.
The process starts as above, but just before using the host system to build the release, add the macOS binary to the workspace at:
target/classes/org/apache/commons/crypto/native/Mac/x86_64/libcommons-crypto.jnilib
The release can then be created in the normal way.