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

<dictionaryFile> fails for submodules #10

Open
cpesch opened this issue Feb 6, 2015 · 3 comments
Open

<dictionaryFile> fails for submodules #10

cpesch opened this issue Feb 6, 2015 · 3 comments

Comments

@cpesch
Copy link

cpesch commented Feb 6, 2015

This issue comes from a discussion in issue #1. In a Maven setup with submodules, I observed a problem during debugging:

File f = new File(TARGET_CLASS_ROOT, dictionaryFile);

When I call f.getAbsolutePath() it points to the directory of the root pom.xml (XXX\target\classes\my\Info.plist.template) and not the directory of the module XXX\XXX-for-MacOSX\target\classes\my\Info.plist.template.

When I copy my Info.plist.template to XXX\target\classes\my\Info.plist.template it works.

@btanner
Copy link

btanner commented Feb 5, 2017

@federkasten I have a fix for this, in the attached patch file. I was bothered by having to clean/build my submodule after doing it with my parent project every time to get the dictionaryFile to work.

The issue is that when building with submodules, we have to be a bit more careful because of relative paths. I literally know nothing about maven plugins, but I found the solution here:
https://maven.apache.org/plugin-developers/common-bugs.html#Resolving_Relative_Paths

There may be other issues with icons, I only looked at the dictionaryFile. I think this fix suggests a minor refactoring to lookup the root classpath at runtime instead of hard coding it with a final variable.

0001-Possibly-fixed-build-issues-with-submodules-at-least.patch.txt

EDIT: I spoke to soon. Writing code too late at night and I am wrong, not fixed yet. Could have sworn it was, but now not. Will report back.

@btanner
Copy link

btanner commented Feb 5, 2017

Ok. I believe it is actually working now. It's uglier though.

For a reason I cannot comprehend, no matter what I do with setting the velocity search paths, it cannot find the custom plist file when you call getTemplate.

The ugly solution is to set the search path to nothing (so we can use absolute paths) - and do that.

Not sure if you'll want to use this... but your project is IMMENSELY important to me (and I'm sure many others) and your continued development would be greatly appreciated!

0001-Set-absolute-path-to-templates-to-ensure-works-with-.patch.txt

@federkasten
Copy link
Owner

Thank you @btanner.
I will review your patch soon.

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

No branches or pull requests

3 participants