Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,33 @@ public static int runAndReturnExitCode(String[] args) throws IOException, Interr
}

List<MavenPackage> mavenPackages = mavenPackages(options);
ScipSemanticdbReporter reporter =
new ScipSemanticdbReporter() {
private boolean hasErrors = false;

@Override
public void error(Throwable e) {
e.printStackTrace(System.err);
hasErrors = true;
}

@Override
public void error(String message) {
System.err.println("ERROR[scip-semanticdb]: " + message);
hasErrors = true;
}

@Override
public boolean hasErrors() {
return this.hasErrors;
}
};
ScipSemanticdbOptions scipOptions =
new ScipSemanticdbOptions(
options.targetroots,
options.output,
options.sourceroot,
new ScipSemanticdbReporter() {
@Override
public void error(Throwable e) {
e.printStackTrace(System.err);
}
},
reporter,
LsifToolInfo.newBuilder().setName("scip-java").setVersion("HEAD").build(),
"java",
ScipOutputFormat.TYPED_PROTOBUF,
Expand All @@ -50,10 +66,14 @@ public void error(Throwable e) {
"",
true);
ScipSemanticdb.run(scipOptions);

if (!scipOptions.reporter.hasErrors()) {
System.out.println("done: " + scipOptions.output);
return 0;
} else {
System.out.println("SCIP index generation failed");
return 1;
}
return 0;
}

public static List<MavenPackage> mavenPackages(BazelOptions options)
Expand Down