asciidoctor / asciidoctor-gradle-plugin

A Gradle plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
https://asciidoctor.github.io/asciidoctor-gradle-plugin/
Apache License 2.0
285 stars 120 forks source link

Fix task property annotation problems #587

Closed lptr closed 3 years ago

lptr commented 3 years ago

This PR fixes some validation problems with tasks in the plugin that will cause any build using the plugin to fail with Gradle 7.0. It also enables strict validation during the build, so any new validation problems introduced will make the build fail.

The particular problems fixed by this PR are:

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':asciidoctoreditorconfig:validateTaskProperties'.
> Task property validation failed. See https://docs.gradle.org/5.5.1/userguide/more_about_tasks.html#sec:task_input_output_annotations for more information on how to annotate task properties.
   > Warning: Type 'org.asciidoctor.gradle.editorconfig.AsciidoctorEditorConfigGenerator': property 'additionalFileProviders' is missing a normalization annotation, defaulting to PathSensitivity.ABSOLUTE.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':asciidoctor-gradle-slides-export:validateTaskProperties'.
> Task property validation failed. See https://docs.gradle.org/5.5.1/userguide/more_about_tasks.html#sec:task_input_output_annotations for more information on how to annotate task properties.
   > Warning: Type 'org.asciidoctor.gradle.slides.export.base.AbstractExportBaseTask': property 'outputDir' is annotated with @PathSensitive that is not allowed for @OutputDirectory properties.
   > Warning: Type 'org.asciidoctor.gradle.slides.export.decktape.DeckTapeTask': property 'outputDir' is annotated with @PathSensitive that is not allowed for @OutputDirectory properties.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':asciidoctor-gradle-jvm-pdf:validateTaskProperties'.
> Task property validation failed. See https://docs.gradle.org/5.5.1/userguide/more_about_tasks.html#sec:task_input_output_annotations for more information on how to annotate task properties.
   > Warning: Type 'org.asciidoctor.gradle.jvm.pdf.AsciidoctorPdfTask': property 'fontsDir' is not annotated with an input or output annotation.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

4: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':asciidoctor-gradle-jvm-leanpub:validateTaskProperties'.
> Task property validation failed. See https://docs.gradle.org/5.5.1/userguide/more_about_tasks.html#sec:task_input_output_annotations for more information on how to annotate task properties.
   > Warning: Type 'org.asciidoctor.gradle.jvm.leanpub.DropboxCopyTask': property 'sourceDir' is missing a normalization annotation, defaulting to PathSensitivity.ABSOLUTE.

Also note that there are some validation warnings in the JRuby plugin that this plugin depends on. These warnings are fixed in https://github.com/jruby-gradle/jruby-gradle-plugin/pull/419. Once the JRuby plugin PR is merged, the dependency in the Asciidoctor plugin needs to be bumped in order to make this plugin fully compatible with Gradle 7.0.

lptr commented 3 years ago

Bumped to JRuby 2.0.1 after https://github.com/jruby-gradle/jruby-gradle-plugin/pull/419 has been mereged.

ysb33r commented 3 years ago

@lptr Can you base this against the development-3.x branch please?

lptr commented 3 years ago

Thanks @ysb33r .