Skip to content

Commit

Permalink
[#1151] Fix reflect-config generator to include options from compiled…
Browse files Browse the repository at this point in the history
… sources
  • Loading branch information
remkop committed Aug 25, 2020
1 parent 5f35c3b commit c6e19b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Picocli follows [semantic versioning](http://semver.org/).


## <a name="4.5.1-fixes"></a> Fixed issues
* [#1151] Bugfix: `ManPageGenerator` as subcommand with native-image throws exception. Thanks to [Sebastian Hoß](https:/sebhoss) for reporting this.
* [#1152] Bugfix: Gradle build fail when using picocli 4.4.0 or 4.5.0: Gradle Module Metadata for picocli 4.4.0+ missing from Maven Central. Thanks to [Frank Pavageau](https:/fpavageau) for reporting this.
* [#1150] Bugfix: Fix terminal width detection on macOS. Thanks to [David Phillips](https:/electrum) for the pull request.
* [#1142] DOC: Update Kotlin GraalVM native image example - Update native image gradle plugin. Now supports jdk 11. Thanks to [OndrejMalek](https:/OndrejMalek) for the pull request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public void testIssue1151() {
}


@Ignore("Requires fix for https:/remkop/picocli/issues/1151")
@Test
public void testGenerateReflectConfigIssue1151() {
NativeImageConfigGeneratorProcessor processor = new NativeImageConfigGeneratorProcessor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,18 @@ private CommandSpec buildCommand(Element element, final Context context, final R
@Override
public Void visitType(TypeElement e, CommandSpec commandSpec) {
updateCommandSpecFromTypeElement(e, context, commandSpec, roundEnv);

List<? extends Element> enclosedElements = e.getEnclosedElements();
processEnclosedElements(context, roundEnv, enclosedElements);
return null;
}

@Override
public Void visitExecutable(ExecutableElement e, CommandSpec commandSpec) {
updateCommandFromMethodElement(e, context, commandSpec, roundEnv);

List<? extends Element> enclosedElements = e.getEnclosedElements();
processEnclosedElements(context, roundEnv, enclosedElements);
return null;
}
}, result);
Expand Down Expand Up @@ -382,9 +388,6 @@ private void registerSubcommands(List<AnnotationValue> typeMirrors,
if (isValidSubcommandHasNameAttribute(subcommandElement)) {
CommandSpec commandSpec = buildCommand(subcommandElement, context, roundEnv);
result.add(commandSpec);

List<? extends Element> enclosedElements = subcommandElement.getEnclosedElements();
processEnclosedElements(context, roundEnv, enclosedElements);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ static final class Visitor {
List.class.getName(),
Set.class.getName(),
Map.class.getName(),
Class.class.getName(), Class[].class.getName(), Class[].class.getCanonicalName(), "java.lang.Class<?>", "java.lang.Class<?>[]",
"java.lang.reflect.Executable", // addMethod("getParameters")
"java.lang.reflect.Parameter", // addMethod("getName");
"org.fusesource.jansi.AnsiConsole", // addField("out", false);
Expand Down

0 comments on commit c6e19b4

Please sign in to comment.