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

Avoid deprecation warning with Gradle plugin re Gradle 8.0 and IncrementalTaskInputs #1454

Closed
TobiPeterG opened this issue Dec 16, 2022 · 1 comment
Milestone

Comments

@TobiPeterG
Copy link

Hey there,

this plugin won't be compatible to gradle 8.0, as the following error occurs when syncing my project with the plugin enabled:
IncrementalTaskInputs has been deprecated. This is scheduled to be removed in Gradle 8.0. On method 'GenerateJsonSchemaAndroidTask.generate' use 'org.gradle.work.InputChanges' instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#incremental_task_inputs_deprecation

Could this plugin be updated please to conform to these changes?

Should any additional information be required, I'd be happy to help

@unkish
Copy link
Collaborator

unkish commented Jan 20, 2023

It looks like changing

import org.gradle.api.tasks.Input
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.SourceTask
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.incremental.IncrementalTaskInputs
import org.jsonschema2pojo.GenerationConfig
import org.jsonschema2pojo.Jsonschema2Pojo

...

  @TaskAction
  def generate(IncrementalTaskInputs inputs) {

to

import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.SourceTask
import org.gradle.api.tasks.TaskAction
import org.gradle.work.InputChanges
import org.jsonschema2pojo.GenerationConfig
import org.jsonschema2pojo.Jsonschema2Pojo

...
  @TaskAction
  def generate(InputChanges inputs) {

should be enough as both IncrementalTaskInputs as well as InputChanges have boolean isIncremental(); which seems to be the only method that is being used

@joelittlejohn joelittlejohn changed the title Deprecated warning with gradle plugin version 1.1.2 Avoid deprecation warning with Gradle plugin re Gradle 8.0 and IncrementalTaskInputs Jan 22, 2023
@joelittlejohn joelittlejohn added this to the 1.1.3 milestone Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants