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

Add flag to disable dumping Dokka config file #3961

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adam-enko
Copy link
Member

Dumping the Dokka config files is useful for debugging, but can interfere with task outputs.

Here we add a flag that disables the dumping the config file by default, but we enable it for our own tests.

Fix #3958

@adam-enko adam-enko added the runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin label Dec 18, 2024
@adam-enko adam-enko self-assigned this Dec 18, 2024
Dumping the Dokka config files is useful for debugging, but can interfere with task outputs.

Here we add a flag that disables the dumping the config file by default, but we enable it for our own tests.

Fix #3958
@adam-enko adam-enko force-pushed the adam/fix/3958-flag-disable-config-file-output branch from 8df567d to b08ecab Compare December 18, 2024 12:37
@adam-enko adam-enko marked this pull request as ready for review December 18, 2024 15:07
@whyoleg
Copy link
Collaborator

whyoleg commented Dec 19, 2024

curious: why can't we just remove @OutputFile from dokkaConfigurationJsonFile?

Copy link
Collaborator

@whyoleg whyoleg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't we just remove @OutputFile from dokkaConfigurationJsonFile but need an additional property to disable debug functionality?

@adam-enko
Copy link
Member Author

curious: why can't we just remove @OutputFile from dokkaConfigurationJsonFile?

why can't we just remove @OutputFile from dokkaConfigurationJsonFile but need an additional property to disable debug functionality?

Removing @OutputFile would fix #3958, but it has a downside: we would lose being able to see the config file when the task is loaded from cache, which is useful for investigating issues (especially on CI where it's harder to specifically re-run cached tasks that succeeded but produced output with errors).

@whyoleg
Copy link
Collaborator

whyoleg commented Feb 4, 2025

Okay, I see, thanks!

The main thing that worries me is that we already have there two internal task properties (for debug purposes): dokkaConfigurationJsonFile and overrideJsonConfig. And now we add one more + one more internal Gradle property.
IMO, it complicates debug configurations and look more and more like a hacks/workarounds.

WDYT about small change: create a separate intermediate task (e.g generateDokkaConfiguration*) which will generate JSON file with DokkaConfiguration and pass it as an input for dokkaGenerate* task?

  1. in this case we will not have problems with outputs and caching
  2. the file with JSON configuration will be always there and so users will be able to share it for troubleshooting
  3. if someone (we) needs to override json configuration for dokkaGenerate* task, it will be still possible by provide custom file path with custom configuration

Yes, it looks like a bit more work, but I think that it might be worth it. WDYT?

@adam-enko
Copy link
Member Author

Ah, a separate task could work, yes. I would have to investigate.

I see a problem with a generateDokkaConf* task: the config file produces system-specific output which would break remote-caching.

It might work if we made a completely separate 'debug' task that builds and logs the config file, to avoid interfering with the 'production' task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Javadoc exposes absolute paths in dokka-configuration.json
2 participants