Epsilon Mac problem [message #650326] |
Mon, 24 January 2011 12:18 |
Andy Ed Messages: 64 Registered: December 2009 |
Member |
|
|
My ETL translation runs under windows but not Mac. I think I've tracked the problem to the following code in:
/org.eclipse.epsilon.emc.emf/src/org/eclipse/epsilon/emc/emf /EmfModel.java rev 1163, at line 196.
model = resourceSet.createResource(modelFileUri);
This is successful in windows, but not Mac. The difference is as follows:
The modelFileURI in Windows is: platform:/resource/sharedbuffer20100819Tasking/sharedbuffer2 0100819b.tasking
The modelFileURI on the Mac is, file:/sharedbuffer20100819Tasking/sharedbuffer20100819b.task ing
The difference arises during the call to EMFUtil.createURI(metamodelFile) in line 84, org.eclipse.epsilon.emc.emf/src/org/eclipse/epsilon/emc/emf/ EmfUtil.java.
I hacked the code on the Mac to make the modelFileURI a platform relative resource, then all went well. So a branch like the following could be necessary.
...
else if(OperatingSystem.isMac() ){
return URI.createPlatformResourceURI(s, true);
} ...
within the method,
public static URI createURI(String s) {
URI uri = URI.createURI(s);
if (uri.scheme() != null) {
// If we are under Windows and s starts with x: it is an absolute path
if (OperatingSystem.isWindows() && uri.scheme().length() == 1) {
return URI.createFileURI(s);
}
// otherwise it is a proper uri
else {
return uri;
}
}
// Handle paths that start with / under Unix e.g. /local/foo.txt
else if (OperatingSystem.isUnix() && s.startsWith("/")) {
return URI.createFileURI(s);
}
// ... otherwise it is a platform resource uri
else {
return URI.createPlatformResourceURI(s, true);
}
}
Is it possible to fix this?
cheers,
Andy
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03358 seconds