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

java.net.URL is no longer a supported property type in Gradle #3120

Closed
ZacSweers opened this issue Aug 15, 2023 · 5 comments
Closed

java.net.URL is no longer a supported property type in Gradle #3120

ZacSweers opened this issue Aug 15, 2023 · 5 comments
Labels
bug configuration An issue/PR related to Dokka's configuration by the user runner: gradle plugin v2 Issues fixed by Dokka Gradle Plugin v2 - see https://github.com/Kotlin/dokka/issues/3131 runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Milestone

Comments

@ZacSweers
Copy link

Describe the bug
Dokka currently uses URL for inputs for documentation urls, but in gradle 8.3 this warning is printed

Execution optimizations have been disabled for task ':sgp-monkeypatch-agp:dokkaHtmlPartial' to ensure correctness due to the following reasons:
  - In plugin 'org.jetbrains.dokka' type 'org.jetbrains.dokka.gradle.DokkaTaskPartial' property 'unsuppressedSourceSets.$0.externalDocumentationLinks.$0.packageListUrl' has @Input annotation used on type 'java.net.URL' or a property of this type. Reason: Type 'java.net.URL' is not supported on properties annotated with @Input because Java Serialization can be inconsistent for this type. For more information, please refer to https://docs.gradle.org/8.3-rc-4/userguide/validation_problems.html#unsupported_value_type in the Gradle documentation.
@ZacSweers ZacSweers added the bug label Aug 15, 2023
@IgnatBeresnev IgnatBeresnev added runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin configuration An issue/PR related to Dokka's configuration by the user labels Aug 15, 2023
@IgnatBeresnev
Copy link
Member

Related: #2993

@IgnatBeresnev IgnatBeresnev added this to the Gradle runner 2.0 milestone Aug 17, 2023
@ZacSweers
Copy link
Author

@IgnatBeresnev I saw this is marked as a 2.0 thing, but would you be open to deprecating this API for something better (probably just a String) and making the existing APIs route to it?

@3flex
Copy link
Contributor

3flex commented Nov 7, 2023

It's also deprecated in Java 20, which will lead to more reports when Gradle 8.5 is released with support for running on Java 21 as projects update to latest LTS Java version.

@whyoleg
Copy link
Collaborator

whyoleg commented Jan 8, 2024

Hey!
We were able to overcome this issue don't breaking source/binary compatibility, and so the fix will be available in an upcoming release of Dokka. Proper removal of URL usage in Gradle will be implemented in the new Gradle plugin (#3131).
For more details, look here.

Additional note: to avoid receiving deprecation warnings when running Gradle with JDK 20 please use URI("...").toURL() instead of URL("...").
Example:

sourceLink {
   remoteUrl.set(URI("https://github.com/kotlin/dokka/tree/master/src").toURL())
}

@adam-enko adam-enko added the runner: gradle plugin v2 Issues fixed by Dokka Gradle Plugin v2 - see https://github.com/Kotlin/dokka/issues/3131 label Aug 28, 2024
@adam-enko adam-enko modified the milestones: Gradle runner 2.0, Dokka 2.0.0 Aug 28, 2024
@whyoleg
Copy link
Collaborator

whyoleg commented Dec 16, 2024

Fixed in Dokka 2.0.0 in Dokka Gradle plugin v2

@whyoleg whyoleg closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug configuration An issue/PR related to Dokka's configuration by the user runner: gradle plugin v2 Issues fixed by Dokka Gradle Plugin v2 - see https://github.com/Kotlin/dokka/issues/3131 runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Projects
None yet
Development

No branches or pull requests

5 participants