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

Project isolation support regression #302

Open
ZacSweers opened this issue Dec 30, 2023 · 2 comments
Open

Project isolation support regression #302

ZacSweers opened this issue Dec 30, 2023 · 2 comments

Comments

@ZacSweers
Copy link
Contributor

Trying project isolation again with 0.9.1, I see the following error

org.gradle.api.InvalidUserCodeException: Cannot access project ':app' from project ':'
	at org.gradle.configurationcache.problems.DefaultProblemFactory$problem$1$build$diagnostics$1.get(DefaultProblemFactory.kt:79)
	at org.gradle.configurationcache.problems.DefaultProblemFactory$problem$1$build$diagnostics$1.get(DefaultProblemFactory.kt:79)
	at org.gradle.internal.problems.DefaultProblemDiagnosticsFactory$DefaultProblemStream.getImplicitThrowable(DefaultProblemDiagnosticsFactory.java:147)
	at org.gradle.internal.problems.DefaultProblemDiagnosticsFactory$DefaultProblemStream.forCurrentCaller(DefaultProblemDiagnosticsFactory.java:136)
	at org.gradle.configurationcache.problems.DefaultProblemFactory$problem$1.build(DefaultProblemFactory.kt:79)
	at org.gradle.configurationcache.ProblemReportingCrossProjectModelAccess$ProblemReportingProject.reportCrossProjectAccessProblem(ProblemReportingCrossProjectModelAccess.kt:1120)
	at org.gradle.configurationcache.ProblemReportingCrossProjectModelAccess$ProblemReportingProject.reportCrossProjectAccessProblem$default(ProblemReportingCrossProjectModelAccess.kt:1111)
	at org.gradle.configurationcache.ProblemReportingCrossProjectModelAccess$ProblemReportingProject.onAccess(ProblemReportingCrossProjectModelAccess.kt:1044)
	at org.gradle.configurationcache.ProblemReportingCrossProjectModelAccess$ProblemReportingProject.getPlugins(ProblemReportingCrossProjectModelAccess.kt:813)
	at com.osacky.doctor.DoctorPlugin$apply$2.execute(DoctorPlugin.kt:113)
	at com.osacky.doctor.DoctorPlugin$apply$2.execute(DoctorPlugin.kt:90)

The problem appears to be whenPluginAdded: https://github.com/runningcode/gradle-doctor/blob/master/doctor-plugin/src/main/java/com/osacky/doctor/DoctorPlugin.kt#L113-L117

@runningcode
Copy link
Owner

runningcode commented Jan 2, 2024

Thanks for the report. What version of Gradle did you use to reproduce?

Looks like we should check allowBuildingAllAndroidAppsSimultaneously before calling whenPluginAdded in order to allow someone to disable this.
I'll check if there is a different API that is compatible with project isolation that we should use instead of whenPluginAdded.

@consp1racy
Copy link

The problem is target.subprojects.
image

> Project ':' cannot access 'Project.tasks' functionality on subprojects
> Project ':' cannot access 'Project.plugins' functionality on subprojects

source

I'm thinking this should be a settings plugin, which can use gradle.lifecycle.beforeProject since Gradle 8.8. The API is incubating and will probably change (maybe to use IsolatedProject?).

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

No branches or pull requests

3 participants