Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordwagelaar2014-11-11 14:13:58 +0000
committerdwagelaar2014-11-11 14:13:58 +0000
commitd694049ac3f04dc2123a59e7528c6a5c4c5d0b25 (patch)
tree7fcc6a28146f47552c48c2efc55304c91c7db4ea
parentb9043ed03fb7d680aa7789272e6c14a2764ef2f1 (diff)
downloadorg.eclipse.atl-d694049ac3f04dc2123a59e7528c6a5c4c5d0b25.tar.gz
org.eclipse.atl-d694049ac3f04dc2123a59e7528c6a5c4c5d0b25.tar.xz
org.eclipse.atl-d694049ac3f04dc2123a59e7528c6a5c4c5d0b25.zip
Log warning when changing the URI of an in/out model within the
emftvm.run task.
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/RunTask.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/RunTask.java b/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/RunTask.java
index 335bef1c..31c09671 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/RunTask.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/RunTask.java
@@ -15,6 +15,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
+import org.apache.tools.ant.Project;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -34,7 +35,7 @@ public class RunTask extends EMFTVMTask {
private String module;
private String modulePath;
- private boolean disableJIT = true; //TODO
+ private boolean disableJIT;
private final List<MetaModel> metaModels = new ArrayList<MetaModel>();
private final List<InModel> inputModels = new ArrayList<InModel>();
private final List<InOutModel> inoutModels = new ArrayList<InOutModel>();
@@ -233,12 +234,17 @@ public class RunTask extends EMFTVMTask {
} else {
// Use existing in/out model, but override URI if given
String u = m.getUri();
+ URI uri = null;
if (u != null) {
- model.getResource().setURI(URI.createURI(u));
+ uri = URI.createURI(u);
}
String wsp = m.getWspath();
if (wsp != null) {
- model.getResource().setURI(URI.createPlatformResourceURI(wsp, true));
+ uri = URI.createPlatformResourceURI(wsp, true);
+ }
+ if (uri != null) {
+ getProject().log(this, String.format("Changing the URI of in/out model '%s' before executing a transformation will break inter-model references ('%s' -> '%s')", m.getName(), model.getResource().getURI(), uri), Project.MSG_WARN);
+ model.getResource().setURI(uri);
}
}
env.registerInOutModel(getModelKey(m), model);

Back to the top