Skip to content

Commit 84ad741

Browse files
committed
Handle -cp javac compiler option just like -classpath
Previously, the `lsif-java index` command only worked if the build tool used the `-classpath` javac option, but not the equivalent `-cp` option. Now, we treat `-cp` and `-classpath` equally.
1 parent c1bd87d commit 84ad741

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/SemanticdbOptionBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public class SemanticdbOptionBuilder {
2727
public void processArgument(String arg) {
2828
oldArgs.add(arg);
2929
arg = unwrapQuote(arg);
30-
if ("-processorpath".equals(previousArg) || "-classpath".equals(previousArg)) {
30+
if ("-processorpath".equals(previousArg)
31+
|| "-classpath".equals(previousArg)
32+
|| "-cp".equals(previousArg)) {
3133
isClasspathUpdated = true;
3234
result.add(PLUGINPATH + File.pathSeparator + arg);
3335
} else if (arg.startsWith("-J")) {

0 commit comments

Comments
 (0)