Skip to content

Commit

Permalink
split build arguments correcltly
Browse files Browse the repository at this point in the history
  • Loading branch information
houcine7 committed Aug 8, 2024
1 parent c87de63 commit 5a86516
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,29 +243,11 @@ protected List<String> getBuildArgs() throws MojoExecutionException {

if (buildArgs != null && !buildArgs.isEmpty()) {
for (String buildArg : buildArgs) {
if(buildArg.startsWith("\\Q") ||
buildArg.startsWith("-H:ConfigurationFileDirectories")) {
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification {
boolean IS_MAC = System.getProperty("os.name", "unknown").contains("Mac");

def setup() {
var home_dir = Path.of(System.getProperty("user.home"))
testDirectory = home_dir.resolve("tests")
Path HomeDir = Path.of(System.getProperty("user.home"))
testDirectory = HomeDir.resolve("tests")

if (Files.notExists(testDirectory)) {
Files.createDirectory(testDirectory)
Expand All @@ -89,8 +89,6 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification {
}

def cleanup() {

//cleanup test directory and all it's sub directories
Files.walkFileTree(testDirectory, new SimpleFileVisitor<Path>() {
@Override
FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Expand Down

0 comments on commit 5a86516

Please sign in to comment.