Skip to content

Commit 11663cf

Browse files
committed
Ignore binary folders
1 parent b867a00 commit 11663cf

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

tmc-langs-csharp/src/main/java/fi/helsinki/cs/tmc/langs/csharp/CSharpPlugin.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,9 @@ private String getBootstrapPath() {
178178
return envVarPath;
179179
}
180180

181-
try {
182-
Scanner in = new Scanner(new FileReader("tmc-langs-csharp/bootstrapPath.txt"));
183-
return in.nextLine();
184-
} catch (Exception e) {
185-
log.error(CANNOT_LOCATE_RUNNER_MESSAGE, e);
186-
return null;
187-
}
181+
log.error(CANNOT_LOCATE_RUNNER_MESSAGE);
182+
183+
return null;
188184
}
189185

190186
private boolean doesProjectContainCSharpFiles(Path path) {

tmc-langs-csharp/src/main/java/fi/helsinki/cs/tmc/langs/csharp/CSharpStudentFilePolicy.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,23 @@ public CSharpStudentFilePolicy(Path configFileParent) {
1313

1414
@Override
1515
public boolean isStudentSourceFile(Path path, Path projectRootPath) {
16+
if (this.isChildOfBinaryDir(path)) {
17+
return false;
18+
}
19+
1620
return path.startsWith(Paths.get("src"));
1721
}
18-
22+
23+
private boolean isChildOfBinaryDir(Path path) {
24+
for (Path testPath : path) {
25+
Path fileName = testPath.getFileName();
26+
27+
if (fileName.equals(Paths.get("bin"))
28+
|| fileName.equals(Paths.get("obj"))) {
29+
return true;
30+
}
31+
}
32+
33+
return false;
34+
}
1935
}

0 commit comments

Comments
 (0)