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

Git compatibility: Spoon ignores files added as resources if they don't end in .java #84

Closed
slarse opened this issue Mar 25, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@slarse
Copy link
Collaborator

slarse commented Mar 25, 2020

When Git runs a merge, it names the files .merge_file_blabla, and Spoon does not recognize these as proper Java files. A quick-fix would be to e.g. .merge_file_blabla to .merge_file_blabla.java, but that will cause a platform dependence. Not sure what the best solution is here.

@slarse slarse added the bug Something isn't working label Mar 25, 2020
@slarse
Copy link
Collaborator Author

slarse commented Mar 25, 2020

I can just subclass the VirtualFolder and override the getAllJavaFiles method to simply return all files.

@slarse
Copy link
Collaborator Author

slarse commented Mar 26, 2020

Okay, nope, this doesn't work. I managed to get around all safety measures in Spoon by subclassing VirtualFolder, Launcher and JDTBasedSpoonCompiler, but then the eclipse batch compiler interprets the file as a directory. Because it doesn't end in .java. I don't think I can get around that.

On Linux, an efficient solution here would be to create hardlink .merge_file_blabla to .merge_file_blabla.java, and then remove the hard link when the merge is done. On Windows, I don't really know ...

@slarse slarse added enhancement New feature or request and removed bug Something isn't working labels Mar 26, 2020
@slarse
Copy link
Collaborator Author

slarse commented Mar 26, 2020

Hard linking should work on both Windows and Linux

@slarse slarse closed this as completed in f76420c Mar 26, 2020
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

No branches or pull requests

1 participant