Hey Xav,

This will be tricky and I hope that there's some other avenue than
ResolvedArtifact
API to solve the use case. I might be wrong, perhaps Adam will have better
news :)

There is ResolvedArtifact -> ResolvedDependency -> Configuration, however,
I believe that this contains target configuration and not source
configuration. Not to mention that ResolvedArtifact.resolvedDependency is
deprecated.

Given the current version of Gradle, I don't think this use case can be
satisfied easily. Since you already know which project produced given
artifact (via the build dir convention), in theory, you could inspect that
project's declared artifacts (yuck). Not sure if this would work in
practice - I'm throwing it here as an example.

Ideally, we would like to solve the use on the tooling api level or by
growing the ResolutionResult API. The latter will eventually replace
ResolvedArtifact/ResolvedDependency APIs. It will contain more and more
information about the resolved dependencies.

Hope that helps!


On Tue, Feb 25, 2014 at 12:33 AM, Xavier Ducrohet <x...@google.com> wrote:

> ResolvedArtifact doesn't seem to contain a lot of information about the
> provenance of the artifact.
>
> We're already doing a weird hack to find if an artifact was generated by a
> project (checking if it's in the buildDir of any of the projects) but now
> I'd like to know if the artifact is not the "default" artifact of the
> project.
>
> We need this for IDE integration, in cases where a project publishs more
> than one artifact. In this case we want to not make it a project to project
> dependency in the IDE and instead just be a basic jar dependency (we do
> have some specific use case where our AppEngine plugin publishes a separate
> artifact that's consumed by an Android app but the app engine project
> doesn't even have source code that are the source of the jar file).
>
> Are there any other classes in the dependency stuff that would allow me to
> know where a given artifact is coming from and get detailed information
> about it (configuration at least)?
>
> thanks
> Xavier
>



-- 
Szczepan Faber
Principal engineer@gradle; Founder@mockito

Reply via email to