diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2016-07-01 14:59:58 +0200 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2016-08-30 17:38:19 +0200 |
commit | ecc4bd7d1f79eaf255a91cc29d825193cfded8e0 (patch) | |
tree | a170f48be977bfa52a4557db83667ad9d5542206 /sonar-plugin-api/src | |
parent | ef892610fe2888078e33b5fd95d9220bd62e3c03 (diff) | |
download | sonarqube-ecc4bd7d1f79eaf255a91cc29d825193cfded8e0.tar.gz sonarqube-ecc4bd7d1f79eaf255a91cc29d825193cfded8e0.zip |
SONAR-7722 The project name should not be mandatory
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() { |