private ResourceDao resourceDao;
private DryRun dryRun;
- private ProjectFileSystem fileSystem;
private Languages languages;
- public ProjectInitializer(ResourceDao resourceDao, DryRun dryRun, ProjectFileSystem fileSystem, Languages languages) {
+ public ProjectInitializer(ResourceDao resourceDao, DryRun dryRun, Languages languages) {
this.resourceDao = resourceDao;
this.dryRun = dryRun;
- this.fileSystem = fileSystem;
this.languages = languages;
}
public void execute(Project project, ProjectSettings settings) {
initLanguage(project, settings);
- initFileSystem(project);
}
private void initLanguage(Project project, ProjectSettings settings) {
}
}
-
- private void initFileSystem(Project project) {
- // TODO See http://jira.codehaus.org/browse/SONAR-2126
- // previously MavenProjectBuilder was responsible for creation of ProjectFileSystem
- project.setFileSystem(fileSystem);
-
- }
}
public DefaultProjectFileSystem(Project project, Languages languages) {
this.project = project;
this.languages = languages;
+ // TODO See http://jira.codehaus.org/browse/SONAR-2126
+ // previously MavenProjectBuilder was responsible for creation of ProjectFileSystem
+ project.setFileSystem(this);
}
public DefaultProjectFileSystem(Project project, Languages languages, FileFilter... fileFilters) {
public void resolvePathShouldReturnCanonicalFile() {
MavenProject pom = mock(MavenProject.class);
when(pom.getBasedir()).thenReturn(new File("/project"));
- Project project = new Project("").setPom(pom);
+ Project project = new Project("foo").setPom(pom);
DefaultProjectFileSystem fs = new DefaultProjectFileSystem(project, null);
assertThat(fs.resolvePath(".").getAbsolutePath(), endsWith("project"));
public void shouldExcludeDirectoriesStartingWithDot() {
List<File> dirs = Arrays.asList(new File("test-resources/org/sonar/api/resources/DefaultProjectFileSystemTest/shouldExcludeDirectoriesStartingWithDot/src"));
- List<InputFile> files = new DefaultProjectFileSystem(null, null).getFiles(dirs, Collections.<File>emptyList(), false);
+ List<InputFile> files = new DefaultProjectFileSystem(new Project("foo"), null).getFiles(dirs, Collections.<File>emptyList(), false);
assertThat(files.size(), is(1));
assertThat(files.get(0).getRelativePath(), is("org/sonar/Included.java"));
}