Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-04-13 11:57:51 +0000
committerEike Stepper2018-04-13 11:57:51 +0000
commit8b093e62318d58853151c6bd96e1f9da45abd88f (patch)
tree0b641861dc783a714961f09541c1e3c563b38fa7 /plugins
parentabb5ccbe990ead832271dd624473d2a25aec5aa5 (diff)
downloadcdo-8b093e62318d58853151c6bd96e1f9da45abd88f.tar.gz
cdo-8b093e62318d58853151c6bd96e1f9da45abd88f.tar.xz
cdo-8b093e62318d58853151c6bd96e1f9da45abd88f.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/migrator/tasks/MigrateModelTask.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/tasks/ProjectImportTask.java18
2 files changed, 15 insertions, 15 deletions
diff --git a/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/tasks/MigrateModelTask.java b/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/tasks/MigrateModelTask.java
index a30ab1662a..fd1229ef36 100644
--- a/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/tasks/MigrateModelTask.java
+++ b/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/tasks/MigrateModelTask.java
@@ -24,13 +24,13 @@ import java.io.File;
*/
public class MigrateModelTask extends CDOTask
{
- private File location;
+ private File modelLocation;
private boolean dynamicFeatureDelegation;
- public void setLocation(File location)
+ public void setModelLocation(File modelLocation)
{
- this.location = location;
+ this.modelLocation = modelLocation;
}
public void setDynamicFeatureDelegation(boolean dynamicFeatureDelegation)
@@ -41,14 +41,14 @@ public class MigrateModelTask extends CDOTask
@Override
protected void checkAttributes() throws BuildException
{
- assertTrue("'location' must be specified.", location != null);
- assertTrue("'location' must be point to an existing file.", location.isFile());
+ assertTrue("'modelLocation' must be specified.", modelLocation != null);
+ assertTrue("'modelLocation' must be point to an existing file.", modelLocation.isFile());
}
@Override
protected void doExecute() throws Exception
{
- GenModel genModel = CDOMigratorUtil.getGenModel(location.getAbsolutePath());
+ GenModel genModel = CDOMigratorUtil.getGenModel(modelLocation.getAbsolutePath());
GenDelegationKind featureDelegation = dynamicFeatureDelegation ? GenDelegationKind.DYNAMIC_LITERAL : GenDelegationKind.REFLECTIVE_LITERAL;
String result = CDOMigratorUtil.adjustGenModel(genModel, featureDelegation);
diff --git a/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/tasks/ProjectImportTask.java b/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/tasks/ProjectImportTask.java
index 1546aed0cd..4b23ee759d 100644
--- a/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/tasks/ProjectImportTask.java
+++ b/plugins/org.eclipse.emf.cdo.migrator/src/org/eclipse/emf/cdo/internal/migrator/tasks/ProjectImportTask.java
@@ -27,24 +27,24 @@ public class ProjectImportTask extends CDOTask
{
private String projectName;
- private File location;
+ private File fromLocation;
public void setProjectName(String projectName)
{
this.projectName = projectName;
}
- public void setLocation(File location)
+ public void setFromLocation(File fromLocation)
{
- this.location = location;
+ this.fromLocation = fromLocation;
}
@Override
protected void checkAttributes() throws BuildException
{
assertTrue("'projectName' must be specified.", projectName != null && projectName.length() != 0);
- assertTrue("'location' must be specified.", location != null);
- assertTrue("'location' must be point to an existing directory.", location.isDirectory());
+ assertTrue("'fromLocation' must be specified.", fromLocation != null);
+ assertTrue("'fromLocation' must be point to an existing directory.", fromLocation.isDirectory());
}
@Override
@@ -54,17 +54,17 @@ public class ProjectImportTask extends CDOTask
if (project.exists())
{
File existingLocation = new File(project.getLocation().toOSString()).getCanonicalFile();
- if (!existingLocation.equals(location))
+ if (!existingLocation.equals(fromLocation))
{
throw new BuildException("Project " + projectName + " exists in different location: " + existingLocation);
}
- System.out.println("Project " + location + " is already imported.");
+ System.out.println("Project " + fromLocation + " is already imported.");
return;
}
- System.out.println("Importing project " + location + " ...");
- IPath locationPath = new Path(location.getAbsolutePath());
+ System.out.println("Importing project " + fromLocation + " ...");
+ IPath locationPath = new Path(fromLocation.getAbsolutePath());
IProjectDescription projectDescription = workspace.newProjectDescription(projectName);
projectDescription.setLocation(locationPath);

Back to the top