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

java.sourceSets.main.output.classesDirs no longer depends on the classes task in Gradle 7.6 #22484

Closed
scott-pollom opened this issue Oct 22, 2022 · 2 comments · Fixed by #22498
Assignees
Labels
a:regression This used to work @core Issue owned by GBT Core
Milestone

Comments

@scott-pollom
Copy link

Breaking change starting with Gradle 7.6-20221014231703+0000.

See this AGP bug for context.

java.sourceSets.main.output.classesDirs no longer depends on the classes task.

In the attached bug_repro.zip, running ./gradlew bar --dry-run has the following output with Gradle 7.4:

:compileJava SKIPPED
:foo SKIPPED
:processResources SKIPPED
:classes SKIPPED
:bar SKIPPED

But with Gradle 7.6-20221014231703+0000 it has the following output:

:compileJava SKIPPED
:bar SKIPPED

The issue is that the bar task adds java.sourceSets.main.output.classesDirs to its input, which has a dependency on the classes task in Gradle 7.4, but has a dependency on only the javaCompile task starting with Gradle 7.6-20221014231703+0000.

@jvandort jvandort self-assigned this Oct 22, 2022
@jvandort jvandort added @core Issue owned by GBT Core a:regression This used to work labels Oct 22, 2022
@jvandort jvandort added this to the 7.6 RC1 milestone Oct 22, 2022
@liutikas
Copy link
Contributor

Note the regression happened via one of these commits bc01957...96a78df

bot-gradle added a commit that referenced this issue Oct 25, 2022
…sses dirs

Create 'getClassesDirsInternal' which does not carry a dependency on the source set. We use it internally to avoid triggering :classes and :processResources when just building the classes.

Fixes: #22484

Reverts change from: 4d1aadc

Co-authored-by: Justin Van Dort <jvandort@gradle.com>
@jvandort
Copy link
Member

Fixed by #22498

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:regression This used to work @core Issue owned by GBT Core
Projects
None yet
3 participants