diff options
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java | 5 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java index 4c08735f062..33c23cd3f7e 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java @@ -190,6 +190,11 @@ public class ProjectDefinition { public String getVersion() { return properties.get(CoreProperties.PROJECT_VERSION_PROPERTY); } + + @CheckForNull + public String getOriginalName() { + return properties.get(CoreProperties.PROJECT_NAME_PROPERTY); + } public String getName() { String name = properties.get(CoreProperties.PROJECT_NAME_PROPERTY); 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 a4d68e49f84..31b7bcdf639 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 @@ -59,6 +59,7 @@ public class Project extends Resource implements Component { private Date analysisDate; private String analysisVersion; private Settings settings; + private String originalName; // For internal use private java.io.File baseDir; @@ -76,9 +77,11 @@ public class Project extends Resource implements Component { if (StringUtils.isNotBlank(branch)) { setKey(String.format(BRANCH_KEY_FORMAT, key, branch)); this.name = String.format("%s %s", name, branch); + this.originalName = String.format("%s %s", name, branch); } else { setKey(key); this.name = name; + this.originalName = name; } setEffectiveKey(getKey()); this.branch = branch; @@ -95,6 +98,15 @@ public class Project extends Resource implements Component { this.branch = branch; return this; } + + @CheckForNull + public String getOriginalName() { + return originalName; + } + + public void setOriginalName(String originalName) { + this.originalName = originalName; + } @Override public String getName() { |