Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-04-13 13:56:20 +0000
committerEike Stepper2018-04-13 13:56:20 +0000
commitdfdd2931254edde04b2109931c08e188f37cf0fe (patch)
tree26b202b8616f3d8f36a29f37defa2d4160f7d392 /plugins
parent0bcf6ad1707430639cd95d484e516c28e6ad9263 (diff)
downloadcdo-dfdd2931254edde04b2109931c08e188f37cf0fe.tar.gz
cdo-dfdd2931254edde04b2109931c08e188f37cf0fe.tar.xz
cdo-dfdd2931254edde04b2109931c08e188f37cf0fe.zip
[Releng] Add Ant task to migrate GenModels
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/messages/messages.properties3
-rw-r--r--plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/CDOMigratorUtil.java29
2 files changed, 28 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/messages/messages.properties b/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/messages/messages.properties
index 01dc7a3882..360f563ab3 100644
--- a/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/messages/messages.properties
+++ b/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/messages/messages.properties
@@ -16,6 +16,9 @@ CDOImporterWizard_1=Ecore &Import
CDOImporterWizard_2=Specify one or more '.ecore' or '.emof' URIs, try to load them, and choose a file name for the generator model
CDOImporterWizard_3=Specify one or more '.ecore' or '.emof' URIs and try to load them
CDOImporterWizard_4=EcorePackages
+CDOMigratorUtil.1=Set Boolean Flags Field =
+CDOMigratorUtil.2=Set Boolean Flags Reserved Bits =
+CDOMigratorUtil.3=Set Packed Enums =
CDOMigratorUtil.4=Set Feature Delegation =
CDOMigratorUtil.6=Set Root Extends Class =
CDOMigratorUtil.8=Set Root Extends Interface =
diff --git a/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/CDOMigratorUtil.java b/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/CDOMigratorUtil.java
index dc072fb32c..52483d9a6e 100644
--- a/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/CDOMigratorUtil.java
+++ b/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/CDOMigratorUtil.java
@@ -53,13 +53,13 @@ public abstract class CDOMigratorUtil
public static GenModel getGenModel(String path)
{
ResourceSet resourceSet = new ResourceSetImpl();
-
+
Map<String, Object> map = resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap();
map.put("*", new XMIResourceFactoryImpl()); //$NON-NLS-1$
-
+
URI uri = URI.createPlatformResourceURI(path, false);
Resource resource = resourceSet.getResource(uri, true);
-
+
EList<EObject> contents = resource.getContents();
if (!contents.isEmpty())
{
@@ -69,7 +69,7 @@ public abstract class CDOMigratorUtil
return (GenModel)object;
}
}
-
+
return null;
}
@@ -91,6 +91,27 @@ public abstract class CDOMigratorUtil
builder.append("\n"); //$NON-NLS-1$
}
+ if (genModel.getBooleanFlagsField() != null)
+ {
+ genModel.setBooleanFlagsField(null);
+ builder.append(Messages.getString("CDOMigratorUtil.1")); //$NON-NLS-1$
+ builder.append(" null\n"); //$NON-NLS-1$
+ }
+
+ if (genModel.getBooleanFlagsReservedBits() != -1)
+ {
+ genModel.setBooleanFlagsReservedBits(-1);
+ builder.append(Messages.getString("CDOMigratorUtil.2")); //$NON-NLS-1$
+ builder.append(" -1\n"); //$NON-NLS-1$
+ }
+
+ if (genModel.isPackedEnums())
+ {
+ genModel.setPackedEnums(false);
+ builder.append(Messages.getString("CDOMigratorUtil.3")); //$NON-NLS-1$
+ builder.append(" false\n"); //$NON-NLS-1$
+ }
+
if (!ROOT_EXTENDS_CLASS.equals(genModel.getRootExtendsClass()))
{
genModel.setRootExtendsClass(ROOT_EXTENDS_CLASS);

Back to the top