Commit 06a7e2c3 authored by Erwan Bousse's avatar Erwan Bousse
Browse files

Versionning everything

parent cf54973e
#
bin.includes = .,\
META-INF/,\
plugin.xml,\
plugin.properties
jars.compile.order = .
source.. = src/
output.. = bin/
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel">
<somemetamodel:A>
<c href="file/tmp/deepClone/submodel2.xmi#/0"/>
<x href="file/tmp/deepClone/submodel2.xmi#/1"/>
</somemetamodel:A>
<somemetamodel:B/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel" xmlns:somemetamodelextension="http://somemetamodelextension/1.0">
<somemetamodel:C/>
<somemetamodelextension:X/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel">
<somemetamodel:A>
<c href="file/tmp/mutableClassesOnlyClone/submodel2.xmi#/0"/>
<x href="file/tmp/submodel2.xmi#/1"/>
</somemetamodel:A>
<somemetamodel:B/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel" xmlns:somemetamodelextension="http://somemetamodelextension/1.0">
<somemetamodel:C/>
<somemetamodelextension:X/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel">
<somemetamodel:A>
<c href="file/tmp/submodel2.xmi#/0"/>
<x href="file/tmp/submodel2.xmi#/1"/>
</somemetamodel:A>
<somemetamodel:B/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel" xmlns:somemetamodelextension="http://somemetamodelextension/1.0">
<somemetamodel:C/>
<somemetamodelextension:X/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel">
<somemetamodel:A>
<c href="submodel2.xmi#/0"/>
<x href="submodel2.xmi#/1"/>
</somemetamodel:A>
<somemetamodel:B/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel" xmlns:somemetamodelextension="http://somemetamodelextension/1.0">
<somemetamodel:C/>
<somemetamodelextension:X/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel">
<somemetamodel:A>
<c href="submodel2.xmi#/0"/>
<x href="submodel2.xmi#/1"/>
</somemetamodel:A>
<somemetamodel:B/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel" xmlns:somemetamodelextension="http://somemetamodelextension/1.0">
<somemetamodel:C/>
<somemetamodelextension:X/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel">
<somemetamodel:A>
<c href="submodel2.xmi#/0"/>
<x href="submodel2.xmi#/1"/>
</somemetamodel:A>
<somemetamodel:B/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel" xmlns:somemetamodelextension="http://somemetamodelextension/1.0">
<somemetamodel:C/>
<somemetamodelextension:X/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel">
<somemetamodel:A>
<c href="submodel2.xmi#/0"/>
<x href="submodel2.xmi#/1"/>
</somemetamodel:A>
<somemetamodel:B/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel" xmlns:somemetamodelextension="http://somemetamodelextension/1.0">
<somemetamodel:C/>
<somemetamodelextension:X/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel">
<somemetamodel:A>
<c href="submodel2.xmi#/0"/>
<x href="submodel2.xmi#/1"/>
</somemetamodel:A>
<somemetamodel:B/>
</xmi:XMI>
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:somemetamodel="http://somemetamodel" xmlns:somemetamodelextension="http://somemetamodelextension/1.0">
<somemetamodel:C/>
<somemetamodelextension:X/>
</xmi:XMI>
#
pluginName = SomeMetamodel Model
providerName = www.example.org
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<!--
-->
<plugin>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated SomeMetamodel -->
<package
uri="http://somemetamodel"
class="somemetamodel.SomemetamodelPackage"/>
</extension>
</plugin>
package main;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import somemetamodel.A;
import somemetamodel.B;
import somemetamodel.C;
import somemetamodel.SomemetamodelFactory;
public class MainShowNoShare {
public static void main(String[] args) {
// Creating some objects from our metamodel
SomemetamodelFactory factory = SomemetamodelFactory.eINSTANCE;
A a1 = factory.createA();
B b1 = factory.createB();
A a2 = factory.createA();
B b2 = factory.createB();
C cShared = factory.createC();
// Preparing serialization
Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
Map<String, Object> m = reg.getExtensionToFactoryMap();
m.put("xmi", new XMIResourceFactoryImpl());
// Creating the resources (= models) set
ResourceSet resSet = new ResourceSetImpl();
// Creating a first model in the set
Resource model1 = resSet.createResource(URI.createURI("models/model1.xmi"));
model1.getContents().add(a1);
model1.getContents().add(b1);
model1.getContents().add(cShared);
// Creating a second model in the set
Resource model2 = resSet.createResource(URI.createURI("models/model2.xmi"));
model2.getContents().add(a2);
model2.getContents().add(b2);
model2.getContents().add(cShared); //TODO /!\ here C is removed from model1 and added to model2
// model2 = clone(model1)
// Saving the models into files
try {
model1.save(Collections.EMPTY_MAP);
model2.save(Collections.EMPTY_MAP);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment