Skip to content
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

Support Isolated Projects #1091

Closed
ZacSweers opened this issue Dec 30, 2023 · 3 comments
Closed

Support Isolated Projects #1091

ZacSweers opened this issue Dec 30, 2023 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@ZacSweers
Copy link
Contributor

ZacSweers commented Dec 30, 2023

Is your feature request related to a problem? Please describe.
Currently, project isolation doesn't appear to be supported (or at least it fails the build when project isolation is enabled). This is with 1.28.0 and Gradle 8.5.

org.gradle.api.InvalidUserCodeException: Cannot access project ':' from project ':app'
	...
	at com.autonomousapps.DependencyAnalysisExtensionKt.getExtensionOrNull(DependencyAnalysisExtension.kt:92)
	at com.autonomousapps.DependencyAnalysisPlugin.checkPluginWasAppliedToRoot(DependencyAnalysisPlugin.kt:76)
	at com.autonomousapps.DependencyAnalysisPlugin.apply(DependencyAnalysisPlugin.kt:27)
	at com.autonomousapps.DependencyAnalysisPlugin.apply(DependencyAnalysisPlugin.kt:22)

Describe the solution you'd like

Project isolation support

Describe alternatives you've considered

Additional context

@autonomousapps autonomousapps changed the title Support Project Isolation Support Isolated Projects Jan 3, 2024
@autonomousapps autonomousapps added the enhancement New feature or request label Jan 3, 2024
@autonomousapps autonomousapps added this to the after next milestone Jan 3, 2024
@jjohannes
Copy link
Collaborator

This already works for me if:

The improvement I would like to see next is to not having to use the dependency.analysis.autoapply property, but instead having a dedicated "root project" plugin – e.g. com.autonomousapps.dependency-analysis-root – only for the root project that never does the autoapply.

As a nice-to-have, I would also like to see the plugin working without applying anything to the root. Then you won't have the root tasks (buildHealth) but can still check each project individually (projectHealth) which is sufficient for certain setups (in my experience).

@matejdro
Copy link

I've tried above and the main problem seems to be that with autoapply=false, bundles do not seem to be propagating down to subprojects and I cannot declare them on the subprojects (I get Dependency bundles must be declared in the root project only error).

Which means that with autoapply=false bundles are effectively not working.

@autonomousapps
Copy link
Owner

Regarding this issue in general, I was under the (perhaps mistaken) impression that DAGP already supports IP. A Gradle eng confirmed it several months ago -- but of course it's a pre-incubating feature and maybe the contract has already shifted to be stricter in some way. As such, I will close this issue.

The improvement I would like to see next is to not having to use the dependency.analysis.autoapply property

My plan is to release a 2.0 where this behavior becomes the default, and it's no longer possible to have autoapply from the root. I'm also contemplating a settings plugin that uses the new gradle.lifecycle.beforeProject {} API to enable applying the plugin in just one place and have it work globally.

Which means that with autoapply=false bundles are effectively not working.

This doesn't make any sense. Do you have a reproducer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants