diff options
author | 2018-02-24 18:39:06 -0500 | |
---|---|---|
committer | 2018-02-24 18:39:06 -0500 | |
commit | 2f91724b6eafea3636f125ba25e9814233bcc24a (patch) | |
tree | aeed449f15cecb5176dc6e6d09d00eb0425bdd73 /Framework/hu.bme.mit.inf.dslreasoner.logic.model | |
parent | Documentation level is in the config interface (diff) | |
download | VIATRA-Generator-2f91724b6eafea3636f125ba25e9814233bcc24a.tar.gz VIATRA-Generator-2f91724b6eafea3636f125ba25e9814233bcc24a.tar.zst VIATRA-Generator-2f91724b6eafea3636f125ba25e9814233bcc24a.zip |
Project workspace folder structure generation patch
Diffstat (limited to 'Framework/hu.bme.mit.inf.dslreasoner.logic.model')
-rw-r--r-- | Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ProjectWorkspace.xtend | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ProjectWorkspace.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ProjectWorkspace.xtend index a1560258..c7e4dcbf 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ProjectWorkspace.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ProjectWorkspace.xtend | |||
@@ -22,11 +22,11 @@ class ProjectWorkspace extends ReasonerWorkspace{ | |||
22 | } | 22 | } |
23 | 23 | ||
24 | override protected getURI(String name) { | 24 | override protected getURI(String name) { |
25 | URI.createPlatformResourceURI(targetFolder + "/" + prefix + name,true); | 25 | URI.createURI(targetFolder + "/" + prefix + name,true); |
26 | } | 26 | } |
27 | 27 | ||
28 | def protected getDirUri() { | 28 | def protected getDirUri() { |
29 | URI.createPlatformResourceURI(targetFolder,true) | 29 | URI.createURI(targetFolder,true) |
30 | } | 30 | } |
31 | 31 | ||
32 | override getWorkspaceURI() { | 32 | override getWorkspaceURI() { |
@@ -35,7 +35,13 @@ class ProjectWorkspace extends ReasonerWorkspace{ | |||
35 | 35 | ||
36 | override initAndClear() { | 36 | override initAndClear() { |
37 | target = ResourcesPlugin.workspace.root | 37 | target = ResourcesPlugin.workspace.root |
38 | for(nameSegment : dirUri.segments) { | 38 | |
39 | val segments = if(dirUri.platformResource) { | ||
40 | dirUri.segments.subList(1,dirUri.segments.size) | ||
41 | } else { | ||
42 | throw new UnsupportedOperationException('''Only platform resources are supported, but recieved: "«dirUri»"!''') | ||
43 | } | ||
44 | for(nameSegment : segments) { | ||
39 | target = createContainer(target,nameSegment) | 45 | target = createContainer(target,nameSegment) |
40 | } | 46 | } |
41 | target.members.forEach[delete(false,monitor)] | 47 | target.members.forEach[delete(false,monitor)] |
@@ -55,16 +61,16 @@ class ProjectWorkspace extends ReasonerWorkspace{ | |||
55 | 61 | ||
56 | def protected dispatch createContainer(IProject root, String name) { | 62 | def protected dispatch createContainer(IProject root, String name) { |
57 | val folder = root.getFolder(name); | 63 | val folder = root.getFolder(name); |
58 | if(folder.exists) { | 64 | if(!folder.exists) { |
59 | folder.create(false,true,monitor) | 65 | folder.create(true,true,monitor) |
60 | } | 66 | } |
61 | return folder | 67 | return folder |
62 | } | 68 | } |
63 | 69 | ||
64 | def protected dispatch createContainer(IFolder root, String name) { | 70 | def protected dispatch createContainer(IFolder root, String name) { |
65 | val folder = root.getFolder(name); | 71 | val folder = root.getFolder(name); |
66 | if(folder.exists) { | 72 | if(!folder.exists) { |
67 | folder.create(false,true,monitor) | 73 | folder.create(true,true,monitor) |
68 | } | 74 | } |
69 | return folder | 75 | return folder |
70 | } | 76 | } |
@@ -100,7 +106,7 @@ class ProjectWorkspace extends ReasonerWorkspace{ | |||
100 | } | 106 | } |
101 | 107 | ||
102 | override subWorkspace(String targetFolder, String prefix) { | 108 | override subWorkspace(String targetFolder, String prefix) { |
103 | throw new UnsupportedOperationException("TODO: auto-generated method stub") | 109 | return new ProjectWorkspace(this.targetFolder+"/"+targetFolder,this.prefix + prefix); |
104 | } | 110 | } |
105 | 111 | ||
106 | override allFiles() { | 112 | override allFiles() { |