gradle / gradle-native

The home of Gradle's support for natively compiled languages
https://blog.gradle.org/introducing-the-new-cpp-plugins
Apache License 2.0
93 stars 8 forks source link

Publish the binaries of a C++ library built for multiple operating systems and architectures to a Maven repository #241

Open adammurdoch opened 7 years ago

adammurdoch commented 7 years ago

Currently, the metadata that is published for C++ libraries does not include any information about the target operating system version and machine architecture, so that Gradle will attempt to use whatever binaries it finds in the repository regardless of whether they will be useable or not.

Implement just enough to allow a C++ library built for multiple OS/architecture variants can be published tp and safely consumed from a Maven repository.

Potentially this feature could be split into several pieces:

  1. Use the OS and architecture information that the C++ plugins already know during publishing and dependency resolution, but still publish only binaries and metadata for the current platform. This will already be an improvement in that dependency resolution will fail when the binaries for a library are not compatible with the target OS/architecture.
  2. Allow build logic to declare just enough about the target OS/architecture variants to include this in the published metadata. This wouldn't mean full support for building anything more than for the current platform. This might be something as simple as a hook to mess with the generated metadata file prior to publishing.
  3. Improve support for building and publishing multiple OS/architecture variants. For example, it should be possible to build and publish x64 and x86 binaries from a single build. Cross-compilation would be out of scope.
adammurdoch commented 7 years ago

I've changed this to an epic and will split out some issues for it.