001 /*
002 * SonarQube, open source software quality management tool.
003 * Copyright (C) 2008-2013 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * SonarQube is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * SonarQube is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public License
017 * along with this program; if not, write to the Free Software Foundation,
018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
019 */
020 package org.sonar.api.scan.filesystem;
021
022 import org.sonar.api.BatchComponent;
023
024 import javax.annotation.CheckForNull;
025
026 import java.io.File;
027 import java.nio.charset.Charset;
028 import java.util.List;
029
030 /**
031 * @since 3.5
032 */
033 public interface ModuleFileSystem extends BatchComponent {
034 /**
035 * Base directory.
036 */
037 File baseDir();
038
039 /**
040 * Optional directory used by the build tool to generate various kinds of data (test reports, temp files, ...).
041 * In Maven, it's given by the property ${project.build.directory}, which value is generally ${project.basedir}/target.
042 */
043 @CheckForNull
044 File buildDir();
045
046 /**
047 * Source directories. Non-existing directories are excluded.
048 * Example in Maven : ${project.basedir}/src/main/java
049 */
050 List<File> sourceDirs();
051
052 /**
053 * Test directories. Non-existing directories are excluded.
054 * Example in Maven : ${project.basedir}/src/test/java
055 */
056 List<File> testDirs();
057
058 /**
059 * Optional directories that contain the compiled sources, for example java bytecode.
060 * Note that :
061 * <ul>
062 * <li>Maven projects have only a single binary directory, which is generally ${project.basedir}/target/classes</li>
063 * <li>Binary directories can be empty</li>
064 * <li>Test binary directories are not supported yet.</li>
065 * </ul>
066 */
067 List<File> binaryDirs();
068
069 /**
070 * Search for files. Never return null.
071 */
072 List<File> files(FileQuery query);
073
074
075 /**
076 * Charset of source and test files. If it's not defined, then return the platform default charset.
077 */
078 Charset sourceCharset();
079
080 /**
081 * Working directory used by Sonar. This directory can be used for example to store intermediary reports.
082 */
083 File workingDir();
084 }