Hello
I have a use case where I would like to specify dependencies that have an additional property. Technically, this property is just a set of strings. I’m imagining to specify it like so:
dependencies {
myDepCfg(
group: 'org...',
name: 'myName',
version: '1.0.0',
modules: ['foo', 'blah'])
}
The modules
property should be readable by tasks (or wherever in a script) to get the set of strings for further processing. If you now think that looks like a dependency specification, yes, modules
is a simple form of what I would call an inlined, externally resolved dependency specification - they are resolved outside of Gradle (i.e., not as part of a dependency resolve mechanism at build-time by Gradle). Also, note that I just need an identifying string in this case, no separate version, group, or the like; and it’s also not required to specify transitive dependencies.
Is that possible? If so, what would be the steps (roughly) to achieve that? I have seen the classes Dependency and ModuleDependency, and I have already started to create a new interface that extends the two, but I can’t find out how to build it up altogether.
Any help appreciated.
Thorsten