Wrapping OpenSSL build using Gradle


I’ve spent a few days trying to setup the autotools / build-wrapper-plugin to compile openssl (3.0.0-alpha14), but am running into a few shortcomings at the current build-wrapper-plugin (native-samples)

So far, I am able to setup tasks to configure, compile and install (assemble) the project into the specific release and debug variants. That part seems to work fine. However, trying to untangle the hairy beast OpenSSL is and to be able to leverage the nice syntax to include the implementation into my own cpp-application plugin, has proven to be a challenge.

I am able to publish the ‘libssl.a’ (static) artifact, and duplicating the same configuration for setting up ‘libssl.so’ (shared object) for both release & debug, and link & runtime configurations. Mostly by changing the DefaultWrappedPublishableComponent class. Then publish said components to a local maven repository.

The OpenSSL project does in fact produce both libssl and libcrypto (two binaries) that I need which seems to break with the maven artifact paradigm, i.e. one project produces exactly 1 resulting artifact. Now, I could stick these under different sub-projects and compile OpenSSL a total of 4 times to get the proper debug and release components, but it seems really redundant. Also, I will need to pick up the headers from (the “api” variant from the release configuration as some of these headers are automatically generated (taking it from the unzipped .tar.gz / include directory) won’t work.

Does anyone have a suggestion to better align the ‘autotools’ / build-wrapper-plugin to do what I am trying to do here? Is it possible to have a project publish multiple components?

Suggestions welcome.