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

[BUG] [GRADLE] Custom generator task fails in gradle 5+ #2648

Closed
4 of 6 tasks
Ranbato opened this issue Apr 11, 2019 · 6 comments
Closed
4 of 6 tasks

[BUG] [GRADLE] Custom generator task fails in gradle 5+ #2648

Ranbato opened this issue Apr 11, 2019 · 6 comments

Comments

@Ranbato
Copy link

Ranbato commented Apr 11, 2019

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
    3.3.4
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

Building using custom (e.g. additional) tasks fails when using gradle 5.0 or greater with the following error

Initialized native services in: /Users/z002m6r/.gradle/native
The client will now receive all logging from the daemon (pid: 20328). The daemon log file: /Users/z002m6r/.gradle/daemon/5.3.1/daemon-20328.out.log
Starting 10th build in daemon [uptime: 31 mins 26.786 secs, performance: 99%, non-heap usage: 18% of 268.4 MB]
Using 8 worker leases.
Starting Build
Settings evaluated using settings file '/Users/z002m6r/src/openapi-generator/modules/openapi-generator-gradle-plugin/samples/local-spec/settings.gradle'.
Projects loaded. Root project using build file '/Users/z002m6r/src/openapi-generator/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle'.
Included projects: [root project 'local-spec']

> Configure project :
Evaluating root project 'local-spec' using build file '/Users/z002m6r/src/openapi-generator/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle'.
Invalidating in-memory cache of /Users/z002m6r/.gradle/caches/journal-1/file-access.bin
All projects evaluated.
Selected primary task 'buildGoSdk' from project :
Tasks to be executed: [task ':buildGoSdk']
:buildGoSdk (Thread[Execution worker for ':',5,main]) started.

> Task :buildGoSdk FAILED
Task ':buildGoSdk' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
:buildGoSdk (Thread[Execution worker for ':',5,main]) completed. Took 0.008 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildGoSdk'.
> No value has been specified for this provider.

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

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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.3.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s
1 actionable task: 1 executed

It can be duplicated with the included samples modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle

openapi-generator version

openapiGeneratorVersion = '3.3.4' and latest

OpenAPI declaration file content or url
Command line used for generation

gradle buildGoSdk --info

Steps to reproduce

set default gradle to 5.0 or higher. I have tested with 4.10, 5.1 and 5.3
clone repo
cd /openapi-generator/modules/openapi-generator-gradle-plugin/samples/local-spec
gradle buildGoSdk --info

Related issues/PRs

None found

Suggest a fix

detekt/detekt#1421 seems similar, but I haven't been able to find a similar solution

@michelau
Copy link

I'm also experiencing this.

@wing328
Copy link
Member

wing328 commented Apr 12, 2019

I think #2651 should fix it.

@Ranbato
Copy link
Author

Ranbato commented Apr 12, 2019

Will it fix it or just detect it? Seems to me that it should reproduce the issue, but since it is just changes to tests I'm not sure how it will fix it. ¯\(ツ)

@wing328
Copy link
Member

wing328 commented Apr 12, 2019

@Ranbato the CI tests ran gradle -b modules\openapi-generator-gradle-plugin\samples\local-spec\build.gradle buildGoSdk --info without issues.

Here is the log: https://ci.appveyor.com/project/WilliamCheng/openapi-generator/builds/23797115

@Ranbato
Copy link
Author

Ranbato commented Apr 12, 2019

Looks like it is fixed in the 4.0.0 beta

@wing328
Copy link
Member

wing328 commented Apr 12, 2019

PR (#2651) has been merged into master. Please give it another try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants