Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2013-10-05 21:38:21 +0000
committerAnsgar Radermacher2013-10-08 12:37:28 +0000
commit7daafa626a704d73617ece5e3961fdcb717670a0 (patch)
tree8a5ef83eb37cc7ef674bc1a1aca5f333a76b23c4 /extraplugins
parenteb9de3f93dcd0822e0a7a22691b21278f568403a (diff)
downloadorg.eclipse.papyrus-7daafa626a704d73617ece5e3961fdcb717670a0.tar.gz
org.eclipse.papyrus-7daafa626a704d73617ece5e3961fdcb717670a0.tar.xz
org.eclipse.papyrus-7daafa626a704d73617ece5e3961fdcb717670a0.zip
Fixed Acceleo driver
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoDriver.java40
1 files changed, 22 insertions, 18 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoDriver.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoDriver.java
index 83e9d4f3a8f..1275dce345a 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoDriver.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoDriver.java
@@ -108,31 +108,35 @@ public class AcceleoDriver {
String fileNameCandidate = pluginNameCandidate + binSep + relativePath +
DOT + IAcceleoConstants.EMTL_FILE_EXTENSION;
- // String absoluteFileName = Utils.getAbsoluteFN(fileNameCandidate);
- // if(absoluteFileName != null) {
- // }
URI uri = URI.createPlatformPluginURI(fileNameCandidate, true);
try {
Resource r = acceleoResourceSet.getResource(uri, true);
if(r != null) {
- // use absolute path, if possible, i.e. if file exists at absolute path
- // this is required, since Acceleo references dependent files using a relative
- // path.
- // This workaround is no longer required. In the contrary, it is harmful for binary
- // build
+ if (pass == 0) {
+ // use absolute path during first pass, i.e. if file exists at absolute path
+ // this is required, since Acceleo references dependent files using a relative
+ // path (this applies to debugging in 2nd instance only, if a plugin is deployed,
+ // references within the EMTL file become platform:/plugin references and the
+ // workaround is not useful or even harmful).
+ // This workaround is only required, if referencing and referenced plugins
+ // are in different folders (example: tracing)
- /*
- String absoluteFileName = Utils.getAbsoluteFN(uri.toString());
- if(absoluteFileName != null) {
- File fileCandidate = new File(absoluteFileName);
- if(fileCandidate.exists()) {
- // remove resource with "wrong" URI
- removeURIfromResourceSet(uri);
- return URI.createFileURI(fileCandidate.getAbsolutePath());
+ String absoluteFileName = Utils.getAbsoluteFN(uri.toString());
+ if(absoluteFileName != null) {
+ File fileCandidate = new File(absoluteFileName);
+ if(fileCandidate.exists()) {
+ // remove resource with "wrong" URI
+ removeURIfromResourceSet(uri);
+ return URI.createFileURI(fileCandidate.getAbsolutePath());
+ }
}
- }
- */
+ }
+ return uri;
+ }
+ uri = URI.createPlatformPluginURI(fileNameCandidate, true);
+ r = acceleoResourceSet.getResource(uri, true);
+ if (r != null) {
return uri;
}
} catch (Exception e) {

Back to the top