将 c++ cmake-library 构建发布到本地存储库时出现 Gradle 错误

Gradle Error while publishing c++ cmake-library build to local repo

本文关键字:存储 错误 Gradle cmake-library c++ 构建      更新时间:2023-10-16

尝试将示例 cmake-library 项目发布到本地存储库。 尝试使用 Maven-publish 插件和 org.gradle.samples.custom-publication 但都失败了。

预期行为

期望 cmake 特定库(列表(成功发布到本地目录存储库。

当前行为

Execution failed for task ':list:generateMetadataFileForMainPublication'.
Invalid publication 'main':
- Variants 'debugLink' and 'releaseLink' have the same attributes and capabilities. 
Please make sure either attributes or capabilities are different.
- Variants 'debugRuntime' and 'releaseRuntime' have the same attributes and 
capabilities. Please make sure either attributes or capabilities are different.

上下文

我正在尝试做的事情是将我们当前的 c++ 第三方依赖项(主要使用 cmake(发布到任何 gradle 兼容存储库,以便它可以被我们的主 c++ 项目或任何其他项目使用。

重现步骤(针对错误(

只需在 cmake-library 根目录中启动发布命令

./gradlew publish

环境

  • 构建扫描网址:https://scans.gradle.com/s/2ot6auxbnq4qy

此问题已在 gradle 本机示例存储库的最新提交中修复。 您可以看到回复。只需拉取最新的提交!!