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

Add support for project isolation #1317

Open
NikolayMetchev opened this issue Nov 20, 2024 · 2 comments
Open

Add support for project isolation #1317

NikolayMetchev opened this issue Nov 20, 2024 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@NikolayMetchev
Copy link

Is your feature request related to a problem? Please describe.
I would like to use project isolation in our build and use the dependency analysis gradle plugin
Project isolation is described here:
https://docs.gradle.org/current/userguide/isolated_projects.html

Describe the solution you'd like
Make the necessary changes to make this plugin compliant.

Describe alternatives you've considered
None available

Additional context
Here is the first problem encountered when I tried to use project isolation:

- [error] Project `:buildSrc` cannot access `Project.plugins` functionality on another project `:`
    - plugin 'com.autonomousapps.dependency-analysis'
        - Exception at `com.autonomousapps.services.InMemoryCache$Companion.serviceHoldingBuild(InMemoryCache.kt:76)`
org.gradle.api.InvalidUserCodeException: Project ':buildSrc' cannot access 'Project.plugins' functionality on another project ':'
	at org.gradle.internal.cc.impl.ProblemReportingCrossProjectModelAccess$ProblemReportingProject_Decorated.getPlugins(Unknown Source)
	at com.autonomousapps.services.InMemoryCache$Companion.serviceHoldingBuild(InMemoryCache.kt:76)
	at com.autonomousapps.services.InMemoryCache$Companion.register$dependency_analysis_gradle_plugin(InMemoryCache.kt:90)
	at com.autonomousapps.internal.analyzer.JvmAnalyzer$registerFindDeclaredProcsTask$1.invoke(JvmProjectAnalyzer.kt:72)
	at com.autonomousapps.internal.analyzer.JvmAnalyzer$registerFindDeclaredProcsTask$1.invoke(JvmProjectAnalyzer.kt:71)
	at com.autonomousapps.internal.analyzer.JvmAnalyzer$inlined$sam$i$org_gradle_api_Action$0.execute(TaskContainerExtensions.kt)
	at java.base/java.lang.Iterable.forEach(Iterable.java:74)
	at com.intellij.gradle.toolingExtension.impl.model.warmUp.GradleTaskWarmUpService.lambda$buildAll$2(GradleTaskWarmUpService.java:34)
	at com.intellij.gradle.toolingExtension.impl.util.GradleResultUtil.lambda$runOrRetryOnce$0(GradleResultUtil.java:34)
	at com.intellij.gradle.toolingExtension.impl.util.GradleResultUtil.runOrRetryOnce(GradleResultUtil.java:16)
	at com.intellij.gradle.toolingExtension.impl.util.GradleResultUtil.runOrRetryOnce(GradleResultUtil.java:33)
	at com.intellij.gradle.toolingExtension.impl.model.warmUp.GradleTaskWarmUpService.buildAll(GradleTaskWarmUpService.java:33)
	at com.intellij.gradle.toolingExtension.impl.modelBuilder.ExtraModelBuilder.buildServiceModel(ExtraModelBuilder.java:87)
	at com.intellij.gradle.toolingExtension.impl.modelBuilder.ExtraModelBuilder.buildAll(ExtraModelBuilder.java:67)
	at com.intellij.gradle.toolingExtension.impl.modelBuilder.ExtraModelBuilder.buildAll(ExtraModelBuilder.java:47)
@autonomousapps
Copy link
Owner

This plugin does already support Isolated Projects (Gradle itself has confirmed this, as they use the plugin in their own builds). Do you have a minimal reproducer?

@autonomousapps autonomousapps added bug Something isn't working more information needed labels Nov 21, 2024
@NikolayMetchev
Copy link
Author

Ok. this bug is really strange. It only reproduces in Idea. If you run gradle on its own everything is fine. I have attached a project that when you open in Idea should fail.
deps-bug.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants