]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2126: Rename ProjectDirectory to FileSystemDirectory
authorEvgeny Mandrikov <mandrikov@gmail.com>
Thu, 20 Jan 2011 14:45:08 +0000 (17:45 +0300)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Thu, 20 Jan 2011 14:48:40 +0000 (17:48 +0300)
sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectDefinition.java
sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultFileSystemDirectory.java [new file with mode: 0644]
sonar-plugin-api/src/main/java/org/sonar/api/resources/DefaultProjectDirectory.java [deleted file]
sonar-plugin-api/src/main/java/org/sonar/api/resources/FileSystemDirectory.java [new file with mode: 0644]
sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectDirectory.java [deleted file]

index 578ca9e4a161864137b2dfed12270bb8d1624c06..d12dc1a9af1ef959d361a886bfdf9f49c1698526 100644 (file)
@@ -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<ProjectDirectory> dirs = Lists.newArrayList();
+  private List<FileSystemDirectory> dirs = Lists.newArrayList();
 
   private ProjectDefinition parent;
   private List<ProjectDefinition> modules;
@@ -63,11 +63,11 @@ public class ProjectDefinition {
   /**
    * @return project directories.
    */
-  public List<ProjectDirectory> getDirs() {
+  public List<FileSystemDirectory> 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 (file)
index 0000000..44461fb
--- /dev/null
@@ -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<String> inclusionPatterns;
+  private List<String> 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<String> 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<String> 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 (file)
index bdf4ba1..0000000
+++ /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<String> inclusionPatterns;
-  private List<String> 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<String> 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<String> 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 (file)
index 0000000..17c8298
--- /dev/null
@@ -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.
+ * <p>
+ * Couple of examples to show what this structure defines:
+ * <ul>
+ * <li>Typical Java project based on Ant might consist of two directories:
+ * <ol>
+ * <li>sources (location "src", output location "bin", includes "*.java")</li>
+ * <li>resources (location "src", output location "bin", excludes "*.java")</li>
+ * </ol>
+ * </li>
+ * <li>Typical Java project based on Maven might consist of four directories:
+ * <ol>
+ * <li>main sources (location "src/main/java", output location "target/classes")</li>
+ * <li>main resources (location "src/main/resources", output location "target/classes")</li>
+ * <li>test sources (location "src/test/java", output location "target/test-classes")</li>
+ * <li>test resources (location "src/test/resources", output location "target/test-classes")</li>
+ * </ol>
+ * </li>
+ * </ul>
+ * </p>
+ * 
+ * @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<String> getInclusionPatterns();
+
+  /**
+   * @return list of Ant-like exclusion patterns for files.
+   */
+  List<String> 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 (file)
index 4b645a5..0000000
+++ /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.
- * <p>
- * Couple of examples to show what this structure defines:
- * <ul>
- * <li>Typical Java project based on Ant might consist of two directories:
- * <ol>
- * <li>sources (location "src", output location "bin", includes "*.java")</li>
- * <li>resources (location "src", output location "bin", excludes "*.java")</li>
- * </ol>
- * </li>
- * <li>Typical Java project based on Maven might consist of four directories:
- * <ol>
- * <li>main sources (location "src/main/java", output location "target/classes")</li>
- * <li>main resources (location "src/main/resources", output location "target/classes")</li>
- * <li>test sources (location "src/test/java", output location "target/test-classes")</li>
- * <li>test resources (location "src/test/resources", output location "target/test-classes")</li>
- * </ol>
- * </li>
- * </ul>
- * </p>
- * 
- * @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<String> getInclusionPatterns();
-
-  /**
-   * @return list of Ant-like exclusion patterns for files.
-   */
-  List<String> getExclusionPatterns();
-
-}