Ian Brandt
09/19/2024, 10:02 PMtestImplementation configuration extendsFrom the project's implementation configuration (and in turn, api). However, for any other test suite I add, that's not the case, and the docs show adding an implementation(project()) dependency instead. I believe I understand why the project dependency isn't added automatically, i.e. to give build authors more flexibility for their test suite dependencies. My question is, why a project dependency instead of extending from the project's implementation configuration like the built-in unit test suite does? I'm looking to more thoroughly understand the design difference.tony
09/19/2024, 10:04 PMintegrationTestImplementation(project). Or do you mean why not do that same thing internally with the test source set?ephemient
09/19/2024, 10:07 PMimplementation(project()) for integration test suites, as you're consuming the project more like an external user than an internal one (with access to compileOnly etc.)Ian Brandt
09/19/2024, 10:17 PMtony
09/19/2024, 10:18 PMtony
09/19/2024, 10:20 PMtony
09/19/2024, 10:21 PMproject dependency would I think have the same effect as what KGP is doing without also breaking DAGP, so I'm a big fan!
It would make all the main deps transitive deps in the new source set, rather than directtony
09/19/2024, 10:22 PMIan Brandt
09/19/2024, 10:30 PMassociateWith() (https://kotlinlang.org/docs/gradle-configure-project.html#associate-compiler-tasks). I use that so integration tests can see Kotlin internal elements from the main source set. But that's done automatically for the unit test suite without mutating testImplementation, so why the need to mutate integrationTestImplementation? I'm wondering whether adding an extendsFrom or using the project dependency could satisfy whatever their need is instead, and not break DAGP.Javi
09/20/2024, 11:34 AMephemient
09/20/2024, 1:09 PMtony
09/20/2024, 3:56 PMIan Brandt
09/20/2024, 4:28 PMtest source set to be part of the same module as the main source set, and so they can't access internal API: https://kotlinlang.org/docs/visibility-modifiers.html#local-declarations.
associateWith() is the API KGP offers to make other source sets (or I guess it's compilations) "friends" with the main source set (compilation): https://kotlinlang.org/docs/gradle-configure-project.html#associate-compiler-tasks.Ian Brandt
09/20/2024, 4:45 PMimplementation configuration dependencies KGP is adding to `integrationTestImplementation`: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/issues/1239#issuecomment-2363141328.
I'm not sure whether that'll break something KGP needs. I'll report back.Ian Brandt
09/20/2024, 6:51 PMJustin Van Dort
09/20/2024, 7:51 PMIan Brandt
09/21/2024, 12:10 AM