From feb1afef7c9aac12f280185267b8fa77ad87c895 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Thu, 20 Jan 2011 15:05:21 +0300 Subject: SONAR-2126: Change API to work with project * Add natures and exclusions/inclusions to ProjectDirectory * Deprecate ProjectFileSystem and Project.getFileSystem() * Instead of interface ProjectDefinition provide class only for bootstrap of batch --- .../org/sonar/api/project/ProjectDefinition.java | 76 ----------------- .../org/sonar/api/project/ProjectDirectory.java | 88 ------------------- .../api/resources/DefaultProjectDirectory.java | 98 ++++++++++++++++++++++ .../main/java/org/sonar/api/resources/Natures.java | 18 ++++ .../main/java/org/sonar/api/resources/Project.java | 5 ++ .../org/sonar/api/resources/ProjectDirectory.java | 81 ++++++++++++++++++ .../org/sonar/api/resources/ProjectFileSystem.java | 1 + 7 files changed, 203 insertions(+), 164 deletions(-) delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/project/ProjectDefinition.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/project/ProjectDirectory.java create mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultProjectDirectory.java create mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/resources/Natures.java create mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectDirectory.java (limited to 'sonar-plugin-api/src') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/project/ProjectDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/project/ProjectDefinition.java deleted file mode 100644 index db076fe803d..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/project/ProjectDefinition.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.api.project; - -import org.apache.commons.configuration.Configuration; - -import java.io.File; -import java.util.List; - -/** - * Defines project in a form suitable for Sonar. - * This is a part of bootstrap process, so we should take care about backward compatibility. - *

- * We assume that project is just a set of configuration properties and directories. And each project has unique key in format - * "groupId:artifactId" (for example "org.codehaus.sonar:sonar"). - *

- * - * @since 2.6 - */ -public interface ProjectDefinition { - - /** - * @return project key. - */ - String getKey(); - - /** - * @return project properties. - */ - Configuration getConfiguration(); - - /** - * @return Sonar working directory. - * It's "${project.build.directory}/sonar" ("${project.basedir}/target/sonar") for Maven projects. - */ - File getSonarWorkingDirectory(); - - /** - * @return project root directory. - * It's "${project.basedir}" for Maven projects. - */ - File getBasedir(); - - /** - * @return project directories. - */ - List getDirs(); - - /** - * @return parent project. - */ - ProjectDefinition getParent(); - - /** - * @return list of sub-projects. - */ - List getModules(); - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/project/ProjectDirectory.java b/sonar-plugin-api/src/main/java/org/sonar/api/project/ProjectDirectory.java deleted file mode 100644 index d516a46b959..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/project/ProjectDirectory.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.api.project; - -import java.io.File; -import java.util.List; - -/** - * Defines project directory in a form suitable for Sonar. - * This is a part of bootstrap process, so we should take care about backward compatibility. - *

- * Couple of examples to show what this structure defines: - *

    - *
  • Typical Java project based on Ant might consist of two directories: - *
      - *
    1. sources (location "src", output location "bin", includes "*.java")
    2. - *
    3. resources (location "src", output location "bin", excludes "*.java")
    4. - *
    - *
  • - *
  • Typical Java project based on Maven might consist of four directories: - *
      - *
    1. main sources (location "src/main/java", output location "target/classes")
    2. - *
    3. main resources (location "src/main/resources", output location "target/classes")
    4. - *
    5. test sources (location "src/test/java", output location "target/test-classes")
    6. - *
    7. test resources (location "src/test/resources", output location "target/test-classes")
    8. - *
    - *
  • - *
- *

- * - * @since 2.6 - */ -public interface ProjectDirectory { - - /** - * TODO We should find a more flexible way to specify kind. - * Because actually this is just a logical division to be able to associate different quality profiles for different kinds of directories. - * Imagine that we can have different rules for unit tests, integration tests, performance tests, UI tests and so on. - * But seems that for now this enumeration would cover our needs. - */ - public static enum Kind { - SOURCES, RESOURCES, TESTS, TEST_RESOURCES - } - - /** - * @return kind of underlying files. - */ - Kind getKind(); - - /** - * @return location of files for compilation. - */ - File getLocation(); - - /** - * @return location of binary files after compilation. - * In case of Java this would be directory with Class files. - */ - File getOutputLocation(); - - /** - * @return list of Ant-like inclusion patterns for files. - */ - List getInclusionPatterns(); - - /** - * @return list of Ant-like exclusion patterns for files. - */ - List getExclusionPatterns(); - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultProjectDirectory.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultProjectDirectory.java new file mode 100644 index 00000000000..bdf4ba1a6bb --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultProjectDirectory.java @@ -0,0 +1,98 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2009 SonarSource SA + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.api.resources; + +import com.google.common.collect.Lists; + +import java.io.File; +import java.util.Collections; +import java.util.List; + +public class DefaultProjectDirectory implements ProjectDirectory { + + private String nature; + private File location; + private File outputLocation; + private List inclusionPatterns; + private List exclusionPatterns; + + public String getNature() { + return nature; + } + + public DefaultProjectDirectory setNature(String nature) { + this.nature = nature; + return this; + } + + public File getLocation() { + return location; + } + + public DefaultProjectDirectory setLocation(File location) { + this.location = location; + return this; + } + + public File getOutputLocation() { + return outputLocation; + } + + public DefaultProjectDirectory setOutputLocation(File outputLocation) { + this.outputLocation = outputLocation; + return this; + } + + public List getInclusionPatterns() { + if (inclusionPatterns == null) { + return Collections.emptyList(); + } + return Collections.unmodifiableList(inclusionPatterns); + } + + /** + * @param pattern Ant-like inclusion pattern + */ + public DefaultProjectDirectory addInclusionPattern(String pattern) { + if (inclusionPatterns == null) { + inclusionPatterns = Lists.newArrayList(); + } + inclusionPatterns.add(pattern); + return this; + } + + public List getExclusionPatterns() { + if (exclusionPatterns == null) { + return Collections.emptyList(); + } + return Collections.unmodifiableList(exclusionPatterns); + } + + /** + * @param pattern Ant-like exclusion pattern + */ + public DefaultProjectDirectory addExclusionPattern(String pattern) { + if (exclusionPatterns == null) { + exclusionPatterns = Lists.newArrayList(); + } + exclusionPatterns.add(pattern); + return this; + } +} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Natures.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Natures.java new file mode 100644 index 00000000000..5b8f102fef6 --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Natures.java @@ -0,0 +1,18 @@ +package org.sonar.api.resources; + +/** + * @since 2.6 + */ +public interface Natures { + + /** + * Everything which relate to source code (for example "src/main/java" and "src/main/resources"). + */ + String MAIN = "MAIN"; + + /** + * Everything which relate to unit tests (for example "src/test/java" and "src/test/resources"). + */ + String TEST = "TEST"; + +} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java index e4f14394dfa..11d403a7723 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java @@ -363,12 +363,17 @@ public class Project extends Resource { return this; } + /** + * @deprecated since 2.6. See http://jira.codehaus.org/browse/SONAR-2126 + */ public ProjectFileSystem getFileSystem() { return fileSystem; } /** * For internal use only. + * + * @deprecated since 2.6. See http://jira.codehaus.org/browse/SONAR-2126 */ public Project setFileSystem(ProjectFileSystem fs) { this.fileSystem = fs; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectDirectory.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectDirectory.java new file mode 100644 index 00000000000..4b645a553ce --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectDirectory.java @@ -0,0 +1,81 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2009 SonarSource SA + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.api.resources; + + +import java.io.File; +import java.util.List; + +/** + * Defines project directory in a form suitable for Sonar. + * This is a part of bootstrap process, so we should take care about backward compatibility. + *

+ * Couple of examples to show what this structure defines: + *

    + *
  • Typical Java project based on Ant might consist of two directories: + *
      + *
    1. sources (location "src", output location "bin", includes "*.java")
    2. + *
    3. resources (location "src", output location "bin", excludes "*.java")
    4. + *
    + *
  • + *
  • Typical Java project based on Maven might consist of four directories: + *
      + *
    1. main sources (location "src/main/java", output location "target/classes")
    2. + *
    3. main resources (location "src/main/resources", output location "target/classes")
    4. + *
    5. test sources (location "src/test/java", output location "target/test-classes")
    6. + *
    7. test resources (location "src/test/resources", output location "target/test-classes")
    8. + *
    + *
  • + *
+ *

+ * + * @since 2.6 + */ +public interface ProjectDirectory { + + /** + * @return nature of underlying files. + * @see Natures + */ + String getNature(); + + /** + * @return location of files for compilation. + * In case of Java this would be directory with Java source files. + */ + File getLocation(); + + /** + * @return location of binary files after compilation. + * In case of Java this would be directory with Class files. + */ + File getOutputLocation(); + + /** + * @return list of Ant-like inclusion patterns for files. + */ + List getInclusionPatterns(); + + /** + * @return list of Ant-like exclusion patterns for files. + */ + List getExclusionPatterns(); + +} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectFileSystem.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectFileSystem.java index d6ef7c3a0e6..9440b37daf7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectFileSystem.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectFileSystem.java @@ -26,6 +26,7 @@ import java.util.List; /** * @since 1.10 + * @deprecated since 2.6 */ public interface ProjectFileSystem { /** -- cgit v1.2.3 From 561c33f966fcc7290234077e3ecbde586e2885f0 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Thu, 20 Jan 2011 17:45:08 +0300 Subject: SONAR-2126: Rename ProjectDirectory to FileSystemDirectory --- .../sonar/batch/bootstrap/ProjectDefinition.java | 8 +- .../api/resources/DefaultFileSystemDirectory.java | 98 ++++++++++++++++++++++ .../api/resources/DefaultProjectDirectory.java | 98 ---------------------- .../sonar/api/resources/FileSystemDirectory.java | 81 ++++++++++++++++++ .../org/sonar/api/resources/ProjectDirectory.java | 81 ------------------ 5 files changed, 183 insertions(+), 183 deletions(-) create mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultFileSystemDirectory.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultProjectDirectory.java create mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/resources/FileSystemDirectory.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectDirectory.java (limited to 'sonar-plugin-api/src') diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectDefinition.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectDefinition.java index 578ca9e4a16..d12dc1a9af1 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectDefinition.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectDefinition.java @@ -2,7 +2,7 @@ package org.sonar.batch.bootstrap; import com.google.common.collect.Lists; import org.apache.commons.configuration.Configuration; -import org.sonar.api.resources.ProjectDirectory; +import org.sonar.api.resources.FileSystemDirectory; import java.io.File; import java.util.List; @@ -20,7 +20,7 @@ public class ProjectDefinition { private File workDir; private File basedir; - private List dirs = Lists.newArrayList(); + private List dirs = Lists.newArrayList(); private ProjectDefinition parent; private List modules; @@ -63,11 +63,11 @@ public class ProjectDefinition { /** * @return project directories. */ - public List getDirs() { + public List getDirs() { return dirs; } - public void addDir(ProjectDirectory dir) { + public void addDir(FileSystemDirectory dir) { this.dirs.add(dir); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultFileSystemDirectory.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultFileSystemDirectory.java new file mode 100644 index 00000000000..44461fb4772 --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultFileSystemDirectory.java @@ -0,0 +1,98 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2009 SonarSource SA + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.api.resources; + +import com.google.common.collect.Lists; + +import java.io.File; +import java.util.Collections; +import java.util.List; + +public class DefaultFileSystemDirectory implements FileSystemDirectory { + + private String nature; + private File location; + private File outputLocation; + private List inclusionPatterns; + private List exclusionPatterns; + + public String getNature() { + return nature; + } + + public DefaultFileSystemDirectory setNature(String nature) { + this.nature = nature; + return this; + } + + public File getLocation() { + return location; + } + + public DefaultFileSystemDirectory setLocation(File location) { + this.location = location; + return this; + } + + public File getOutputLocation() { + return outputLocation; + } + + public DefaultFileSystemDirectory setOutputLocation(File outputLocation) { + this.outputLocation = outputLocation; + return this; + } + + public List getInclusionPatterns() { + if (inclusionPatterns == null) { + return Collections.emptyList(); + } + return Collections.unmodifiableList(inclusionPatterns); + } + + /** + * @param pattern Ant-like inclusion pattern + */ + public DefaultFileSystemDirectory addInclusionPattern(String pattern) { + if (inclusionPatterns == null) { + inclusionPatterns = Lists.newArrayList(); + } + inclusionPatterns.add(pattern); + return this; + } + + public List getExclusionPatterns() { + if (exclusionPatterns == null) { + return Collections.emptyList(); + } + return Collections.unmodifiableList(exclusionPatterns); + } + + /** + * @param pattern Ant-like exclusion pattern + */ + public DefaultFileSystemDirectory addExclusionPattern(String pattern) { + if (exclusionPatterns == null) { + exclusionPatterns = Lists.newArrayList(); + } + exclusionPatterns.add(pattern); + return this; + } +} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultProjectDirectory.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultProjectDirectory.java deleted file mode 100644 index bdf4ba1a6bb..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultProjectDirectory.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.api.resources; - -import com.google.common.collect.Lists; - -import java.io.File; -import java.util.Collections; -import java.util.List; - -public class DefaultProjectDirectory implements ProjectDirectory { - - private String nature; - private File location; - private File outputLocation; - private List inclusionPatterns; - private List exclusionPatterns; - - public String getNature() { - return nature; - } - - public DefaultProjectDirectory setNature(String nature) { - this.nature = nature; - return this; - } - - public File getLocation() { - return location; - } - - public DefaultProjectDirectory setLocation(File location) { - this.location = location; - return this; - } - - public File getOutputLocation() { - return outputLocation; - } - - public DefaultProjectDirectory setOutputLocation(File outputLocation) { - this.outputLocation = outputLocation; - return this; - } - - public List getInclusionPatterns() { - if (inclusionPatterns == null) { - return Collections.emptyList(); - } - return Collections.unmodifiableList(inclusionPatterns); - } - - /** - * @param pattern Ant-like inclusion pattern - */ - public DefaultProjectDirectory addInclusionPattern(String pattern) { - if (inclusionPatterns == null) { - inclusionPatterns = Lists.newArrayList(); - } - inclusionPatterns.add(pattern); - return this; - } - - public List getExclusionPatterns() { - if (exclusionPatterns == null) { - return Collections.emptyList(); - } - return Collections.unmodifiableList(exclusionPatterns); - } - - /** - * @param pattern Ant-like exclusion pattern - */ - public DefaultProjectDirectory addExclusionPattern(String pattern) { - if (exclusionPatterns == null) { - exclusionPatterns = Lists.newArrayList(); - } - exclusionPatterns.add(pattern); - return this; - } -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/FileSystemDirectory.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/FileSystemDirectory.java new file mode 100644 index 00000000000..17c8298836c --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/FileSystemDirectory.java @@ -0,0 +1,81 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2009 SonarSource SA + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.api.resources; + + +import java.io.File; +import java.util.List; + +/** + * Defines project directory in a form suitable for Sonar. + * This is a part of bootstrap process, so we should take care about backward compatibility. + *

+ * Couple of examples to show what this structure defines: + *

    + *
  • Typical Java project based on Ant might consist of two directories: + *
      + *
    1. sources (location "src", output location "bin", includes "*.java")
    2. + *
    3. resources (location "src", output location "bin", excludes "*.java")
    4. + *
    + *
  • + *
  • Typical Java project based on Maven might consist of four directories: + *
      + *
    1. main sources (location "src/main/java", output location "target/classes")
    2. + *
    3. main resources (location "src/main/resources", output location "target/classes")
    4. + *
    5. test sources (location "src/test/java", output location "target/test-classes")
    6. + *
    7. test resources (location "src/test/resources", output location "target/test-classes")
    8. + *
    + *
  • + *
+ *

+ * + * @since 2.6 + */ +public interface FileSystemDirectory { + + /** + * @return nature of underlying files. + * @see Natures + */ + String getNature(); + + /** + * @return location of files for compilation. + * In case of Java this would be directory with Java source files. + */ + File getLocation(); + + /** + * @return location of binary files after compilation. + * In case of Java this would be directory with Class files. + */ + File getOutputLocation(); + + /** + * @return list of Ant-like inclusion patterns for files. + */ + List getInclusionPatterns(); + + /** + * @return list of Ant-like exclusion patterns for files. + */ + List getExclusionPatterns(); + +} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectDirectory.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectDirectory.java deleted file mode 100644 index 4b645a553ce..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectDirectory.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.api.resources; - - -import java.io.File; -import java.util.List; - -/** - * Defines project directory in a form suitable for Sonar. - * This is a part of bootstrap process, so we should take care about backward compatibility. - *

- * Couple of examples to show what this structure defines: - *

    - *
  • Typical Java project based on Ant might consist of two directories: - *
      - *
    1. sources (location "src", output location "bin", includes "*.java")
    2. - *
    3. resources (location "src", output location "bin", excludes "*.java")
    4. - *
    - *
  • - *
  • Typical Java project based on Maven might consist of four directories: - *
      - *
    1. main sources (location "src/main/java", output location "target/classes")
    2. - *
    3. main resources (location "src/main/resources", output location "target/classes")
    4. - *
    5. test sources (location "src/test/java", output location "target/test-classes")
    6. - *
    7. test resources (location "src/test/resources", output location "target/test-classes")
    8. - *
    - *
  • - *
- *

- * - * @since 2.6 - */ -public interface ProjectDirectory { - - /** - * @return nature of underlying files. - * @see Natures - */ - String getNature(); - - /** - * @return location of files for compilation. - * In case of Java this would be directory with Java source files. - */ - File getLocation(); - - /** - * @return location of binary files after compilation. - * In case of Java this would be directory with Class files. - */ - File getOutputLocation(); - - /** - * @return list of Ant-like inclusion patterns for files. - */ - List getInclusionPatterns(); - - /** - * @return list of Ant-like exclusion patterns for files. - */ - List getExclusionPatterns(); - -} -- cgit v1.2.3