-
Notifications
You must be signed in to change notification settings - Fork 566
ValidateJavaVersion is expensive #8369
Copy link
Copy link
Closed
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.need-attentionA xamarin-android contributor needs to reviewA xamarin-android contributor needs to review
Metadata
Metadata
Assignees
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.need-attentionA xamarin-android contributor needs to reviewA xamarin-android contributor needs to review
Type
Fields
Give feedbackNo fields configured for issues without a type.
Android application type
.NET Android (net7.0-android, etc.)
Affected platform version
net 7 and later
Description
The task
ValidateJavaVersiontakes about 23 seconds to run for every project of a solution, even when running on a beefy machine (Standard_L16s_v3 with premium SSDs).https://github.com/xamarin/xamarin-android/blob/4fffbf686bad5479a8ef7954d7d9d0d68941f034/src/Xamarin.Android.Build.Tasks/Tasks/ValidateJavaVersion.cs#L14
Interestingly, the caching mechanism here does seem to work, but not in a meaningful way:
https://github.com/xamarin/xamarin-android/blob/4fffbf686bad5479a8ef7954d7d9d0d68941f034/src/Xamarin.Android.Build.Tasks/Tasks/ValidateJavaVersion.cs#L104
Steps to Reproduce
Build any android library and observe the task takes a long time to run. In a large solution, this accounts for about 4 minutes of build time.
Did you find any workaround?
None at this time.

Relevant log output
No response