【发布时间】:2014-06-11 15:02:00
【问题描述】:
我正在使用 native-artifacts 插件,该插件定义了许多任务,这些任务提取在其他地方构建的依赖项的 Nar 依赖项(并存储在 Nexus/Maven 中)。我需要确保在构建二进制文件之前调用这些任务,否则找不到这些 Nars 包含的标头。
我的问题是,如何将系统/插件定义的任务定义为我的一项任务的依赖项?
我想要类似的东西:
binaries.all {binary ->
dependencies {
// this next line is now the same as the plugin-defined task I want to have called before
// before the build takes place
compile "extractNarDeps${binary.name.capitalize()}"
}
}
遗憾的是,这并没有建立。请问我怎样才能做到这一点?我有一个名为 unitTests 的组件,它是一个 C++ 组件,用于创建 unitTestsExecutable。我想在调用 compileUnitTests 之前调用 extractNarDepsxxx。
【问题讨论】:
标签: gradle dependencies task build.gradle