-
Notifications
You must be signed in to change notification settings - Fork 7
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
major (behind the scenes) updates/hacks/workarounds to get relocatable build-cache working #132
Conversation
attributes { | ||
attributeProvider( | ||
// provide the full task path of the task that generates this module | ||
// ugly hack workaround for https://github.com/gradle/gradle/issues/13590 | ||
DokkatooModuleGenerateTaskPathAttribute, | ||
dokkatooTasks.generateModule.map { objects.named(it.path) } | ||
) | ||
} |
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.
This the start of the ugly hack. Share the path of the task that generates the module via an Attribute.
This file path will later be used by the aggregating task so that Gradle can correctly determine the task dependencies.
// ugly hack, workaround for https://github.com/gradle/gradle/issues/13590 | ||
dependsOn(providers.provider { | ||
[email protected] { it.moduleGenerateTaskPath } | ||
}) |
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.
And here's the end result of the ugly hack. The task paths of the module-generation tasks are extracted from the incoming Artifact Attributes and passed in as a dependency here.
hey @martinbonnin, I've had a breakthrough with solving relocatable build caching of Dokka tasks - would you mind taking a look? It's such a hack I don't think I want to merge it in! But at least it's so wild it should make for good entertainment. |
- refactor Dokkatoo Configurations to share Module output directories and Module included files. This is monumentally hacky and requires several absurd workarounds, but sod it, Gradle is severely borked and they don't seem to be fixing it any time soon :( - Deprecate DokkatooPrepareModuleDescriptorTask - remove DokkaModuleDescriptionKxs - saving the Module descriptor to JSON broke relocatable build cache because it contained absolute file paths. - update to Gradle 8.5 - refactor some of the internal Gradle Dependency/Task/Names helper classes to be smaller/focused/better named - use new Gradle `Configuration.isCanBeDeclared` util, split up configurations into declarable/resolvable/consumable - Notably I haven't added any relocatable build cache tests because I really can't be arsed
c103423
to
272cf5e
Compare
Gave it a quick look, I think #66 is not valid anymore? I couldn't find a
|
# Conflicts: # modules/dokkatoo-plugin/src/testFunctional/kotlin/MultiModuleFunctionalTest.kt
# Conflicts: # .idea/fileColors.xml # modules/dokkatoo-plugin/src/main/kotlin/DokkatooBasePlugin.kt # modules/dokkatoo-plugin/src/main/kotlin/internal/gradleUtils.kt # modules/dokkatoo-plugin/src/main/kotlin/tasks/DokkatooGenerateTask.kt
Superseded by #155 |
Configuration.isCanBeDeclared
util, split up configurations into declarable/resolvable/consumableThis should in theory fix #66 and #67, but this is such a massive hack I'm not sure if I should go ahead...
Related issues
These are the Gradle issues that prevent sensible sharing of files between subprojects: