Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jnigen] Fix summarizer and improve errors #1103

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions pkgs/jnigen/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

- **Breaking Change** ([#660](https://github.com/dart-lang/native/issues/660)):
Removed C-based bindings. Now all bindings are Dart-only.
- Expand constraint on `package:cli_config` to allow `^0.2.0`.
- Ignore `use_super_parameters` lint in generated files.
- Expanded constraint on `package:cli_config` to allow `^0.2.0`.
- Ignored `use_super_parameters` lint in generated files.
- Fixed a bug in summarizer and improved the display of errors.

## 0.8.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.dart_lang.jnigen.apisummarizer;

import java.io.PrintWriter;
import java.util.Arrays;
import org.apache.commons.cli.*;

Expand Down Expand Up @@ -63,15 +64,22 @@ public static SummarizerOptions parseArgs(String[] args) {
try {
cmd = parser.parse(options, args);
if (cmd.getArgs().length < 1) {
throw new ParseException("Need to specify paths to source files");
throw new ParseException("Need to specify the package or class names");
}
} catch (ParseException e) {
System.out.println(e.getMessage());
System.err.println(e.getMessage());
help.printHelp(
new PrintWriter(System.err, true),
help.getWidth(),
"java -jar <JAR> [-s <SOURCE_DIR=.>] "
+ "[-c <CLASSES_JAR>] <CLASS_OR_PACKAGE_NAMES>\n"
+ "Class or package names should be fully qualified.\n\n",
options);
null,
options,
help.getLeftPadding(),
help.getDescPadding(),
null,
false);
System.exit(1);
throw new RuntimeException("Unreachable code");
}
Expand Down
6 changes: 1 addition & 5 deletions pkgs/jnigen/lib/src/summary/summary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ class SummarizerCommand {
final joined = paths
.map((uri) => uri.toFilePath())
.join(Platform.isWindows ? ';' : ':');
if (option.endsWith("=")) {
args.add(option + joined);
} else {
args.addAll([option, joined]);
}
args.addAll([option, '"$joined"']);
}
}

Expand Down
Loading