summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schanda <schanda@itestra.de>2013-09-25 13:34:41 +0200
committerJohannes Schanda <schanda@itestra.de>2013-09-25 13:34:41 +0200
commitc9f51da32874fdef627da7ff922eec18f47e4f55 (patch)
treec11106e45429e0b0f726e4ae19550ddbaf67dd5f
parent778df1b1f617d3210c894bdf921895193dc9892e (diff)
downloadgenivi-common-api-runtime-2.1.1.tar.gz
Improve detection of file system path of project root2.1.1
-rw-r--r--org.genivi.commonapi.core.validator/src/org/genivi/commonapi/core/validator/ResourceValidator.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/org.genivi.commonapi.core.validator/src/org/genivi/commonapi/core/validator/ResourceValidator.java b/org.genivi.commonapi.core.validator/src/org/genivi/commonapi/core/validator/ResourceValidator.java
index 5a4dbbe..3594885 100644
--- a/org.genivi.commonapi.core.validator/src/org/genivi/commonapi/core/validator/ResourceValidator.java
+++ b/org.genivi.commonapi.core.validator/src/org/genivi/commonapi/core/validator/ResourceValidator.java
@@ -71,17 +71,15 @@ public class ResourceValidator implements IFrancaExternalValidator {
resourceSet = new ResourceSetImpl();
Resource res = model.eResource();
URI uri = res.getURI();
+ int segCount = uri.segmentCount() -2;
String projectName = uri.segment(1);
-
final Path platformPath = new Path(res.getURI().toPlatformString(true));
final IFile file = ResourcesPlugin.getWorkspace().getRoot()
.getFile(platformPath);
IPath filePath = file.getLocation();
- String cwd = filePath.removeLastSegments(1).toString();
- String cutCwd = cwd.substring(0, cwd.lastIndexOf(projectName)
- + projectName.length());
+ String cwd = filePath.removeLastSegments(segCount).toString();
- if (aimBuilder.buildAllInfos(cutCwd)) {
+ if (aimBuilder.buildAllInfos(cwd)) {
fastAllInfo = aimBuilder.fastAllInfo;
} else {
if (!uri.segment(2).toString().equals("bin"))