You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ScannerProperties.java 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2021 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonar.core.config;
  21. import java.util.List;
  22. import org.sonar.api.CoreProperties;
  23. import org.sonar.api.config.PropertyDefinition;
  24. import org.sonar.api.resources.Qualifiers;
  25. import static java.util.Arrays.asList;
  26. import static org.sonar.api.PropertyType.BOOLEAN;
  27. public class ScannerProperties {
  28. public static final String BRANCHES_DOC_LINK = "https://redirect.sonarsource.com/doc/branches.html";
  29. public static final String BRANCH_NAME = "sonar.branch.name";
  30. @Deprecated
  31. public static final String BRANCH_TARGET = "sonar.branch.target";
  32. public static final String PULL_REQUEST_KEY = "sonar.pullrequest.key";
  33. public static final String PULL_REQUEST_BRANCH = "sonar.pullrequest.branch";
  34. public static final String PULL_REQUEST_BASE = "sonar.pullrequest.base";
  35. public static final String LINKS_SOURCES_DEV = "sonar.links.scm_dev";
  36. public static final String DISABLE_PROJECT_AND_ORG_AUTODETECTION = "sonar.keys_autodetection.disabled";
  37. private ScannerProperties() {
  38. // only static stuff
  39. }
  40. public static List<PropertyDefinition> all() {
  41. return asList(
  42. PropertyDefinition.builder(CoreProperties.SCM_DISABLED_KEY)
  43. .name("Disable the SCM Sensor")
  44. .description("Disable the retrieval of blame information from Source Control Manager")
  45. .category(CoreProperties.CATEGORY_SCM)
  46. .type(BOOLEAN)
  47. .onQualifiers(Qualifiers.PROJECT)
  48. .defaultValue(String.valueOf(false))
  49. .build(),
  50. PropertyDefinition.builder(CoreProperties.SCM_PROVIDER_KEY)
  51. .name("Key of the SCM provider for this project")
  52. .description("Force the provider to be used to get SCM information for this project. By default auto-detection is done. Example: svn, git.")
  53. .category(CoreProperties.CATEGORY_SCM)
  54. .onlyOnQualifiers(Qualifiers.PROJECT)
  55. .build(),
  56. PropertyDefinition.builder(BRANCH_NAME)
  57. .name("Optional name of SonarQube/SCM branch")
  58. .description("Provide a name for the branch being analyzed. It might match an existing branch of the project, otherwise a new branch will be created.")
  59. .hidden()
  60. .build(),
  61. PropertyDefinition.builder(PULL_REQUEST_BRANCH)
  62. .name("Optional name of pull request")
  63. .description("Provide a name for the pull request being analyzed. It might match an existing pull request of the project, otherwise a new pull request will be created.")
  64. .hidden()
  65. .build(),
  66. PropertyDefinition.builder(PULL_REQUEST_BASE)
  67. .name("Optional name of target branch to merge into")
  68. .description(
  69. "Defines the target branch of the pull request being analyzed. "
  70. + "If no target is defined, the main branch is used as the target.")
  71. .hidden()
  72. .build(),
  73. PropertyDefinition.builder(DISABLE_PROJECT_AND_ORG_AUTODETECTION)
  74. .name("Disables project auto-detection")
  75. .description("Disables auto-detection of project keys from scanner execution environment.")
  76. .type(BOOLEAN)
  77. .hidden()
  78. .build());
  79. }
  80. }