Is there a Gradle task that shows me the exported ...
# community-support
m
Is there a Gradle task that shows me the exported compile classpath from a project? I don't want the
compileClasspath
of the project, I want what other projects will see when depending on it. Seems like
apiElements
is closer to what I want but it doesn't show any dependencies in
./gradlew dependencies
I could also
./gradlew publishToMavenLocal
and look at the
.module
file but those projects don't necessarily have
maven-publish
applied
v
apiElements
is not "closer", it is exactly what you ask for. 🙂
Your problem with
dependencies
is the
(n)
in the end, which tells you it is not resolvable. 😉
m
Yea exactly
v
Create a resolvable configuration that extends from
apiElements
and resolve that
m
Right. But that requires changes to the build logic
I was hoping there'd be a way to "introspect" that without touching the build logic
v
Use an init script
m
I'm scared of init scripts (and they also touch the build logic, right?)
v
No need to be afraid 🙂 And yes, of course they touch the build logic. But adding an additional configuration should not be too intrusive.
I thought you just don't want to edit the project's files
m
Ideally I would have liked to keep the build logic exactly the same (no need to reconfigure, etc...). That felt like something that is core-enough in the Gradle model that it could be inspectable.
v
Another option is then probably only to create a new build, depend on that project and then resolve there. By that you do not touch that project's build logic
m
Yep, that would work too
v
I don't know whether there is some way over the tooling api maybe 🤷‍♂️
m
In all cases, I own the build, so I can add the configuration there, no pb. Thanks for the reply!
👌 1