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

Fix compatibility issue with Gradle 7.6+ #261

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

big-andy-coates
Copy link
Collaborator

@big-andy-coates big-andy-coates commented Feb 20, 2024

fixes: #258

Gradle 7.6 is executing tasks in a different order, with mergeClasses being run after compileTestJava. This results in compileTestJava failing as it can't find the module-info.class which is generated by mergeClasses.

Fix looks to be to have the compileTestJava task, i.e. JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME, depend on the mergeClasses task. Thereby ensuring mergeClasses runs first and the module-info.class is available to compileTestJava.

It is possible/likely that the JavaPlugin.TEST_TASK_NAME task, i.e. test task, no longer needs to depend on mergeClasses. However, removing it may cause problems if there are other tasks run by test that require the output of mergeClasses. Of course, those tasks may also run foul of the re-ordering happening with Gradle 7.6.

@big-andy-coates big-andy-coates merged commit 21d10c3 into java9-modularity:master Feb 20, 2024
1 check passed
@big-andy-coates big-andy-coates deleted the gradle_7_6 branch February 20, 2024 13:44
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

Successfully merging this pull request may close these issues.

Compatibility issue with Gradle 7.6+
1 participant