Skip to content

Commit

Permalink
fix native image, add resource mapping, update reflection mapping gen…
Browse files Browse the repository at this point in the history
…eration
  • Loading branch information
sbaier committed Mar 18, 2020
1 parent c77dfe9 commit 5121af3
Show file tree
Hide file tree
Showing 7 changed files with 1,242 additions and 421 deletions.
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ ext {
bouncycastleVersion='1.62'
nettyVersion = '4.1.37.Final'
gsonVersion = '2.8.6'
substrateVmVersion = '19.2.0'
substrateVmVersion = '19.2.1'
junitJupiterVersion = '5.5.1'
}

Expand Down Expand Up @@ -282,11 +282,12 @@ test {
***************/

graal {
graalVersion '19.2.0'
graalVersion '19.2.1'
outputName "${rootProject.name}"
mainClass application.mainClassName
option '-H:+PrintClassInitialization'
option '-H:ReflectionConfigurationFiles=tools/reflection.json'
option "-H:ResourceConfigurationFiles=tools/resources.json"
option '-H:-UseServiceLoaderFeature'
option '-H:IncludeResources="org/jline/utils/*.*'
option '-H:IncludeResources="org/jline/terminal/*.*'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,15 @@ public class ShellCommand implements Runnable {

private static boolean exitShell = false;

private final DefaultCLIProperties defaultCLIProperties;
private DefaultCLIProperties defaultCLIProperties;

@SuppressWarnings("NullableProblems")
@CommandLine.Spec
private @NotNull CommandLine.Model.CommandSpec spec;

public ShellCommand() {
}

@Inject
ShellCommand(final @NotNull DefaultCLIProperties defaultCLIProperties) {
this.defaultCLIProperties = defaultCLIProperties;
Expand Down
11 changes: 9 additions & 2 deletions tools/createReflectionJson.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ com.hivemq.cli.commands.shell.ShellExitCommand \
com.hivemq.cli.commands.cli.PublishCommand \
com.hivemq.cli.commands.cli.SubscribeCommand \
com.hivemq.cli.commands.MqttCLICommand \
> reflection.json
> reflection_pico.json

## the methods from the abstract classes in the PublishCommand and SubscribeCommand must be removed!

# Add additional mappings (currently, only HelpCommand for shell mode)
# jq filter from https://stackoverflow.com/questions/42011086/merge-arrays-of-json requires jq >= 1.5
# the methods from the abstract classes in the PublishCommand and SubscribeCommand must be removed,
# the second query in the pipeline does just that (remove methods array for classes that contain the activateDebugMethod method mapping, which is invalid)
jq -s '.[0]=([.[]]|flatten)|.[0]' reflection_pico.json reflection_additional.json \
| jq 'del(.[].methods | select(. != null) | select(.[].name == "activateDebugMode"))' \
> reflection.json
Loading

0 comments on commit 5121af3

Please sign in to comment.