New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reintroduce compileElements/projectInternalView #23477
Comments
Here is the use case jzrebiec/jvm-test-suite-issue@1ba571a from the issue #24050 |
I filed #25269, but it was closed as a duplicate of this issue. I don't understand why it's considered a duplicate, but the developer who closed it said to add my use case(s) here. When it was closed, the developer said: "Your test suite with a dependency on project() can see the api transitive dependencies of the main component at compilation time and the implementation transitive dependencies of the main component at runtime. If your test uses json, explicitly declare the dependency in your test suite while the linked issue is unsolved." But in fact, the test suites cannot see any of the dependencies in project(), nor any of the classes under src/main/java, which was the whole point of filing the issue. It's really simple to reproduce. Just unzip this, and try to run the command in the readme: |
Here's another example. |
I checked the codebase for Gradle, and while there are several unit tests that verify dependencies in test suites, there aren't any that actually try to build a project that uses test suites. If you add tests that try to build, they'll fail the same as the zipped examples posted here. |
an irrelevant answer |
Blocked until 1.9.20 of KMP is released |
Any update on this? KMP 1.9.20 was already released. And how is kotlin multiplatform related to this fix? |
I tried to move to a jvm-test-suite based solution for integration tests and while implementation project() adds the main classes, none of the dependencies are added to the test suite. Having to duplicate the dependencies for the test suites seems like an obvious problem to me. I'll ditto the previous commenter: what does KMP have to do with this? |
@matsandreassen The workaround for your problem is to extend the integration test configuration from the project one e.g. configurations["testIntegrationImplementation"].extendsFrom(configurations.implementation.get()) if you use annotationProcesor or runtimeonly dependencies, you can also extend them e.g. configurations["testIntegrationAnnotationProcessor"].extendsFrom(configurations.annotationProcessor.get()) |
In 7.6 and 8.0, we backed out changes to introduce a dependency-management based way of getting access to a module for testing.
We should find a way to reintroduce this or define some steps we can take to reintroduce this feature.
See
The text was updated successfully, but these errors were encountered: