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

Lingering package name & folders for relocations in source project. #57

Closed
johnrengelman opened this issue Jun 27, 2014 · 10 comments · Fixed by #1233
Closed

Lingering package name & folders for relocations in source project. #57

johnrengelman opened this issue Jun 27, 2014 · 10 comments · Fixed by #1233

Comments

@johnrengelman
Copy link
Collaborator

From @Minecrell - #53

Just tested the new version 1.0.0 and it doesn't generate the old folders of the dependencies anymore. However, for some reason in the JAR file is an empty folder with the name of the file. (In my case GradleTest-1.0-all). This is kinda strange but I don't really mind, but maybe it is just a small mistake that is easily fixable?
Relocations of packages within the source files still generate their old folders in the JAR but as of I don't use that, it's not important to fix (for me).

@johnrengelman
Copy link
Collaborator Author

@Minecrell - do you have an example project that exhibits the problem?

Also, I'm curious about relocating packages inside the source project? Why would you do this? Why not just define the classes in the correct package?

@stephan-gh
Copy link
Contributor

It is still the same test project as for the previous issues: https://github.com/Minecrell/GradleTest
There is no real reason to use that, just tried that to test refactoring in the older version and noticed it has still the old packages in the current version. That's why I don't really mind if you don't fix this. ;)
But maybe there is a reason for the other empty folder?

@johnrengelman
Copy link
Collaborator Author

Yeah, the difference here is that in 0.8, the plugin was running the jar task and then using the output of it as an input to the shadowJar task. So effectively the "source project" was just another dependency.
In 1.0.0 the "source project" is treated as files to copy in, so relocation isn't applied exactly the same. I'll keep this open to see if there is maybe a way to work around it.
Thanks for all the testing you've been doing!

@stephan-gh
Copy link
Contributor

Thank you for your clarification. Do you have any idea why the plugin is generating the GradleTest-1.0-all folder in the JAR? Doesn't look like it is caused by the relocation because it also happens without it.

@johnrengelman
Copy link
Collaborator Author

In order to fix the empty directories, I changed how/when the directory entries are created...there's probably an off-by-1 issue in there. I'll get that fixed...it's annoying.

@johnrengelman
Copy link
Collaborator Author

Hmm, using your project, I don't see the GradleTest-1.0-all folder in the JAR.

@stephan-gh
Copy link
Contributor

Looks like it is another Windows bug, just tested on my server running Linux and after unpacking the JAR there is no folder with that name... Well, doesn't matter then because I'm only using Windows for development, the production binaries are created by the continous integration server on my Linux server. If you have some additional time you can look for a reason but don't take this as highest priority for now, it should also work with the empty folder in the JAR. :)

@johnrengelman
Copy link
Collaborator Author

Great. I have a Windows VM now, so I'll add a test and see if I can fail it on that machine and get a fix in.

@stephan-gh
Copy link
Contributor

The empty folder doesn't exist anymore using the latest version. The folder of the relocation within the source folder still exists, but I don't think there is a reason to fix it because I can't think of a reason why someone should relocate packages within the own source files (just refactor the package).
You can close this issue if you want. :)

@johnrengelman
Copy link
Collaborator Author

Yeah, I wasn't able to recreate that problem either.

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

Successfully merging a pull request may close this issue.

2 participants