Skip to content

Fix Task.getProject() deprecation at execution time - #40

Merged
Besi97 merged 2 commits into
mainfrom
fix/task-getproject-deprecation
Aug 4, 2026
Merged

Besi97 merged 2 commits into
mainfrom
fix/task-getproject-deprecation

Conversation

@Besi97

@Besi97 Besi97 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Gradle deprecated calling Task.getProject() at execution time, which will become an error in Gradle 10.0. This API is incompatible with the configuration cache, which will be the only supported mode in future Gradle versions.

The GraphQLCodegenGradleTask was calling getProject() during task execution to access the project directory and source set resources. The fix injects ProjectLayout via the task constructor, which is the configuration-cache-safe way to access project-related information.

Closes: #37
Closes: #1

Inject ProjectLayout service instead of calling getProject() during task
execution to comply with configuration cache requirements and avoid Gradle
10.0 deprecation error.

Closes: #37
@Besi97
Besi97 force-pushed the fix/task-getproject-deprecation branch from d25094a to 5924481 Compare August 4, 2026 15:22
@Besi97
Besi97 merged commit c17a4c1 into main Aug 4, 2026
3 checks passed
@Besi97
Besi97 deleted the fix/task-getproject-deprecation branch August 4, 2026 15:42
@Besi97 Besi97 added the enhancement New feature or request label Aug 4, 2026
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

Successfully merging this pull request may close these issues.

Fix deprecation: Task.getProject() at execution time (Gradle 10.0) Usage of Task.project prevents use of configuration cache

1 participant