htmlSanityCheck icon indicating copy to clipboard operation
htmlSanityCheck copied to clipboard

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

Open oliva123456 opened this issue 4 years ago • 5 comments

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).

oliva123456 avatar Jan 29 '21 09:01 oliva123456

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?

gernotstarke avatar Jan 29 '21 13:01 gernotstarke

@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 avatar Jan 29 '21 16:01 oliva123456

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

oliva123456 avatar Jan 29 '21 17:01 oliva123456

question: are those input properties still optional?

rdmueller avatar Jan 29 '21 18:01 rdmueller

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).

oliva123456 avatar Jan 29 '21 18:01 oliva123456