Skip to content

Commit e169e89

Browse files
committed
Fix a bug determining location of .tmcproject.yml
1 parent e4d844f commit e169e89

File tree

12 files changed

+17
-20
lines changed

12 files changed

+17
-20
lines changed

build-tools/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>fi.helsinki.cs.tmc</groupId>
44
<artifactId>build-tools</artifactId>
5-
<version>0.7.10-SNAPSHOT</version>
5+
<version>0.7.11-SNAPSHOT</version>
66
<name>build-tools</name>
77

88
<!-- Deploy to maven.testmycode.net/nexus -->

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>fi.helsinki.cs.tmc</groupId>
55
<artifactId>tmc-langs</artifactId>
6-
<version>0.7.10-SNAPSHOT</version>
6+
<version>0.7.11-SNAPSHOT</version>
77
<packaging>pom</packaging>
88
<name>tmc-langs</name>
99
<url>http://testmycode.net</url>

tmc-langs-cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>tmc-langs</artifactId>
66
<groupId>fi.helsinki.cs.tmc</groupId>
7-
<version>0.7.10-SNAPSHOT</version>
7+
<version>0.7.11-SNAPSHOT</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

tmc-langs-framework/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>fi.helsinki.cs.tmc</groupId>
66
<artifactId>tmc-langs</artifactId>
7-
<version>0.7.10-SNAPSHOT</version>
7+
<version>0.7.11-SNAPSHOT</version>
88
<relativePath>../</relativePath>
99
</parent>
1010
<properties>

tmc-langs-framework/src/main/java/fi/helsinki/cs/tmc/langs/io/ConfigurableStudentFilePolicy.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public abstract class ConfigurableStudentFilePolicy implements StudentFilePolicy
2727

2828
private List<Path> extraStudentFiles;
2929
private List<Path> forceUpdateFiles;
30-
private Path rootPath;
3130

3231
public ConfigurableStudentFilePolicy(Path configFileParent) {
3332
this.configFileParentPath = configFileParent;
@@ -58,23 +57,21 @@ public boolean isStudentFile(Path path, Path projectRootPath) {
5857
return false;
5958
}
6059

61-
this.rootPath = projectRootPath;
62-
63-
return isExtraStudentFile(path)
60+
return isExtraStudentFile(path, projectRootPath)
6461
|| projectRootPath.equals(path)
6562
|| isStudentSourceFile(
6663
path.subpath(projectRootPath.getNameCount(), path.getNameCount()),
6764
projectRootPath);
6865
}
6966

7067
/** Determines whether a file is an <tt>ExtraStudentFile</tt>. */
71-
private boolean isExtraStudentFile(Path path) {
68+
private boolean isExtraStudentFile(Path path, Path rootPath) {
7269
if (extraStudentFiles == null) {
7370
TmcProjectYmlParser parser = new TmcProjectYmlParser(configFileParentPath);
7471
extraStudentFiles = parser.parseExtraStudentFiles();
7572
}
7673

77-
return isPathWhitelisted(path, extraStudentFiles);
74+
return isPathWhitelisted(path, extraStudentFiles, rootPath);
7875
}
7976

8077
@Override
@@ -85,14 +82,14 @@ public boolean mayDelete(Path file, Path projectRoot) {
8582
@Override
8683
public boolean isUpdatingForced(Path path, Path projectRootPath) {
8784
if (forceUpdateFiles == null) {
88-
TmcProjectYmlParser parser = new TmcProjectYmlParser(rootPath);
85+
TmcProjectYmlParser parser = new TmcProjectYmlParser(projectRootPath);
8986
forceUpdateFiles = parser.parseForceUpdateFiles();
9087
}
9188

92-
return isPathWhitelisted(path, forceUpdateFiles);
89+
return isPathWhitelisted(path, forceUpdateFiles, projectRootPath);
9390
}
9491

95-
private boolean isPathWhitelisted(Path path, List<Path> paths) {
92+
private boolean isPathWhitelisted(Path path, List<Path> paths, Path rootPath) {
9693
for (Path whitelistedPath : paths) {
9794
Path whitelistedFullPath = rootPath.resolve(whitelistedPath).toAbsolutePath();
9895
Path fullPath = path.toAbsolutePath();

tmc-langs-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>fi.helsinki.cs.tmc</groupId>
66
<artifactId>tmc-langs</artifactId>
7-
<version>0.7.10-SNAPSHOT</version>
7+
<version>0.7.11-SNAPSHOT</version>
88
</parent>
99

1010
<properties>

tmc-langs-make/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>fi.helsinki.cs.tmc</groupId>
66
<artifactId>tmc-langs</artifactId>
7-
<version>0.7.10-SNAPSHOT</version>
7+
<version>0.7.11-SNAPSHOT</version>
88
</parent>
99

1010
<properties>

tmc-langs-notests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>fi.helsinki.cs.tmc</groupId>
66
<artifactId>tmc-langs</artifactId>
7-
<version>0.7.10-SNAPSHOT</version>
7+
<version>0.7.11-SNAPSHOT</version>
88
</parent>
99

1010
<properties>

tmc-langs-python3/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>fi.helsinki.cs.tmc</groupId>
66
<artifactId>tmc-langs</artifactId>
7-
<version>0.7.10-SNAPSHOT</version>
7+
<version>0.7.11-SNAPSHOT</version>
88
</parent>
99

1010
<properties>

tmc-langs-qmake/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>fi.helsinki.cs.tmc</groupId>
66
<artifactId>tmc-langs</artifactId>
7-
<version>0.7.10-SNAPSHOT</version>
7+
<version>0.7.11-SNAPSHOT</version>
88
</parent>
99

1010
<properties>

0 commit comments

Comments
 (0)