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

Use Gradle to download & cache package lists #110

Open
aSemy opened this issue Jul 14, 2023 · 2 comments
Open

Use Gradle to download & cache package lists #110

aSemy opened this issue Jul 14, 2023 · 2 comments
Labels
blocked-by:Gradle Blocked by a bug/missing feature in Gradle enhancement New feature or request

Comments

@aSemy
Copy link
Contributor

aSemy commented Jul 14, 2023

Proposal

Adjust Dokkatoo so that it downloads any package list files using Gradle based mechanisms (e.g. TextResource).

Benefits

  • Improve runtime speed by removing a remote network call during Dokka Generator
  • Improve reproducibility (less dynamic behaviour during runtime)
  • Consolidate network proxy mechanisms, so proxy settings only have to be set for Gradle configurations

Detail

It's possible to pass a package list URL to Dokka Generator, which will then download the file ad-hoc using java.net.URL.

https://github.com/Kotlin/dokka/blob/d680b14ee033da5b7edf2406c35a93583a8f8eed/plugins/base/src/main/kotlin/resolvers/shared/PackageList.kt#L26-L34

Instead of passing a network address, a file address can be passed instead.

/**
* Specifies the exact location of a `package-list` instead of relying on Dokka
* automatically resolving it. Can also be a locally cached file to avoid network calls.
*
* Example:
*
* ```kotlin
* rootProject.projectDir.resolve("serialization.package.list").toURL()
* ```
*/
@Optional
@Input
val packageListUrl: Property<URL> = project.objects.property()

Related

@aSemy aSemy added the enhancement New feature or request label Jul 14, 2023
@aSemy
Copy link
Contributor Author

aSemy commented Jul 16, 2023

This would be easier if TextResourceFactory was injectable, but unfortunately it's not gradle/gradle#16134. I don't want to implement a custom workaround, which would be complicated, hard to test, and increase maintenance.

@aSemy aSemy added the blocked-by:Gradle Blocked by a bug/missing feature in Gradle label Jul 16, 2023
@aSemy
Copy link
Contributor Author

aSemy commented Feb 5, 2024

I can try and use an Ant task instead https://stackoverflow.com/a/69823963/4161471

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-by:Gradle Blocked by a bug/missing feature in Gradle enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant