}
}
- private Resource toResource(InputDependency dependency, SensorContext context) {
- Project project = new Project(dependency.key());
- Resource result = context.getResource(project);
+ private Resource toResource(Project project, InputDependency dependency, SensorContext context) {
+ Project depProject = new Project(dependency.key(), project.getBranch(), dependency.key());
+ Resource result = context.getResource(depProject);
if (result == null || !((Project) result).getAnalysisVersion().equals(dependency.version())) {
- Library lib = new Library(project.getKey(), dependency.version());
+ Library lib = new Library(dependency.key(), dependency.version());
- context.saveResource(lib);
+ index.addResource(lib);
+ // Temporary hack since we need snapshot id to persist dependencies
+ resourcePersister.persist();
result = context.getResource(lib);
}
return result;