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

Handle non-existent sources #20

Merged
merged 1 commit into from
Aug 1, 2022
Merged

Conversation

fabianishere
Copy link
Contributor

Hi,

I recently updated to version of 0.13.1 to be able to upgrade to Gradle v7.5. It seems however that the new worker-based implementation fails when using Kotlin, complaining about non-existent Java class directories. For instance, this is the error is get when using the latest versions in one of my projects:

 Task :opendc-web:opendc-web-proto:jandex
java.nio.file.NoSuchFileException: /Users/fabian/Documents/Workspace/Projects/AtLarge Research/opendc/opendc-web/opendc-web-proto/build/classes/java/main
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
        at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:148)
        at java.base/java.nio.file.Files.readAttributes(Files.java:1851)
        at java.base/java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:220)
        at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:277)
        at java.base/java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:323)
        at java.base/java.nio.file.Files.walkFileTree(Files.java:2805)
        at java.base/java.nio.file.Files.walkFileTree(Files.java:2883)
        at org.kordamp.gradle.plugin.jandex.tasks.JandexWorkAction.execute(JandexWorkAction.groovy:51)

This pull request updates JandexWorkAction to support sources passed to the task that do not actually exist.

By the way, it seems that the jandex task does not fail when JandexWorkAction throws an exception. In my project, Gradle reported the build to have completed successfully, even though JandexWorkAction failed. However, I am not familiar enough with the Gradle Worker API to be able to fix this.

This change updates JandexWorkAction to support sources passed to the task that
do not actually exist. This happens for instance when using Kotlin, where the
Java class directory does not exist (when Java is not used).
@aalmiray aalmiray added the enhancement New feature or request label Aug 1, 2022
@aalmiray aalmiray merged commit 08dda13 into kordamp:master Aug 1, 2022
@aalmiray
Copy link
Collaborator

aalmiray commented Aug 1, 2022

Thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants