Skip to content

Commit d93585d

Browse files
Adjusted project property in graph to reflect config path changes
1 parent bb6e950 commit d93585d

File tree

6 files changed

+151
-150
lines changed

6 files changed

+151
-150
lines changed

java/src/main/java/org/jqassistant/plugin/typescript/impl/mapper/core/ProjectMapper.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public class ProjectMapper {
2222
public List<ProjectDescriptor> map(List<Project> projects, Scanner scanner) {
2323
List<ProjectDescriptor> result = new ArrayList<>();
2424

25-
// TODO: scan project root directory for file/directory nodes of projects
2625
// 1. determine all independent root directories (exclude contained ones)
2726
// 2. scan determined directories while ignoring node_modules directory
2827

@@ -40,7 +39,7 @@ public List<ProjectDescriptor> map(List<Project> projects, Scanner scanner) {
4039
LocalFileDescriptor rootDirDescriptor = fileResolver.require(project.getRootPath(), LocalFileDescriptor.class, scanner.getContext());
4140
projectDescriptor.setRootDirectory(rootDirDescriptor);
4241

43-
LocalFileDescriptor configFileDescriptor = fileResolver.require(project.getProjectPath() + "/tsconfig.json", LocalFileDescriptor.class, scanner.getContext());
42+
LocalFileDescriptor configFileDescriptor = fileResolver.require(project.getConfigPath(), LocalFileDescriptor.class, scanner.getContext());
4443
projectDescriptor.setConfigFile(configFileDescriptor);
4544

4645
projectDescriptor.getModules().addAll(
@@ -61,16 +60,15 @@ public List<ProjectDescriptor> map(List<Project> projects, Scanner scanner) {
6160
Optional<Project> projectOpt = projects.stream()
6261
.filter(p -> {
6362
var configFilePath = projectDescriptor.getConfigFile().getAbsoluteFileName();
64-
var projectDir = configFilePath.substring(0, configFilePath.length() - "/tsconfig.json".length());
65-
return projectDir.equals(p.getProjectPath());
63+
return configFilePath.equals(p.getConfigPath());
6664
})
6765
.findFirst();
6866
if (projectOpt.isPresent()) {
6967
Project project = projectOpt.get();
7068

7169
project.getSubProjectPaths().forEach(spp -> {
7270
Optional<ProjectDescriptor> subprojectDescriptorOpt = result.stream()
73-
.filter(pd -> pd.getConfigFile().getAbsoluteFileName().equals(spp + "/tsconfig.json"))
71+
.filter(pd -> pd.getConfigFile().getAbsoluteFileName().equals(spp))
7472
.findFirst();
7573

7674
if (subprojectDescriptorOpt.isPresent()) {
@@ -80,11 +78,6 @@ public List<ProjectDescriptor> map(List<Project> projects, Scanner scanner) {
8078
}
8179
});
8280

83-
// TODO: Should we transitively add modules? Maybe with flagged relationships?
84-
// context.getStore().executeQuery(
85-
// "MATCH (project:TS:Project)-[:REFERENCES]->(subproject:TS:Project)-[:CONTAINS]->(module:TS:Module)" +
86-
// "CREATE (project)-[:CONTAINS]->(module)"
87-
// );
8881
} else {
8982
throw new IllegalStateException("Could not find project for config file path: " + projectDescriptor.getConfigFile().getFileName());
9083
}

java/src/main/java/org/jqassistant/plugin/typescript/impl/model/core/Project.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class Project {
1515

1616
private String rootPath;
1717

18-
private String projectPath;
18+
private String configPath;
1919

2020
private List<String> subProjectPaths = new ArrayList<>();
2121

0 commit comments

Comments
 (0)