code snippet for loading comparing models from GIT [message #1768366] |
Tue, 18 July 2017 01:12  |
Eclipse User |
|
|
|
Hi Everyone,
I am trying to the EMFCompare programmatically to compare a version of a model in the workspace with another version of that in the git. I found some useful information to do it on models from when they are on the local disk as below code, but I do not know how I can do the same thing if the models are located in a git repository?
Thanks
Mojtaba
URI uri1 = URI.createFileURI("/Users/workspace-papyrus-rt_user/cs.queensu.ca.emfcompare/src/cs/queensu/ca/emfcompare/actions/left.uml");
URI uri2 = URI.createFileURI("/Users/workspace-papyrus-rt_user/cs.queensu.ca.emfcompare/src/cs/queensu/ca/emfcompare/actions/right.uml");
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("uml", UMLResource.Factory.INSTANCE);
ResourceSet resourceSet1 = new ResourceSetImpl();
ResourceSet resourceSet2 = new ResourceSetImpl();
resourceSet1.getResource(uri1, true);
resourceSet2.getResource(uri2, true);
IComparisonScope scope = new DefaultComparisonScope(resourceSet1, resourceSet2, null);
Comparison comparison = EMFCompare.builder().build().compare(scope);
List<Diff> differences = comparison.getDifferences();
System.out.println(differences);
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08284 seconds