Skip to content

Commit a424511

Browse files
Add internal API for accessing classpath information
1 parent ed71c8c commit a424511

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* SonarQube Java
3+
* Copyright (C) 2012-2025 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 Sonar Source-Available License Version 1, as published by SonarSource SA.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
* See the Sonar Source-Available License for more details.
13+
*
14+
* You should have received a copy of the Sonar Source-Available License
15+
* along with this program; if not, see https://sonarsource.com/license/ssal/
16+
*/
17+
package org.sonar.plugins.java.api.internal;
18+
19+
import org.sonar.api.scanner.ScannerSide;
20+
21+
/**
22+
* THIS API IS ONLY BE CONSUMED BY PLUGINS MAINTAINED BY SONARSOURCE.
23+
* IT IS NOT STABLE AND MAY CHANGE AT ANY TIME.
24+
* <p>
25+
* Provides classpath information (compilation outputs and libraries) for main and test sources.
26+
* Essentially, these are the paths that result from SonarJava's internal resolution of the {@code sonar.java[.test].binaries} and
27+
* {@code sonar.java[.test].libraries} properties.
28+
* <p>
29+
* This is an extension that is instantiated per-project (per-module in Maven terms) and can be injected when needed.
30+
*/
31+
@ScannerSide
32+
public interface ClasspathResolver {
33+
ResolvedClasspath mainClasspath();
34+
35+
ResolvedClasspath testClasspath();
36+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* SonarQube Java
3+
* Copyright (C) 2012-2025 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 Sonar Source-Available License Version 1, as published by SonarSource SA.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
* See the Sonar Source-Available License for more details.
13+
*
14+
* You should have received a copy of the Sonar Source-Available License
15+
* along with this program; if not, see https://sonarsource.com/license/ssal/
16+
*/
17+
package org.sonar.plugins.java.api.internal;
18+
19+
import java.nio.file.Path;
20+
import java.util.List;
21+
22+
/**
23+
* THIS API IS ONLY BE CONSUMED BY PLUGINS MAINTAINED BY SONARSOURCE.
24+
* IT IS NOT STABLE AND MAY CHANGE AT ANY TIME.
25+
* <p>
26+
* Resolved classpath information (compilation outputs and libraries) for either the main or test sources of one project
27+
* (i.e. module in Maven terms).
28+
* Instances of this can be obtained from {@link ClasspathResolver}.
29+
*/
30+
public interface ResolvedClasspath {
31+
List<Path> sonarJavaBinaries();
32+
33+
List<Path> sonarJavaLibraries();
34+
}

0 commit comments

Comments
 (0)