Skip to content

Commit

Permalink
split build args correcltly
Browse files Browse the repository at this point in the history
  • Loading branch information
houcine7 committed Aug 6, 2024
1 parent c87de63 commit aa39c68
Showing 1 changed file with 3 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,29 +243,12 @@ protected List<String> getBuildArgs() throws MojoExecutionException {

if (buildArgs != null && !buildArgs.isEmpty()) {
for (String buildArg : buildArgs) {
if(buildArg.startsWith("\\Q") ||
buildArg.startsWith("-H:ConfigurationFileDirectories")) {
System.out.println(buildArg);
if(buildArg.startsWith("\\Q") || buildArg.startsWith("-H")) {
cliArgs.add(buildArg);
continue;
}
String[] args = buildArg.split("\\s+");
int i=0;
while(i < args.length) {
String a =args[i];
if (a.charAt(0) == System.getProperty("user.home").charAt(0)) {
StringBuilder path = new StringBuilder(a);
i++;
while( i< args.length && args[i].toLowerCase().charAt(0) <= 'z' &&
args[i].toLowerCase().charAt(0) >= 'a') {
path.append(" ").append(args[i]);
i++;
}
cliArgs.add(path.toString());
} else {
cliArgs.add(a);
i++;
}
}
cliArgs.addAll(Arrays.asList(buildArg.split("\\s+", 2)));
}
}

Expand Down

0 comments on commit aa39c68

Please sign in to comment.