-
Notifications
You must be signed in to change notification settings - Fork 409
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
Gradle plugin initializes the output directory too eagerly #556
Comments
I believe that 1.4.10 migrated to Gradle properties, which should fix this issue |
@kamildoleglo I have yet to test it, but looking at the implementation, this does not seem to be the case. In dokka/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt Lines 35 to 36 in 4ddaafb
which is defined to return a simple Lines 6 to 13 in 49d4757
Ergo, at the point when the task is configured, the value of this property will be set to the value of Instead, |
|
@kamildoleglo it does not matter what the Compare:
the first case is what essentially implemented now. The second is what I essentially proposed. The second variant handles changes to Also, the fact that the user can override the convention value is kind of irrelevant, because my point is that the convention value itself is not entirely correct) Note that you can pass a provider into the |
So the idea is to make btw, you might consider using |
Describe the bug
Any changes of the
Project.outputDir
property by another plugin (loaded after the Dokka plugin) or by my own build configuration are not reflected in the defaultdokka
task configuration, resulting in pollution of the project work tree.Expected behaviour
If I change the output directory for my build, the
dokka
task should output its results there.To Reproduce
project.buildDir = "$projectDir/output"
after application of the Dokka plugin../gradlew dokka
and observe that the output is produced not to$projectDir/output
but to$projectDir/build
, which is the default build directory in Gradle.Dokka configuration
Dokka configuration does not matter, and this can be reproduced without any configuration.
Installation
Additional context
At the moment, the output directory of the
dokka
task is initialized by directly assigning aString
property to a value derived fromproject.buildDir
within the plugin application code. This interacts poorly with build setups where the build directory differs from the default one: if I have a plugin which is applied after Dokka and which modifies the build directory, then thedokka
task will still output to the default directory, polluting the project work tree. Same if I modify the build directory in my script - the most important thing is that this modification happens after the Dokka plugin application.I believe that the proper solution here is to rely on the lazy configuration mechanisms in Gradle, and e.g. change the
DokkaTask.outputDirectory
type toDirectoryProperty
, with the default value derived fromproject.layout.buildDirectory
.The text was updated successfully, but these errors were encountered: