/** * Find files that match the given patterns * * @param currentSolution * The VS solution being analyzed by sonar * @param currentProject * The VS project being analyzed * @param patterns * A list of paths or ant style patterns delimited by a comma or a semi-comma * @return The files found on the filesystem */ public static Collection<File> findFiles(VisualStudioSolution currentSolution, VisualStudioProject currentProject, String patterns) { String[] patternArray = StringUtils.split(patterns, ",;"); return findFiles(currentSolution, currentProject, patternArray); }
/** * Find directories that match the given patterns * * @param currentSolution * The VS solution being analyzed by sonar * @param currentProject * The VS project being analyzed * @param patternArray * A list of paths or ant style patterns * @return The directories found on the filesystem */ public static Collection<File> findDirectories(VisualStudioSolution currentSolution, VisualStudioProject currentProject, String... patternArray) { Collection<File> files = findFiles(currentSolution, currentProject, patternArray); Collection<File> directories = new ArrayList<File>(); for (File file : files) { if (file.isDirectory()) { directories.add(file); } } return directories; }
/** * Find files that match the given patterns * * @param currentSolution * The VS solution being analyzed by sonar * @param defaultWorkPath * A working path that may be relative to solution root directory * @param patternArray * A list of paths or ant style patterns * @return The files found on the filesystem */ public static Collection<File> findFiles(VisualStudioSolution currentSolution, String defaultWorkPath, String... patternArray) { return findFiles(currentSolution, new File(currentSolution.getSolutionDir(), defaultWorkPath), patternArray); }
protected Collection<File> findAssembliesToScan() { Collection<File> assemblyFiles; if (assembliesToScan.length == 0) { LOG.debug("No assembly specified: will look into 'csproj' files to find which should be analyzed."); assemblyFiles = vsProject.getGeneratedAssemblies(buildConfiguration, buildPlatform); if (assemblyFiles == null || assemblyFiles.isEmpty()) { LOG.warn("No assembly found using csproj file {} with build configuration {} and platform {}", new Object[] {vsProject.getProjectFile(), buildConfiguration, buildPlatform}); } } else { // Some assemblies have been specified: let's analyze them assemblyFiles = FileFinder.findFiles(solution, vsProject, assembliesToScan); if (assemblyFiles.isEmpty()) { LOG.warn("No assembly found using patterns " + StringUtils.join(assembliesToScan, ',')); LOG.warn("Fallback to 'csproj' files to find which should be analyzed."); assemblyFiles = vsProject.getGeneratedAssemblies(buildConfiguration, buildPlatform); } } return assemblyFiles; }
protected Collection<java.io.File> findFiles(Project project, String... queries) { VisualStudioSolution vsSolution = microsoftWindowsEnvironment.getCurrentSolution(); VisualStudioProject vsProject = getVSProject(project); return FileFinder.findFiles(vsSolution, vsProject, queries); }
/** * Find files that match the given patterns * * @param currentSolution * The VS solution being analyzed by sonar * @param currentProject * The VS project being analyzed * @param patternArray * A list of paths or ant style patterns * @return The files found on the filesystem */ public static Collection<File> findFiles(VisualStudioSolution currentSolution, VisualStudioProject currentProject, String... patternArray) { String[] patternArrayProcessed; if (patternArray == null || patternArray.length == 0) { patternArrayProcessed = null; } else { patternArrayProcessed = new String[patternArray.length]; for (int i = 0; i < patternArray.length; i++) { patternArrayProcessed[i] = process(patternArray[i], currentProject); } } return findFiles(currentSolution, currentProject.getDirectory(), patternArrayProcessed); }
if (dotSettingsFilePath != null && !StringUtils.isEmpty(dotSettingsFilePath)) { Collection<File> settingsFiles = FileFinder.findFiles(solution, vsProject, dotSettingsFilePath); if (settingsFiles.size() > 1) { throw new SonarException("More than one file matched the pattern for the ReSharper dotSettings file path");
reportFiles = FileFinder.findFiles(vsSolution, vsProject, reportPath); LOG.info("Reusing FxCop reports: " + Joiner.on(" ").join(reportFiles)); } else {
reportFiles = FileFinder.findFiles(vsSolution, vsProject, reportPath); LOG.info("Reusing Gendarme report: " + Joiner.on(" ").join(reportFiles)); } else {