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

removeChildTasks has been deprecated #2194

Open
DanySK opened this issue Apr 18, 2023 · 2 comments
Open

removeChildTasks has been deprecated #2194

DanySK opened this issue Apr 18, 2023 · 2 comments
Assignees

Comments

@DanySK
Copy link
Member

DanySK commented Apr 18, 2023

w: Alchemist/build.gradle.kts:346:9: 'removeChildTasks(Iterable<Project>): Unit' is deprecated. 
    It is an anti-pattern to declare cross-project dependencies as it leads to various build problems. 
    For this reason, this API wil be removed with the introduction of project isolation. 
    When it happens, we will provide a migration guide. In the meantime, you can keep using this API
    if you have to, but please don't rely on it if possible. If you don't want to document a certain project,
    don't apply the Dokka plugin for it, or disable individual project tasks using the Gradle API .

@AngeloFilaseta can you take a look?

@AngeloFilaseta
Copy link
Contributor

I investigated for a while. I'll write a bunch of considerations to explain what's going on and how we could treat this issue.
This problem is caused by the configuration of the dokkaJavadocCollector task. With the introduction of multiplatform projects in the build, an additional configuration for this task is required, as it would throw an exception otherwise:

Exception in thread "Thread-1029" org.jetbrains.dokka.DokkaException: Pre-generation validity check failed: Dokka Javadoc plugin currently does not support generating documentation for multiplatform project. Please, adjust your configuration

This exception is raised even if dokkaJavadoc and dokkaJavadocPartial get disabled in every multiplatform subproject. dokkaJavadocCollector task's configuration is a little embarrassing, as it is not possible to exclude certain subprojects (I mean, it is possible using the deprecated API).

To summarize, Dokka deprecated the API and did not suggest any viable alternatives to use at the moment. As the warning says, a sort of migration guide will be provided in the future.

To overcome this issue, we could keep everything as it is and wait for the migration guide to come out. This is not ideal, as it adds technical debt, but could possibly be treated easily in the future. Another way would be to manually create a "custom collector task". This might be a little overkill. Also, it would probably be hard and time wasting to configure, test etc.

If there are considerations, ideas, etc. on how to overcome this issue, I am willing to try them. If anything comes to my mind I'll update this issue.

Some useful links:
Dokka Collector Task documentation
The only related forum discussion I found in the whole web about this issue

@DanySK
Copy link
Member Author

DanySK commented Apr 20, 2023

What about "disable individual project tasks using the Gradle API"? For this specific project, we only have one multiplatform module so far, should be manageable...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants