graphql-java-generator / graphql-gradle-plugin-project

graphql-gradle-plugin is a Gradle Plugin for GraphQL, based on graphql-java. It accelerates the development for both the client and the server, by generating the Java code. It allows a quicker development when in contract-first approach, by avoiding to code the boilerplate code.
https://graphql-maven-plugin-project.graphql-java-generator.com/
MIT License
54 stars 8 forks source link

Support for Gradle 7 #3

Closed gjvoosten closed 3 years ago

gjvoosten commented 3 years ago

With Gradle 7 (just out), I get this error:

$ ./gradlew generateClientCode
> Task :generateClientCode FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':generateClientCode' (type 'GenerateClientCodeTask').
  - Type 'GenerateClientCodeTask' property 'defaultTargetSchemaFileName' is missing an input or output annotation.

    Reason: A property without annotation isn't considered during up-to-date checking.

    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.

    Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#missing_annotation for more details about this problem.
  - Type 'GenerateClientCodeTask' property 'projectDir' is missing an input or output annotation.

    Reason: A property without annotation isn't considered during up-to-date checking.

    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.

    Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#missing_annotation for more details about this problem.

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

* Get more help at https://help.gradle.org

BUILD FAILED in 527ms
1 actionable task: 1 executed

This probably eventually boils down to https://github.com/graphql-java-generator/graphql-maven-plugin-project/blob/master/graphql-maven-plugin-logic/src/main/java/com/graphql_java_generator/plugin/conf/CommonConfiguration.java#L143 so it may need an override in e.g. https://github.com/graphql-java-generator/graphql-gradle-plugin-project/blob/master/graphql-gradle-plugin/src/main/java/com/graphql_java_generator/gradleplugin/CommonExtension.java

etienne-sf commented 3 years ago

Ok, noted.

I thought that using gradlew would avoid that.

I'll check it.

etienne-sf commented 3 years ago

Hello,

I published the 1.14.1 yesterday, that solves this issue.

One issue remain in this version: you must use the Gradle wrapper to build the project, when using the Schema Personalization feature (server side only). There is a strange bug when loading a JSON schema. It's solved on the master branch, and the correction will be available in the next release.

Etienne

gjvoosten commented 3 years ago

@etienne-sf Thanks, 1.14.1 works like a charm for me (we only use the client code generator).

etienne-sf commented 3 years ago

I just released the 1.14.2, that solves the last issue with gradle 7.

Étienne