Slackbot
07/20/2023, 6:04 PMTom Koptel
07/20/2023, 6:11 PMTom Koptel
07/20/2023, 6:12 PMMatthew Von-Maszewski
07/20/2023, 6:16 PMMatthew Von-Maszewski
07/20/2023, 6:16 PMMatthew Von-Maszewski
07/20/2023, 6:18 PMTom Koptel
07/20/2023, 6:21 PMMatthew Von-Maszewski
07/20/2023, 6:27 PMMatthew Von-Maszewski
07/20/2023, 6:28 PMMatthew Von-Maszewski
07/20/2023, 6:33 PMTom Koptel
07/20/2023, 6:34 PMMatthew Von-Maszewski
07/20/2023, 6:36 PMMatthew Von-Maszewski
07/20/2023, 6:38 PMVampire
07/20/2023, 6:41 PMMatthew Von-Maszewski
07/20/2023, 6:42 PMVampire
07/20/2023, 6:47 PMMatthew Von-Maszewski
07/20/2023, 6:48 PMTom Koptel
07/20/2023, 6:53 PMVampire
07/20/2023, 6:59 PMSadly, that answer appears to be outside my 90 day window of Slack search.https://www.linen.dev/s/gradle-community has all the history searchable
Once the simple sounding syntax changes were made, nothing worked.Yeah, if it advices to use
implementation
, that is unlucky if the build does not properly declare its dependencies, but depends on transitive libraries being present. I can recommend the https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin plugin that helps you keeping your dependencies in order. For a quick migration without cleaning up the unlucky bad practice, just using api
as replacement would have been better and then maybe cleaning it up, for example with the mentioned plugin.
The “implementation” dependency will NOT appear on the compile or the runtime classpaths of other subprojects.That's just plainly wrong. Well, half-wrong. Yes, it will not be on the compile classpath, that is intended, as it makes for a cleaner design, declaring your dependencies where needed and most importantly greatly decreases compilation speed by smaller compile class paths by not polluting downstream projects unnecessarily. But of course the
implementation
dependencies will be on the runtime classpath of downstream projects. The project needs them at runtime, so they will be present.
If you need something at compile time, but not at runtime, like nullability annotations or similar, then it goes to compileOnly
(or compileOnlyApi
if also downstream projects need them to compile but still not at runtime), becuase those are indeed not part of the runtime classpath.
.pom files only include “implementation” and “runtimeOnly” dependencies. An “api” dependency is not included.That's also just wrong, unless you manually manipulate the pom file to have that result
Therefore sometimes a subproject has the dependency listed twice: once as api so other subprojects have visibility and second as implementation to list dependency in pom.If you really have / need that, something is really f**** up in your build, that is not normal at all and I have never seen such behavior. And I use Gradle since pre-1.0
Warning: there is a high chance of confusion. gradle has two completely different objects/concepts: testFixture without “s” ending and testFixtures with “s”. And they both apply to java tests, though in completely different manner.Please don't blame Gradle. "testFixture" is not a thing in Gradle per-se unless you apply some plugin adding such a thing or adding it yourself. Gradle built-in only "testFixtures" exists.
Vampire
07/20/2023, 7:02 PMVampire
07/20/2023, 7:05 PMMatthew Von-Maszewski
07/20/2023, 7:10 PMVampire
07/20/2023, 7:12 PMMatthew Von-Maszewski
07/20/2023, 7:12 PMVampire
07/20/2023, 7:25 PMMatthew Von-Maszewski
07/20/2023, 7:27 PMMatthew Von-Maszewski
07/20/2023, 7:31 PMMatthew Von-Maszewski
07/20/2023, 7:32 PMVampire
07/20/2023, 7:33 PMVampire
07/20/2023, 7:33 PMMatthew Von-Maszewski
07/28/2023, 8:48 PMVampire
07/28/2023, 10:59 PMMatthew Von-Maszewski
08/23/2023, 5:14 PM