-
Notifications
You must be signed in to change notification settings - Fork 407
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
Avoid snapshotting sourceLink.localDirectory input #2807
Conversation
A typical use case in a project with complex source root setup is to set sourceLink.localDirectory to the root of the project checkout dir and remoteUrl to the root of the project VCS url respectively. However, since this property was marked as InputDirectory, in that case Gradle snapshotted hashes of all files in this entire project directory before running the Dokka task (including for example .git and .gradle directories). This could be very slow in big projects and also result in various Gradle warnings. Now localDirectory is not an input property, but its relativized path is stored in another read-only input string property. Therefore, it invalidates task outputs when its value changes, but not when any content inside it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the initiative!
runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt
Outdated
Show resolved
Hide resolved
...adle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicCachingIntegrationTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Note: I assigned this PR to me because I would have liked to hit merge myself in order to correct the message of the squashed commit. |
Oh, sorry, will bear this in mind for next time 👍 Never seen assigns used in that way and we don't use the field ourselves, so it didn't trigger anything in my brain, I just assumed you assigned it to yourself automatically. I thought about leaving the more detailed comment in the commit description, but I felt like in-code comments captured it well, if that's what you wanted to add. |
A typical use case in a project with complex source root setup is to set
sourceLink.localDirectory
to the root of the project checkout dir and remoteUrl to the root of the project VCS url respectively.However, since this property was marked as
InputDirectory
, in that case Gradle snapshotted hashes of all files in this entire project directory before running the Dokka task (including for example .git and .gradle directories). This could be very slow in big projects and also result in various Gradle warnings.Now
localDirectory
is not an input property, but its relativized path is stored in another read-only input string property. Therefore, it invalidates task outputs when its value changes, but not when any content inside it.