kordamp / jdeps-gradle-plugin

Run JDeps on a Gradle build
Apache License 2.0
35 stars 10 forks source link

Running with --dot-output failed #28

Closed rbrunet closed 2 years ago

rbrunet commented 2 years ago

Hi, I tried to generate the dot graph, but got

rbrunet@forward-desktop:~/git/analytics$ gradle --info jdeps --verbose --dot-output=summary
Initialized native services in: /home/rbrunet/.gradle/native
Initialized jansi services in: /home/rbrunet/.gradle/native
The client will now receive all logging from the daemon (pid: 219809). The daemon log file: /home/rbrunet/.gradle/daemon/7.2/daemon-219809.out.log
Starting 28th build in daemon [uptime: 25 mins 57.605 secs, performance: 100%, non-heap usage: 31% of 256 MiB]
Using 8 worker leases.
Now considering [/home/rbrunet/git/analytics] as hierarchies to watch
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
Settings evaluated using settings file '/home/rbrunet/git/analytics/settings.gradle'.
Projects loaded. Root project using build file '/home/rbrunet/git/analytics/build.gradle'.
Included projects: [root project 'analytics']

> Configure project :
Evaluating root project 'analytics' using build file '/home/rbrunet/git/analytics/build.gradle'.
Applying dependency management to configuration 'bootArchives' in project 'analytics'
Applying dependency management to configuration 'archives' in project 'analytics'
Applying dependency management to configuration 'default' in project 'analytics'
Applying dependency management to configuration 'implementation' in project 'analytics'
Applying dependency management to configuration 'compileOnly' in project 'analytics'
Applying dependency management to configuration 'compileClasspath' in project 'analytics'
Applying dependency management to configuration 'annotationProcessor' in project 'analytics'
Applying dependency management to configuration 'runtimeOnly' in project 'analytics'
Applying dependency management to configuration 'runtimeClasspath' in project 'analytics'
Applying dependency management to configuration 'testImplementation' in project 'analytics'
Applying dependency management to configuration 'testCompileOnly' in project 'analytics'
Applying dependency management to configuration 'testCompileClasspath' in project 'analytics'
Applying dependency management to configuration 'testAnnotationProcessor' in project 'analytics'
Applying dependency management to configuration 'testRuntimeOnly' in project 'analytics'
Applying dependency management to configuration 'testRuntimeClasspath' in project 'analytics'
Applying dependency management to configuration 'apiElements' in project 'analytics'
Applying dependency management to configuration 'runtimeElements' in project 'analytics'
Applying dependency management to configuration 'developmentOnly' in project 'analytics'
Applying dependency management to configuration 'productionRuntimeClasspath' in project 'analytics'
All projects evaluated.
Selected primary task 'jdepsReport' from project :
Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':jdepsReport']
Tasks that were excluded: []
:compileJava (Thread[Execution worker for ':',5,main]) started.

> Task :compileJava
Watching 15 directories to track changes
Watching 15 directories to track changes
Watching 15 directories to track changes
Watching 15 directories to track changes
Resolving global dependency management for project 'analytics'
Excluding []
Excluding []
Caching disabled for task ':compileJava' because:
  Build cache is disabled
Task ':compileJava' is not up-to-date because:
  Output property 'destinationDirectory' file /home/rbrunet/git/analytics/build/classes/java/main has been removed.
  Output property 'destinationDirectory' file /home/rbrunet/git/analytics/build/classes/java/main/com has been removed.
  Output property 'destinationDirectory' file /home/rbrunet/git/analytics/build/classes/java/main/com/forward has been removed.
Watching 15 directories to track changes
Watching 15 directories to track changes
Watching 15 directories to track changes
Watching 14 directories to track changes
The input changes require a full rebuild for incremental task ':compileJava'.
Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments.
Compiling with toolchain '/home/rbrunet/toolbox/jdk-17'.
Compiling with JDK Java compiler API.
Class dependency analysis for incremental compilation took 0.0 secs.
Created classpath snapshot for incremental compilation in 0.018 secs.
Watching 22 directories to track changes
Watching 24 directories to track changes
Watching 26 directories to track changes
Watching 27 directories to track changes
:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 0.51 secs.
:processResources (Thread[Execution worker for ':',5,main]) started.

> Task :processResources NO-SOURCE
file or directory '/home/rbrunet/git/analytics/src/main/resources', not found
Skipping task ':processResources' as it has no source files and no previous output files.
:processResources (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:classes (Thread[Execution worker for ':',5,main]) started.

> Task :classes
Skipping task ':classes' as it has no actions.
:classes (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:jdepsReport (Thread[Execution worker for ':',5,main]) started.

> Task :jdepsReport FAILED
Watching 28 directories to track changes
:jdepsReport (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jdepsReport'.
> Input property 'resolvedDotOutput' with value '/home/rbrunet/git/analytics/summary' cannot be serialized.

* 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

BUILD FAILED in 845ms
2 actionable tasks: 2 executed
Watching 28 directories to track changes
aalmiray commented 2 years ago

Please provide more information on your environment and settings. The output of gradle --version is a good start.

rbrunet commented 2 years ago

gradle --version


Gradle 7.2

Build time: 2021-08-17 09:59:03 UTC Revision: a773786b58bb28710e3dc96c4d1a7063628952ad

Kotlin: 1.5.21 Groovy: 3.0.8 Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020 JVM: 17 (Oracle Corporation 17+35-2724) OS: Linux 5.10.0-11-amd64 amd64

rbrunet commented 2 years ago

I also ran with --debug, see the attached file

debug-log.txt

And thanks for the quick response! Much appreciated!

aalmiray commented 2 years ago

I think the problem is here

https://github.com/kordamp/jdeps-gradle-plugin/blob/d927d45f00075b0fe58eecf8014504d6026ae023/src/main/groovy/org/kordamp/gradle/plugin/jdeps/tasks/JDepsReportTask.groovy#L342-L344

Should use @InputFile instead of @Input.

rbrunet commented 2 years ago

Thanks for quick fix, Andres. Much appreciated.

aalmiray commented 2 years ago

@rbrunet you are going to like the next trick: releasing v0.18.0 in a few minutes.

rbrunet commented 2 years ago

Just tested it and confirm it works. It produced a .dot file with the digraph description that can then be seen for example with https://dreampuf.github.io/GraphvizOnline

Thanks!