Hello everybody.
I have a dsl wich can be contain in different files :
for exemple ;
file authors..mydsl1
metaRepository authors
author jguidoux {
firstName toto;
lastName Wallis;
description "unknows";
}
and the files rules. mydsl1 :
metaRepository rules
import authors.*
rule rule1 type AUDIT refactoring NONE{
author jguidoux;
I try to load the dsl on a EObject.
But it does not works very well.
I have this method to load the dsl :
public static MetaRepository loadDSL(File file) {
if (!EPackage.Registry.INSTANCE.containsKey(MetaRepositoryPackage.eNS_URI)) {
EPackage.Registry.INSTANCE.put(MetaRepositoryPackage.eNS_URI, MetaRepositoryPackage.eINSTANCE);
}
MetarepositoryDSLStandaloneSetup.doSetup();
final ResourceSet rs = new ResourceSetImpl();
final Resource resource = rs.getResource(URI.createURI(file.getPath()), true);
return (MetaRepository) resource.getContents().get(0);
}
With this I can load my dsl, but I don't havv all the information in my EObject.
for exemple ;
Author author = metarepository.getAuthor()
return a proxy. And I don't manage to resolve the proxy.
I try to load the other dsl file with contain the author and after to resovle the proxy. By this way :
public static EList<MetaRepository> loadDSLs(String path) {
final EList<MetaRepository> metareps = new BasicEList<MetaRepository>();
final List<File> files = getDSLFiles(new File(path));
for (final File file : files) {
final MetaRepository metarep = loadDSL(file);
validateMetarep(metarep);
metareps.add(metarep);
}
return metareps;
}
But it still doesn't work.
Have you got any idea?
Thanks
Jérémie