|
9 | 9 | import java.io.File; |
10 | 10 | import java.util.function.Function; |
11 | 11 |
|
12 | | -import static java.util.Arrays.asList; |
13 | | - |
14 | 12 | public class ProjectFilePaths { |
15 | 13 |
|
16 | 14 | private static final Logger LOG = Logger.getInstance(ProjectFilePaths.class); |
17 | 15 |
|
18 | 16 | private static final String IDEA_PROJECT_DIR = "$PROJECT_DIR$"; |
19 | | - private static final String LEGACY_PROJECT_DIR = "$PRJ_DIR$"; |
20 | 17 |
|
21 | 18 | private final ProjectPaths projectPaths; |
22 | 19 | private final Project project; |
@@ -114,18 +111,16 @@ public String detokenise(@Nullable final String tokenisedPath) { |
114 | 111 | } |
115 | 112 |
|
116 | 113 | private String replaceProjectToken(final String path) { |
117 | | - for (String projectDirToken : asList(IDEA_PROJECT_DIR, LEGACY_PROJECT_DIR)) { |
118 | | - int prefixLocation = path.indexOf(projectDirToken); |
119 | | - if (prefixLocation >= 0) { |
120 | | - final File projectPath = projectPath(); |
121 | | - if (projectPath != null) { |
122 | | - final String projectRelativePath = toSystemPath(path.substring(prefixLocation + projectDirToken.length())); |
123 | | - final String completePath = projectPath + File.separator + projectRelativePath; |
124 | | - return absolutePathOf.apply(new File(completePath)); |
125 | | - |
126 | | - } else { |
127 | | - LOG.warn("Could not detokenise path as project dir is unset: " + path); |
128 | | - } |
| 114 | + int prefixLocation = path.indexOf(IDEA_PROJECT_DIR); |
| 115 | + if (prefixLocation >= 0) { |
| 116 | + final File projectPath = projectPath(); |
| 117 | + if (projectPath != null) { |
| 118 | + final String projectRelativePath = toSystemPath(path.substring(prefixLocation + IDEA_PROJECT_DIR.length())); |
| 119 | + final String completePath = projectPath + File.separator + projectRelativePath; |
| 120 | + return absolutePathOf.apply(new File(completePath)); |
| 121 | + |
| 122 | + } else { |
| 123 | + LOG.warn("Could not detokenise path as project dir is unset: " + path); |
129 | 124 | } |
130 | 125 | } |
131 | 126 | return null; |
|
0 commit comments