Why does gradle new configurations `api` exposes i...
# gradle
h
Why does gradle new configurations
api
exposes implementation details and
implementation
hides them? Why are the names confused?
m
Can you explain what you are seeing?
c
you're understanding the terms in reverse 😄
api
is the public stuff that should be "visible",
implementation
is private stuff which does not concern outside world, so it "hides them".
👍 2
g
This feature was introduces, to avoid making your dependencies transitively public to all libraries which are using your lib.
h
I understand them corrcectly. If I declare dependency as
api A
, it should only put
A
in my code classpath, not
B
and
C
that
A
depends on, but it isn't the case.
c
you obviously don't, here are the docs: https://docs.gradle.org/current/userguide/java_library_plugin.html it's not what you import, it's what you export. To avoid importing
B
and
C
you have to use
{ exclude() }
👍 1
h
Okay I get it. Thanks.
🙂 1