Update getTargetNameFromTemplatesFileName() to also work on Windows systems
This commit is contained in:
parent
5494e7c73e
commit
9247334a07
|
@ -282,9 +282,8 @@ public class TestGenerator {
|
||||||
public String getTargetNameFromTemplatesFileName() {
|
public String getTargetNameFromTemplatesFileName() {
|
||||||
// runtimeTemplates is like /Users/parrt/antlr/code/antlr4/tool/test/org/antlr/v4/test/runtime/java/Java.test.stg
|
// runtimeTemplates is like /Users/parrt/antlr/code/antlr4/tool/test/org/antlr/v4/test/runtime/java/Java.test.stg
|
||||||
// extra target name
|
// extra target name
|
||||||
int targetEnd = runtimeTemplates.getPath().indexOf(".test.stg");
|
int targetEnd = runtimeTemplates.getName().indexOf(".test.stg");
|
||||||
String targetAtEnd = runtimeTemplates.getPath().substring(0, targetEnd);
|
return runtimeTemplates.getName().substring(0, targetEnd);
|
||||||
return targetAtEnd.substring(targetAtEnd.lastIndexOf('/') + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getOutputDir(String templateFolder) {
|
public File getOutputDir(String templateFolder) {
|
||||||
|
|
Loading…
Reference in New Issue