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.

ProjectBuilder.java 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2020 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.api.batch.bootstrap;
  21. import org.sonar.api.ExtensionPoint;
  22. import org.sonar.api.config.Configuration;
  23. import org.sonar.api.scanner.ScannerSide;
  24. /**
  25. * This extension point allows to change project structure at runtime. It is executed once during task startup.
  26. * Some use-cases :
  27. * <ul>
  28. * <li>Add sub-projects. For example the C# plugin gets the hierarchy
  29. * of sub-projects from the Visual Studio metadata file. The single root pom.xml does not contain any declarations of
  30. * modules</li>
  31. * <li>Change project metadata like description or source directories.</li>
  32. * </ul>
  33. *
  34. * @deprecated since 6.5. It won't be possible to manipulate the project's structure.
  35. * @since 2.9
  36. */
  37. @ScannerSide
  38. @ExtensionPoint
  39. @Deprecated
  40. public abstract class ProjectBuilder {
  41. @Deprecated
  42. public interface Context {
  43. ProjectReactor projectReactor();
  44. /**
  45. * Global config (command line arguments, global scanner properties).
  46. * @since 8.3 Only as a replacement for injecting Settings
  47. */
  48. Configuration config();
  49. }
  50. /**
  51. * @since 3.7
  52. */
  53. protected ProjectBuilder() {
  54. }
  55. /**
  56. * Override this method to change project reactor structure.
  57. * @since 3.7
  58. */
  59. public void build(Context context) {
  60. // Call deprecated method for backward compatibility
  61. build(context.projectReactor());
  62. }
  63. /**
  64. * @deprecated since 3.7 override {@link #build(Context)} instead
  65. */
  66. @Deprecated
  67. protected void build(ProjectReactor reactor) {
  68. }
  69. }