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

Task jfxJar depends on 'deploy' directory. #11

Closed
horfius opened this issue Jan 20, 2016 · 12 comments
Closed

Task jfxJar depends on 'deploy' directory. #11

horfius opened this issue Jan 20, 2016 · 12 comments

Comments

@horfius
Copy link

horfius commented Jan 20, 2016

When running either jfxJar or jfxNative tasks, I get this output:

5:50:47 PM: Executing external task 'jfxNative'...

:compileJava UP-TO-DATE

:processResources UP-TO-DATE

:classes UP-TO-DATE

:jar UP-TO-DATE

:jfxJar

Adding 'deploy' directory wasn't successful, because it does not exist! (C:\Users\horfi\Documents\FRCSmartDashboard\src\main\deploy)

:jfxJar FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':jfxJar'.

    org.gradle.api.Project.copy(Lorg/gradle/api/Action;)Lorg/gradle/api/tasks/WorkResult;

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.262 secs
org.gradle.api.Project.copy(Lorg/gradle/api/Action;)Lorg/gradle/api/tasks/WorkResult;
5:50:48 PM: External task execution finished 'jfxNative'.

There seems to be documentation missing for what should go into deploy. It resides in src/main/ but it is not detailed what should be there.

@horfius
Copy link
Author

horfius commented Jan 20, 2016

Digging deeper, the crash is actually caused by the copy task not existing. I'm using the gradle 2.2.1 wrapper.
This is the stacktrace: http://pastebin.com/28TntiKH

@FibreFoX
Copy link
Owner

This plugin was made using gradle 2.10, could you check using that version?

@horfius
Copy link
Author

horfius commented Jan 21, 2016

It doesn't crash on 2.10. It builds the jar, but I found another issue with it packaging dependencies.
Here's the crash log: http://pastebin.com/VAj2aceD
Here's my build script: http://pastebin.com/0RuCf35C

@FibreFoX
Copy link
Owner

@horfius Hi, thanks for the report. I'll check if I can push some changes to make it work with some older Gradle-version. Let me some time to figure out, what happened ... it's strange that some dependencies aren't there ... but still getting their path.

@FibreFoX FibreFoX self-assigned this Jan 21, 2016
@FibreFoX
Copy link
Owner

Just to make sure it hasn't something to do with gradle-version conflicts: could you try to delete that cache-folder? C:\Users\horfi\.gradle\caches\

@horfius
Copy link
Author

horfius commented Jan 21, 2016

So I deleted the cache and it still has the same issue. The files do exist, but the error actually exists in your tasks.
On line 96 of JfxJarTask you create a new directory for lib, but it leaves the path of the file as 'build\jfx\app\lib'. What if you try to do libDir.getAbsoluteFile().toPath.resolve(...) on lines 123 and 153?

@FibreFoX
Copy link
Owner

That doesn't change anything, the problem currently is that the dependency-file claims to not be existing:

:jfxJar
Couldn't copy dependency com.google.code.gson:gson:2.3.1
java.nio.file.NoSuchFileException: C:\Users\horfi\.gradle\caches\modules-2\files-2.1\com.google.code.gson\gson\2.3.1\ecb6e1f8e4b0e84c4b886c2f14a1500caf309757\gson-2.3.1.jar -> build\jfx\app\lib\gson-2.3.1.jar
    at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
(...)

Couldn't copy dependency packager.jar
java.nio.file.NoSuchFileException: C:\Program Files\Java\jdk1.8.0_65\lib\packager.jar -> build\jfx\app\lib\packager.jar
    at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
    at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:205)
    at sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
    at java.nio.file.Files.copy(Files.java:1274)

is it possible that there are some problems with the user running the build-process? Maybe that user isn't able to read that files (permissions or something like that).

@purringpigeon
Copy link

I am seeing this same statement in the logs:

:app:jfxJar
Adding 'deploy' directory wasn't successful, because it does not exist! (C:\workspace\GRADLE-POC\master-module\src\main\deploy)
:app:jfxNative
Adding 'deploy' directory wasn't successful, because it does not exist! (C:\workspace\GRADLE-POC\master-module\src\main\deploy)

@FibreFoX
Copy link
Owner

@purringpigeon that's nothing to be concerned about, it just says that the folder wasn't existing, it has nothing to do with the dependencies. That folder src\main\deploy isn't required to exist, as it only makes it possible to provide additional files for the packager/bundler.

@FibreFoX
Copy link
Owner

@horfius Are you running your gradle-build with the --daemon option?

@horfius
Copy link
Author

horfius commented Jan 26, 2016

No, I am not running with --daemon.

@purringpigeon
Copy link

purringpigeon commented Jan 26, 2016 via email

FibreFoX added a commit that referenced this issue Jan 26, 2016
* should fix issues #11 and #12
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