aim42 / htmlSanityCheck

Standalone (batch- and command-line) and Gradle-plugin html sanity checker - detects missing images, dead links and cross-references, duplicate link targets (anchors) and the like.
Apache License 2.0
70 stars 47 forks source link

compatibility with gradle 7.0 / deprecation warnings within gradle 6.x #282

Closed oliva123456 closed 1 year ago

oliva123456 commented 3 years ago

running the gradle plugin using gradle 6.8.1 results in:

Task :<....>:htmlSanityCheck Property 'httpConnectionTimeout' @Input properties with primitive type 'int' cannot be @Optional. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. See https://docs.gradle.org/6.6.1/userguide/more_about_tasks.html#sec:up_to_date_checks for more details. Property 'ignoreIPAddresses' @Input properties with primitive type 'boolean' cannot be @Optional. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. See https://docs.gradle.org/6.6.1/userguide/more_about_tasks.html#sec:up_to_date_checks for more details. Property 'ignoreLocalHost' @Input properties with primitive type 'boolean' cannot be @Optional. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. See https://docs.gradle.org/6.6.1/userguide/more_about_tasks.html#sec:up_to_date_checks for more details.

would be rather cool, if the plugin will still work with gradle 7 (after reading the warnings, i'm quite unsure if it will).

gernotstarke commented 3 years ago

Thanx for the hint - I'd really appreciate to have the plugin continue with Gradle 7.x - but cannot invest any time in the near future due to other priorities (sorry for that).

Would you be willing to provide or propose a fix via pull-request?

@rdmueller - do you currently have any colleague within reach, who might support here?

oliva123456 commented 3 years ago

@gernotstarke - i will try to fix the issue and provide a request.

a little problem is that i see failing tests when i run them after cloning the master locally (without any changes) => 305 tests completed, 6 failed.

oliva123456 commented 3 years ago

created the pull request: https://github.com/aim42/htmlSanityCheck/pull/283

rdmueller commented 3 years ago

question: are those input properties still optional?

oliva123456 commented 3 years ago

question: are those input properties still optional?

short answer: yes.

the @Optional annotation it is not just for "marking" parameters as optional, but rather more for making input validation optional. see: https://docs.gradle.org/6.8.1/userguide/more_about_tasks.html#sec:task_input_output_validation https://docs.gradle.org/6.8.1/userguide/more_about_tasks.html#sec:up_to_date_checks => "You will occasionally want to disable some of this validation, specifically when an input file may validly not exist. That’s why Gradle provides the @Optional annotation: you use it to tell Gradle that a particular input is optional and therefore the build should not fail if the corresponding file or directory doesn’t exist."

within my own gradle tasks all task parameters are optional (in the meaning of 'there is no need to declare the parameter when calling the task') without declaring them as @Optional in the task (regardless of being a primitive or a real object).