Greetings to Gradle team and community, and, using the occasion — thank you all for that great instrument. It’s promising, and I’ve been recently trying the waters and looking for ways to adopt it for C++ build management. That said, I’m new to Gradle (in fact, to declarative systems in general), and I’m prone to stumble on seemingly simple things.
I’ve a question about dependencies between local static libraries. I’m attempting to separate certain fragments of project into libraries, and now I stand before the task of specifying dependencies between those libraries, as opposed to dependencies between them and executable component. Here’s a minimalistic snippet of build file:
apply plugin: 'cpp'
sources {
sample {}
samplelib1 {}
samplelib2 {}
}
libraries {
samplelib1 {
source sources.samplelib1
binaries.all {
lib libraries.samplelib2.static
}
}
samplelib2 {
source sources.samplelib2
}
}
executables {
sample {
source sources.sample
binaries.all {
lib libraries.samplelib1.static
}
}
}
Here, ‘sample’ executable component depends on ‘samplelib1’, which, in turn, should depend on ‘samplelib2’ — from how I imagined it, dependency should provide paths to headers of ‘samplelib2’ to ‘samplelib1’ and also imply that executable component, through the sole library it uses, also should receive dependency on the second library for linkage. I tried to specify it as above, by making ‘binaries’ section under ‘libraries.samplelib1’, but got the following:
A problem occurred configuring root project 'Sample'.
> Failed to notify action.
> No static library binary available for library 'samplelib2' with flavor 'default'
I’ve also tried to specify it as source-level dependency as described in user guide, but result was the same. I intend to, but haven’t yet tried to carry the libraries into subprojects (as in, ‘project(":samplelib2") { …’), but it seems artificial and excessive for the purpose. Is there a mistake in configuration I’ve made, or simpler way to specify inter-library dependencies I haven’t found? Or, if there are none, are there any plans for it? I’ll be grateful for an answer, and thank you in advance.
P.S.: I’m using latest nightly build for trying all of the above, 1.9-20130823221729+0000 at the time of writing.